Skip to content

Commit

Permalink
[account_partner_reconcile] splits the button 'Match payments' to
Browse files Browse the repository at this point in the history
'Match Receivables' and 'Match payables', as the previous
button was just now working.
  • Loading branch information
JordiBForgeFlow committed Feb 4, 2019
1 parent 1ce8360 commit 295d45c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion account_partner_reconcile/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
'name': "Account Partner Reconcile",
'version': '11.0.1.0.0',
'version': '11.0.1.0.1',
'category': 'Accounting',
'author': 'Eficent,'
'Odoo Community Association (OCA), ',
Expand Down
11 changes: 7 additions & 4 deletions account_partner_reconcile/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ 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)
if reconcile_mode == 'customers':
accounts = self.property_account_receivable_id
else:
accounts = self.self.property_account_payable_id

action_context = {'show_mode_selector': True,
'partner_ids': [self.id, ],
'mode': reconcile_mode,
'account_ids': accounts.ids}
return {
'type': 'ir.actions.client',
Expand Down
8 changes: 7 additions & 1 deletion account_partner_reconcile/views/res_partner_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,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>
Expand Down

0 comments on commit 295d45c

Please sign in to comment.