diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-07-16 16:25:59 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-07-16 16:25:59 +0200 |
| commit | ed99894ac63aebffdbfe2f3b6f6c3f6efb4d14d7 (patch) | |
| tree | da6b867962186ac4be10a7c59db91acd0a609220 /addons | |
| parent | be9378709ca1ce91111e41f72e5f077413884dd3 (diff) | |
| parent | 13e321325b9c09f525dcd89e1ba27eb37bb3ac8f (diff) | |
[MERGE] forward port branch 10.0 up to 13e321325b9
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/account/tests/test_reconciliation.py | 9 | ||||
| -rw-r--r-- | addons/l10n_fr/data/account_chart_template_data.xml | 6 | ||||
| -rw-r--r-- | addons/point_of_sale/static/src/js/chrome.js | 2 | ||||
| -rw-r--r-- | addons/sale_stock/models/account_invoice.py | 3 | ||||
| -rw-r--r-- | addons/web/static/src/js/framework/data.js | 13 |
5 files changed, 24 insertions, 9 deletions
diff --git a/addons/account/tests/test_reconciliation.py b/addons/account/tests/test_reconciliation.py index d4dfac560a5..6664373027c 100644 --- a/addons/account/tests/test_reconciliation.py +++ b/addons/account/tests/test_reconciliation.py @@ -789,12 +789,19 @@ class TestReconciliation(AccountingTestCase): statement = self.make_payment(invoice, journal, 50) + # The report searches on the create_date to dispatch reconciled lines to report periods + # Also, in this case, there can be only 1 partial_reconcile + statement_partial_id = statement.move_line_ids.mapped(lambda l: l.matched_credit_ids + l.matched_debit_ids) + self.env.cr.execute('UPDATE account_partial_reconcile SET create_date = %(date)s WHERE id = %(partial_id)s', + {'date': report_date_to + ' 00:00:00', + 'partial_id': statement_partial_id.id}) + # Case 1: The invoice and payment are reconciled: Nothing should appear report_lines, total, amls = AgedReport._get_partner_move_lines(account_type, report_date_to, 'posted', 30) partner_lines = [line for line in report_lines if line['partner_id'] == partner.id] self.assertEqual(partner_lines, [], 'The aged receivable shouldn\'t have lines at this point') - self.assertFalse(partner.id in amls, 'The aged receivable should not have amls either') + self.assertFalse(amls.get(partner.id, False), 'The aged receivable should not have amls either') # Case 2: The invoice and payment are not reconciled: we should have one line on the report # and 2 amls diff --git a/addons/l10n_fr/data/account_chart_template_data.xml b/addons/l10n_fr/data/account_chart_template_data.xml index 7d14cd2d9eb..a0a9761c75a 100644 --- a/addons/l10n_fr/data/account_chart_template_data.xml +++ b/addons/l10n_fr/data/account_chart_template_data.xml @@ -1251,6 +1251,7 @@ <field name="name">Prêts participatifs</field> <field name="code">2741</field> <field name="user_type_id" ref="account.data_account_type_current_assets"/> + <field name="reconcile" eval="True"/> <field name="chart_template_id" ref="l10n_fr_pcg_chart_template"/> </record> @@ -1258,6 +1259,7 @@ <field name="name">Prêts aux associés</field> <field name="code">2742</field> <field name="user_type_id" ref="account.data_account_type_current_assets"/> + <field name="reconcile" eval="True"/> <field name="chart_template_id" ref="l10n_fr_pcg_chart_template"/> </record> @@ -1265,6 +1267,7 @@ <field name="name">Prêts au personnel</field> <field name="code">2743</field> <field name="user_type_id" ref="account.data_account_type_current_assets"/> + <field name="reconcile" eval="True"/> <field name="chart_template_id" ref="l10n_fr_pcg_chart_template"/> </record> @@ -1272,6 +1275,7 @@ <field name="name">Autres prêts</field> <field name="code">2748</field> <field name="user_type_id" ref="account.data_account_type_current_assets"/> + <field name="reconcile" eval="True"/> <field name="chart_template_id" ref="l10n_fr_pcg_chart_template"/> </record> @@ -1279,6 +1283,7 @@ <field name="name">Dépôts</field> <field name="code">2751</field> <field name="user_type_id" ref="account.data_account_type_current_assets"/> + <field name="reconcile" eval="True"/> <field name="chart_template_id" ref="l10n_fr_pcg_chart_template"/> </record> @@ -1286,6 +1291,7 @@ <field name="name">Cautionnements</field> <field name="code">2755</field> <field name="user_type_id" ref="account.data_account_type_current_assets"/> + <field name="reconcile" eval="True"/> <field name="chart_template_id" ref="l10n_fr_pcg_chart_template"/> </record> diff --git a/addons/point_of_sale/static/src/js/chrome.js b/addons/point_of_sale/static/src/js/chrome.js index b9370802dd6..3c2bf4519a1 100644 --- a/addons/point_of_sale/static/src/js/chrome.js +++ b/addons/point_of_sale/static/src/js/chrome.js @@ -630,7 +630,7 @@ var Chrome = PosBaseWidget.extend({ if(err.message === 'XmlHttpRequestError '){ title = 'Network Failure (XmlHttpRequestError)'; body = 'The Point of Sale could not be loaded due to a network problem.\n Please check your internet connection.'; - }else if(err.message === 'OpenERP Server Error'){ + }else if(err.code === 200){ title = err.data.message; body = err.data.debug; } diff --git a/addons/sale_stock/models/account_invoice.py b/addons/sale_stock/models/account_invoice.py index 084ffbd3706..a6dccfbc01c 100644 --- a/addons/sale_stock/models/account_invoice.py +++ b/addons/sale_stock/models/account_invoice.py @@ -49,7 +49,8 @@ class AccountInvoiceLine(models.Model): qty_to_consider = invoiced_qty - qty_done qty_to_consider = min(qty_to_consider, quantity - qty_delivered) qty_delivered += qty_to_consider - average_price_unit = (average_price_unit * (qty_delivered - qty_to_consider) + move.price_unit * qty_to_consider) / qty_delivered + if qty_delivered: + average_price_unit = (average_price_unit * (qty_delivered - qty_to_consider) + move.price_unit * qty_to_consider) / qty_delivered if qty_delivered == quantity: break return average_price_unit diff --git a/addons/web/static/src/js/framework/data.js b/addons/web/static/src/js/framework/data.js index 1d4258019ae..5338fb8e648 100644 --- a/addons/web/static/src/js/framework/data.js +++ b/addons/web/static/src/js/framework/data.js @@ -261,14 +261,15 @@ var QueryGroup = Class.extend({ var count_key = (grouping_fields[0] && grouping_fields[0].split(':')[0]) + '_count'; var aggregates = {}; - _(fixed_group).each(function (value, key) { - if (key.indexOf('__') === 0 + for (var key in fixed_group) { + if (fixed_group.hasOwnProperty(key)) { + if (!(key.indexOf('__') === 0 || _.contains(grouping_fields, key) - || (key === count_key)) { - return; + || (key === count_key))) { + aggregates[key] = fixed_group[key] || 0; + } } - aggregates[key] = value || 0; - }); + } this.model = new Model( model, fixed_group.__context, fixed_group.__domain); |
