From 9a6554bdc14defc7ab437b7c05f8bd03fc9d5b67 Mon Sep 17 00:00:00 2001 From: sinergia Date: Mon, 31 Jul 2023 23:21:42 -0500 Subject: [PATCH] =?UTF-8?q?feat:=20Se=20a=C3=B1ade=20campo=20de=20real=20d?= =?UTF-8?q?eclarado=20y=20descuadre?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locale/es.po | 8 ++++++++ statement.py | 13 ++++++++++++- view/statement_line_tree_sequence.xml | 6 ++++-- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/locale/es.po b/locale/es.po index fd9e2b7..57fc09b 100644 --- a/locale/es.po +++ b/locale/es.po @@ -122,6 +122,14 @@ msgctxt "field:statement.line,end_balance:" msgid "End Balance" msgstr "Saldo Final" +msgctxt "field:statement.line,real_cash:" +msgid "Real Cash" +msgstr "Declarado" + +msgctxt "field:statement.line,mismatch:" +msgid "Mismatch" +msgstr "Descuadre" + msgctxt "field:statement.line,transfer:" msgid "Transfer" msgstr "Trasladar" diff --git a/statement.py b/statement.py index 60eda69..5fa3210 100644 --- a/statement.py +++ b/statement.py @@ -346,9 +346,13 @@ class StatementLine(ModelView): balance = Monetary( "Balance", currency='currency', digits='currency', states=_states) end_balance = Monetary( - "End Balance", currency='currency', digits='currency') + "End Balance", currency='currency', digits='currency', readonly=True) transfer = Monetary( "Transfer", currency='currency', digits='currency') + real_cash = Monetary( + "Real Cash", currency='currency', digits='currency') + mismatch = Monetary( + "Mismatch", currency='currency', digits='currency', readonly=True) account = fields.Many2One('account.account', "Account", domain=[ ('company', '=', Eval('company', 0)), @@ -369,6 +373,13 @@ class StatementLine(ModelView): return Transaction().context.get('company') + def get_mismatch(self, name): + return 0 + + @fields.depends('end_balance', 'real_cash', 'mismatch') + def on_change_real_cash(self): + self.mismatch = self.real_cash - self.end_balance + class PayInvoiceSupplierStart(ModelView): 'Payment Invoice To Supplier' __name__ = 'pay_invoice.statement.start' diff --git a/view/statement_line_tree_sequence.xml b/view/statement_line_tree_sequence.xml index ebed34c..ef560b9 100644 --- a/view/statement_line_tree_sequence.xml +++ b/view/statement_line_tree_sequence.xml @@ -3,9 +3,11 @@ this repository contains the full copyright notices and license terms. --> - - + + + +