Merge pull request #263 from Eficent/12.0-account_partner_reconcile-fix-buttons

[12.0][IMP] account_partner_reconcile: splits the button 'Match payments'
pull/274/head
Pedro M. Baeza 2019-05-29 16:46:46 +02:00 committed by GitHub
commit 69d5ad84fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 6 deletions

View File

@ -4,7 +4,7 @@
{
'name': "Account Partner Reconcile",
'version': '12.0.1.0.0',
'version': '12.0.1.0.1',
'category': 'Accounting',
'author': 'Eficent,'
'Odoo Community Association (OCA), ',

View File

@ -10,13 +10,15 @@ class ResPartner(models.Model):
@api.multi
def action_open_reconcile(self):
# Open reconciliation view for customers
accounts = self.env['account.account']
accounts += (self.property_account_receivable_id +
self.property_account_payable_id)
# Open reconciliation view for customers and suppliers
reconcile_mode = self.env.context.get('reconcile_mode', False)
accounts = self.property_account_payable_id
if reconcile_mode == 'customers':
accounts = self.property_account_receivable_id
action_context = {'show_mode_selector': True,
'partner_ids': [self.id, ],
'mode': reconcile_mode,
'account_ids': accounts.ids}
return {
'type': 'ir.actions.client',

View File

@ -13,7 +13,13 @@
<div name="button_box" position="inside">
<button class="oe_stat_button" type="object"
name="action_open_reconcile"
icon="fa-usd" string="Match payments">
context="{'reconcile_mode': 'customers'}"
icon="fa-usd" string="Match Receivables">
</button>
<button class="oe_stat_button" type="object"
name="action_open_reconcile"
context="{'reconcile_mode': 'suppliers'}"
icon="fa-usd" string="Match Payables">
</button>
</div>
</field>