add traslate to statement_lines
This commit is contained in:
20
statement.py
20
statement.py
@@ -199,7 +199,8 @@ class CloseStatementStart(ModelView):
|
||||
'Close Statement'
|
||||
__name__ = 'close.statement.start'
|
||||
|
||||
statementLines = fields.One2Many('statement.line', None, 'Lines')
|
||||
statementLines = fields.One2Many('statement.line', None, 'Lines Statement',
|
||||
states={'readonly': True})
|
||||
|
||||
|
||||
class CloseStatementDone(ModelView):
|
||||
@@ -242,7 +243,8 @@ class CloseStatement(Wizard):
|
||||
journals = [j.id for j in device.journals]
|
||||
draft_statements = {
|
||||
s.journal: s for s in Statement.search([
|
||||
('journal', 'in', journals),
|
||||
('journal', 'in', journals),
|
||||
('state', '=', 'draft'),
|
||||
], order=[
|
||||
('create_date', 'ASC'),
|
||||
])}
|
||||
@@ -277,6 +279,7 @@ class CloseStatement(Wizard):
|
||||
draft_statements = {
|
||||
s.journal: s for s in Statement.search([
|
||||
('journal', 'in', journals),
|
||||
('state', '=', 'draft')
|
||||
], order=[
|
||||
('create_date', 'ASC'),
|
||||
])}
|
||||
@@ -306,10 +309,7 @@ class CloseStatement(Wizard):
|
||||
statement.lines = statement.lines + conciliation
|
||||
|
||||
else:
|
||||
end_balance = statement.start_balance
|
||||
for line in statement.lines:
|
||||
end_balance += line.amount
|
||||
statement.end_balance = end_balance
|
||||
statement.end_balance = end_balance
|
||||
statement.save()
|
||||
statements.append(statement)
|
||||
results.append(gettext('sale_payment.close_statement',
|
||||
@@ -342,13 +342,13 @@ class StatementLine(ModelView):
|
||||
currency = fields.Many2One(
|
||||
'currency.currency', "Currency")
|
||||
start_balance = Monetary(
|
||||
"Start Balance", currency='currency', digits='currency')
|
||||
"Start Balance", currency='currency', digits='currency', states=_states)
|
||||
balance = Monetary(
|
||||
"Balance", currency='currency', digits='currency')
|
||||
"Balance", currency='currency', digits='currency', states=_states)
|
||||
end_balance = Monetary(
|
||||
"End Balance", currency='currency', digits='currency')
|
||||
transfer = Monetary(
|
||||
"Transfer", currency='currency', digits='currency')
|
||||
end_balance = Monetary(
|
||||
"End Balance", currency='currency', digits='currency')
|
||||
account = fields.Many2One('account.account', "Account",
|
||||
domain=[
|
||||
('company', '=', Eval('company', 0)),
|
||||
|
||||
Reference in New Issue
Block a user