From 71699b0ae2600646802e6724fae351ca5206fb15 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Sun, 18 Sep 2016 11:54:47 +0200 Subject: [PATCH] [IMP] separate sale statement lines from cash statement lines courtesy @jweste --- pos_session_summary/i18n/fr.po | 42 +++++++++++++++++-- pos_session_summary/models/__init__.py | 1 + .../models/account_bank_statement.py | 31 ++++++++++++++ .../views/pos_session_view.xml | 4 ++ 4 files changed, 74 insertions(+), 4 deletions(-) create mode 100644 pos_session_summary/models/account_bank_statement.py diff --git a/pos_session_summary/i18n/fr.po b/pos_session_summary/i18n/fr.po index 9cf29bc2..a92e9b24 100644 --- a/pos_session_summary/i18n/fr.po +++ b/pos_session_summary/i18n/fr.po @@ -1,13 +1,13 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * pos_session_summary +# * pos_session_summary # msgid "" msgstr "" "Project-Id-Version: Odoo Server 9.0c\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-04-03 23:55+0000\n" -"PO-Revision-Date: 2016-04-03 23:55+0000\n" +"POT-Creation-Date: 2016-09-07 14:33+0000\n" +"PO-Revision-Date: 2016-09-07 14:33+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -15,11 +15,46 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. module: pos_session_summary +#: model:ir.ui.view,arch_db:pos_session_summary.report_sessionsummary_louve +msgid "Cash Moves" +msgstr "Mouvements d'argent" + +#. module: pos_session_summary +#: model:ir.ui.view,arch_db:pos_session_summary.report_sessionsummary_louve +msgid "Sale Transactions Subtotal" +msgstr "Ss-total des ventes" + +#. module: pos_session_summary +#: model:ir.model,name:pos_session_summary.model_account_bank_statement +msgid "Bank Statement" +msgstr "Relevé bancaire" + +#. module: pos_session_summary +#: model:ir.model.fields,field_description:pos_session_summary.field_account_bank_statement_total_entry_encoding_cash +msgid "Cash Moves" +msgstr "Mouvements d'argent" + #. module: pos_session_summary #: model:ir.model.fields,field_description:pos_session_summary.field_pos_session_order_qty msgid "Orders Qty" msgstr "Nb. ventes" +#. module: pos_session_summary +#: model:ir.model.fields,field_description:pos_session_summary.field_account_bank_statement_total_entry_encoding_sales +msgid "Sale Transactions Subtotal" +msgstr "Ss-total des Ventes" + +#. module: pos_session_summary +#: model:ir.model.fields,help:pos_session_summary.field_account_bank_statement_total_entry_encoding_cash +msgid "Total of cash inputs or outputs." +msgstr "Total des entrées ou sorties d'argent." + +#. module: pos_session_summary +#: model:ir.model.fields,help:pos_session_summary.field_account_bank_statement_total_entry_encoding_sales +msgid "Total of sale transaction lines." +msgstr "Total des transactions de vente." + #. module: pos_session_summary #: model:ir.model.fields,field_description:pos_session_summary.field_pos_session_total_amount msgid "Transactions Total" @@ -29,4 +64,3 @@ msgstr "Total des transactions" #: model:ir.model,name:pos_session_summary.model_pos_session msgid "pos.session" msgstr "pos.session" - diff --git a/pos_session_summary/models/__init__.py b/pos_session_summary/models/__init__.py index ac13d7d5..05a7876b 100644 --- a/pos_session_summary/models/__init__.py +++ b/pos_session_summary/models/__init__.py @@ -1,2 +1,3 @@ # -*- coding: utf-8 -*- from . import pos_session +from . import account_bank_statement diff --git a/pos_session_summary/models/account_bank_statement.py b/pos_session_summary/models/account_bank_statement.py new file mode 100644 index 00000000..221a5a20 --- /dev/null +++ b/pos_session_summary/models/account_bank_statement.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2016-Today: La Louve () +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# Julien Weste (julien.weste@akretion.com.br) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import fields, models, api + + +class AccountBankStatement(models.Model): + _inherit = 'account.bank.statement' + + total_entry_encoding_sales = fields.Monetary( + 'Sale Transactions Subtotal', compute='_compute_total_entries', + store=True, multi='total_entries', + help="Total of sale transaction lines.") + total_entry_encoding_cash = fields.Monetary( + 'Cash Moves', compute='_compute_total_entries', store=True, + multi='total_entries', help="Total of cash inputs or outputs.") + + @api.multi + @api.depends( + 'line_ids', 'balance_start', 'line_ids.amount', 'balance_end_real') + def _compute_total_entries(self): + for abst in self: + abst.total_entry_encoding_sales = sum( + [line.amount for line in abst.line_ids + if line.pos_statement_id]) + abst.total_entry_encoding_cash = sum( + [line.amount for line in abst.line_ids + if not line.pos_statement_id]) diff --git a/pos_session_summary/views/pos_session_view.xml b/pos_session_summary/views/pos_session_view.xml index 6a41cfe2..3a747d21 100644 --- a/pos_session_summary/views/pos_session_view.xml +++ b/pos_session_summary/views/pos_session_view.xml @@ -26,6 +26,10 @@ + + + +