[MERGE] forward port branch 10.0 up to 13e321325b

This commit is contained in:
Christophe Simonis
2018-07-16 16:25:59 +02:00
5 changed files with 24 additions and 9 deletions
+8 -1
View File
@@ -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
@@ -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>
+1 -1
View File
@@ -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;
}
+2 -1
View File
@@ -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
+7 -6
View File
@@ -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);