Browse Source

[REF]GOLEM Member Account : better action handling

And ensure customer not supplier invoies
pull/43/head
Fabien BOURGEOIS 2 years ago
parent
commit
6a7c9beee9
2 changed files with 12 additions and 24 deletions
  1. +1
    -1
      golem_member_account/__manifest__.py
  2. +11
    -23
      golem_member_account/models/golem_member.py

+ 1
- 1
golem_member_account/__manifest__.py View File

@ -20,7 +20,7 @@
'name': 'GOLEM members account',
'summary': 'GOLEM non-profit members account',
'description': 'GOLEM non-profit members account',
'version': '10.0.1.1.0',
'version': '10.0.1.1.1',
'category': 'GOLEM',
'author': 'Fabien Bourgeois, Michel Dessenne',
'license': 'AGPL-3',


+ 11
- 23
golem_member_account/models/golem_member.py View File

@ -47,34 +47,22 @@ class GolemMember(models.Model):
def open_partner_invoices(self):
""" Open member invoices """
self.ensure_one()
action = self.env.ref('account.action_invoice_tree1')
context = {'type':'out_invoice', 'journal_type': 'sale',
'search_default_partner_id': self[0].partner_id.id,
'default_partner_id': self[0].partner_id.id}
return {'type': 'ir.actions.act_window',
'name': action.name,
'res_model': 'account.invoice',
'view_type': action.view_type,
'view_mode': action.view_mode,
'domain': action.domain,
'context': context}
action = self.env.ref('account.action_invoice_tree1').read()[0]
action['context'] = {'type':'out_invoice', 'journal_type': 'sale',
'search_default_partner_id': self[0].partner_id.id,
'default_partner_id': self[0].partner_id.id}
return action
@api.multi
def open_partner_payments(self):
""" Open member payments """
self.ensure_one()
action = self.env.ref('account.action_account_payments')
context = {'default_payment_type': 'inbound',
'default_partner_type': 'customer',
'search_default_partner_id': self[0].partner_id.id,
'default_partner_id': self[0].partner_id.id}
return {'type': 'ir.actions.act_window',
'name': action.name,
'res_model': 'account.payment',
'view_type': action.view_type,
'view_mode': action.view_mode,
'domain': action.domain,
'context': context}
action = self.env.ref('account.action_account_payments').read()[0]
action['context'] = {'default_payment_type': 'inbound',
'default_partner_type': 'customer',
'search_default_partner_id': self[0].partner_id.id,
'default_partner_id': self[0].partner_id.id}
return action
@api.depends('invoice_ids')
def _compute_last_payment_state(self):


Loading…
Cancel
Save