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 @@ Prêts participatifs 2741 + @@ -1258,6 +1259,7 @@ Prêts aux associés 2742 + @@ -1265,6 +1267,7 @@ Prêts au personnel 2743 + @@ -1272,6 +1275,7 @@ Autres prêts 2748 + @@ -1279,6 +1283,7 @@ Dépôts 2751 + @@ -1286,6 +1291,7 @@ Cautionnements 2755 + 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);