update statement of account to avoide balance calculation errors #049616
This commit is contained in:
parent
c3d49914fc
commit
49dcb961b0
3
series
3
series
|
@ -19,7 +19,6 @@ search_warehouse.diff # [stock] search function for warehouse
|
||||||
issue10467.diff # [stock_lot] add lot to grouping when assign try if lot it's required on product
|
issue10467.diff # [stock_lot] add lot to grouping when assign try if lot it's required on product
|
||||||
issue8702.diff # [stock_supply_forecast] Support production forecast
|
issue8702.diff # [stock_supply_forecast] Support production forecast
|
||||||
|
|
||||||
statement_of_account.diff # [account] Cumulate balance of previous fiscal years
|
|
||||||
|
|
||||||
model.diff # [trytond] Allows dynamic fields in Model as required by the wizard in sale_pos_template_quantities
|
model.diff # [trytond] Allows dynamic fields in Model as required by the wizard in sale_pos_template_quantities
|
||||||
|
|
||||||
|
@ -55,3 +54,5 @@ issue11049.diff # [account_invoice_defer] Raise user error message for account n
|
||||||
issue11240.diff # [account_invoice] Can't reconcile by wizard in multicompany - patch pendent de core
|
issue11240.diff # [account_invoice] Can't reconcile by wizard in multicompany - patch pendent de core
|
||||||
|
|
||||||
issue10363.diff # [production] Remove unique product constraint on BOM
|
issue10363.diff # [production] Remove unique product constraint on BOM
|
||||||
|
|
||||||
|
statement_of_account.diff # [account] Cumulate balance of previous fiscal years
|
||||||
|
|
|
@ -1,37 +1,60 @@
|
||||||
diff -r 62f81d7eb78b account.py
|
diff --git a/account.py b/account.py
|
||||||
--- a/trytond/trytond/modules/account/account.py Fri Jul 07 10:04:01 2017 +0200
|
index 6c17998..e463b58 100644
|
||||||
+++ b/trytond/trytond/modules/account/account.py Fri Jul 07 10:30:29 2017 +0200
|
--- a/trytond/trytond/modules/account/account.py
|
||||||
@@ -2009,7 +2009,7 @@
|
+++ b/trytond/trytond/modules/account/account.py
|
||||||
|
@@ -1917,14 +1917,15 @@ class GeneralLedgerAccountContext(ModelView):
|
||||||
|
'General Ledger Account Context'
|
||||||
|
__name__ = 'account.general_ledger.account.context'
|
||||||
|
fiscalyear = fields.Many2One('account.fiscalyear', 'Fiscal Year',
|
||||||
|
- required=True)
|
||||||
|
+ required=False)
|
||||||
|
start_period = fields.Many2One('account.period', 'Start Period',
|
||||||
|
domain=[
|
||||||
|
('fiscalyear', '=', Eval('fiscalyear')),
|
||||||
|
('start_date', '<=', (Eval('end_period'), 'start_date')),
|
||||||
|
],
|
||||||
|
states={
|
||||||
|
- 'invisible': Eval('from_date', False) | Eval('to_date', False),
|
||||||
|
+ 'invisible': (Eval('from_date', False) | Eval('to_date', False)
|
||||||
|
+ | ~Eval('fiscalyear', False)),
|
||||||
|
},
|
||||||
|
depends=['fiscalyear', 'end_period', 'from_date', 'to_date'])
|
||||||
|
end_period = fields.Many2One('account.period', 'End Period',
|
||||||
|
@@ -1933,7 +1934,8 @@ class GeneralLedgerAccountContext(ModelView):
|
||||||
|
('start_date', '>=', (Eval('start_period'), 'start_date'))
|
||||||
|
],
|
||||||
|
states={
|
||||||
|
- 'invisible': Eval('from_date', False) | Eval('to_date', False),
|
||||||
|
+ 'invisible': (Eval('from_date', False) | Eval('to_date', False)
|
||||||
|
+ | ~Eval('fiscalyear', False)),
|
||||||
|
},
|
||||||
|
depends=['fiscalyear', 'start_period', 'from_date', 'to_date'])
|
||||||
|
from_date = fields.Date("From Date",
|
||||||
|
@@ -2145,7 +2147,7 @@ class GeneralLedgerLine(ModelSQL, ModelView):
|
||||||
def __setup__(cls):
|
def __setup__(cls):
|
||||||
super(GeneralLedgerLine, cls).__setup__()
|
super(GeneralLedgerLine, cls).__setup__()
|
||||||
cls.__access__.add('account')
|
cls.__access__.add('account')
|
||||||
- cls._order.insert(0, ('date', 'ASC'))
|
- cls._order.insert(0, ('date', 'ASC'))
|
||||||
+ cls._order = [('date', 'DESC'), ('id', 'DESC')]
|
+ cls._order = [('date', 'DESC'), ('id', 'DESC')]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def table_query(cls):
|
def table_query(cls):
|
||||||
@@ -2057,7 +2057,7 @@
|
@@ -2189,9 +2191,15 @@ class GeneralLedgerLine(ModelSQL, ModelView):
|
||||||
|
columns.append(column)
|
||||||
|
with Transaction().set_context(LedgerAccount._debit_credit_context()):
|
||||||
line_query, fiscalyear_ids = Line.query_get(line)
|
line_query, fiscalyear_ids = Line.query_get(line)
|
||||||
return line.join(move, condition=line.move == move.id
|
- return line.join(move, condition=line.move == move.id
|
||||||
).join(account, condition=line.account == account.id
|
- ).join(account, condition=line.account == account.id
|
||||||
- ).select(*columns, where=line_query)
|
- ).select(*columns, where=line_query)
|
||||||
+ ).select(*columns)
|
+ if fiscalyear_ids:
|
||||||
|
+ return line.join(move, condition=line.move == move.id
|
||||||
def get_party_required(self, name):
|
+ ).join(account, condition=line.account == account.id
|
||||||
return self.account.party_required
|
+ ).select(*columns, where=line_query)
|
||||||
diff -r 62f81d7eb78b view/general_ledger_line_context_form.xml
|
+ else:
|
||||||
--- a/trytond/trytond/modules/account/view/general_ledger_line_context_form.xml Fri Jul 07 10:04:01 2017 +0200
|
+ return line.join(move, condition=line.move == move.id
|
||||||
+++ b/trytond/trytond/modules/account/view/general_ledger_line_context_form.xml Fri Jul 07 10:30:29 2017 +0200
|
+ ).join(account, condition=line.account == account.id
|
||||||
@@ -6,4 +6,12 @@
|
+ ).select(*columns)
|
||||||
<label name="party_cumulate"/>
|
+
|
||||||
<field name="party_cumulate"/>
|
|
||||||
</xpath>
|
def get_currency(self, name):
|
||||||
+ <xpath expr="/form/field[@name='fiscalyear']" position="replace"/>
|
return self.company.currency.id
|
||||||
+ <xpath expr="/form/label[@name='fiscalyear']" position="replace"/>
|
|
||||||
+ <xpath expr="/form/field[@name='company']" position="replace"/>
|
|
||||||
+ <xpath expr="/form/label[@name='company']" position="replace"/>
|
|
||||||
+ <xpath expr="/form/field[@name='start_period']" position="replace"/>
|
|
||||||
+ <xpath expr="/form/label[@name='start_period']" position="replace"/>
|
|
||||||
+ <xpath expr="/form/field[@name='end_period']" position="replace"/>
|
|
||||||
+ <xpath expr="/form/label[@name='end_period']" position="replace"/>
|
|
||||||
</data>
|
|
||||||
|
|
Loading…
Reference in New Issue