Browse Source

[IMP] separate sale statement lines from cash statement lines courtesy @jweste

pull/77/head
Sylvain LE GAL 8 years ago
parent
commit
71699b0ae2
  1. 42
      pos_session_summary/i18n/fr.po
  2. 1
      pos_session_summary/models/__init__.py
  3. 31
      pos_session_summary/models/account_bank_statement.py
  4. 4
      pos_session_summary/views/pos_session_view.xml

42
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 "<strong>Cash Moves</strong>"
msgstr "<strong>Mouvements d'argent</strong>"
#. module: pos_session_summary
#: model:ir.ui.view,arch_db:pos_session_summary.report_sessionsummary_louve
msgid "<strong>Sale Transactions Subtotal</strong>"
msgstr "<strong>Ss-total des ventes</strong>"
#. 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"

1
pos_session_summary/models/__init__.py

@ -1,2 +1,3 @@
# -*- coding: utf-8 -*-
from . import pos_session
from . import account_bank_statement

31
pos_session_summary/models/account_bank_statement.py

@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2016-Today: La Louve (<http://www.lalouve.net/>)
# @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])

4
pos_session_summary/views/pos_session_view.xml

@ -26,6 +26,10 @@
<field name="order_qty" />
<field name="total_amount" />
</field>
<field name="total_entry_encoding" position="replace">
<field name="total_entry_encoding_sales" />
<field name="total_entry_encoding_cash" />
</field>
</field>
</record>

Loading…
Cancel
Save