[MERGE] forward port branch 10.0 up to 9beca598d4

This commit is contained in:
Christophe Simonis
2017-02-10 17:33:06 +01:00
3 changed files with 21 additions and 8 deletions
+1 -1
View File
@@ -1194,7 +1194,7 @@
<filter string="Unposted" domain="[('move_id.state','=','draft')]" help="Unposted Journal Items"/>
<filter name="posted" string="Posted" domain="[('move_id.state','=','posted')]" help="Posted Journal Items"/>
<separator/>
<filter string="Unreconciled" domain="[('full_reconcile_id', '=', False), ('reconciled','=', False), ('account_id.reconcile','=',True)]" help="Journal items where matching number isn't set" name="unreconciled"/>
<filter string="Unreconciled" domain="[('full_reconcile_id', '=', False), ('balance','!=', 0), ('account_id.reconcile','=',True)]" help="Journal items where matching number isn't set" name="unreconciled"/>
<separator/>
<filter string="Payable" domain="[('account_id.internal_type', '=', 'payable')]" help="From Payable accounts" name="payable"/>
<filter string="Receivable" domain="[('account_id.internal_type', '=', 'receivable')]" help="From Receivable accounts" name="receivable"/>
+15 -6
View File
@@ -36,7 +36,7 @@ class AccountMoveLineReconcile(models.TransientModel):
credit = debit = 0
lines = self.env['account.move.line'].browse(context.get('active_ids', []))
for line in lines:
if not line.reconciled:
if not line.full_reconcile_id:
credit += line.credit
debit += line.debit
precision = self.env.user.company_id.currency_id.decimal_places
@@ -64,9 +64,13 @@ class AccountMoveLineReconcile(models.TransientModel):
if aml.currency_id.id == currency:
continue
raise UserError(_('Operation not allowed. You can only reconcile entries that share the same secondary currency or that don\'t have one. Edit your journal items or make another selection before proceeding any further.'))
#Don't consider entrires that are already reconciled
move_lines_filtered = move_lines.filtered(lambda aml: not aml.reconciled)
#Because we are making a full reconcilition in batch, we need to consider use cases as defined in the test test_manual_reconcile_wizard_opw678153
#So we force the reconciliation in company currency only at first, then in second pass the amounts in secondary currency.
move_lines.with_context(skip_full_reconcile_check='amount_currency_excluded', manual_full_reconcile_currency=currency).reconcile()
#So we force the reconciliation in company currency only at first
move_lines_filtered.with_context(skip_full_reconcile_check='amount_currency_excluded', manual_full_reconcile_currency=currency).reconcile()
#then in second pass the amounts in secondary currency, only if some lines are still not fully reconciled
move_lines_filtered = move_lines.filtered(lambda aml: not aml.reconciled)
if move_lines_filtered:
move_lines_filtered.with_context(skip_full_reconcile_check='amount_currency_only', manual_full_reconcile_currency=currency).reconcile()
@@ -123,13 +127,18 @@ class AccountMoveLineReconcileWriteoff(models.TransientModel):
if aml.currency_id.id == currency:
continue
raise UserError(_('Operation not allowed. You can only reconcile entries that share the same secondary currency or that don\'t have one. Edit your journal items or make another selection before proceeding any further.'))
#Don't consider entrires that are already reconciled
move_lines_filtered = move_lines.filtered(lambda aml: not aml.reconciled)
#Because we are making a full reconcilition in batch, we need to consider use cases as defined in the test test_manual_reconcile_wizard_opw678153
#So we force the reconciliation in company currency only at first, then in second pass the amounts in secondary currency.
#So we force the reconciliation in company currency only at first,
context['skip_full_reconcile_check'] = 'amount_currency_excluded'
context['manual_full_reconcile_currency'] = currency
writeoff = move_lines.with_context(context).reconcile(self.writeoff_acc_id, self.journal_id)
writeoff = move_lines_filtered.with_context(context).reconcile(self.writeoff_acc_id, self.journal_id)
#then in second pass the amounts in secondary currency, only if some lines are still not fully reconciled
move_lines_filtered = move_lines.filtered(lambda aml: not aml.reconciled)
if move_lines_filtered:
move_lines_filtered.with_context(skip_full_reconcile_check='amount_currency_only', manual_full_reconcile_currency=currency).reconcile()
(move_lines + writeoff).compute_full_after_batch_reconcile()
if not isinstance(writeoff, bool):
move_lines += writeoff
move_lines.compute_full_after_batch_reconcile()
return {'type': 'ir.actions.act_window_close'}
+5 -1
View File
@@ -138,6 +138,10 @@
&.o_readonly {
visibility: visible;
color: transparent;
> .o_checkbox {
visibility: hidden;
}
}
}
}
@@ -158,7 +162,7 @@
max-width: 100%; // Fix a chrome bug where badge would not break on multiple lines
}
&.o_readonly {
&.o_readonly:not(.o_checkbox) {
background-color: transparent;
padding: 5px;
}