forked from Yaltik/golem
[REF]GOLEM Member Account : better action handling
And ensure customer not supplier invoies
This commit is contained in:
parent
3bdc141dad
commit
6a7c9beee9
@ -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',
|
||||
|
@ -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',
|
||||
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 {'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}
|
||||
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',
|
||||
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 {'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}
|
||||
return action
|
||||
|
||||
@api.depends('invoice_ids')
|
||||
def _compute_last_payment_state(self):
|
||||
|
Loading…
Reference in New Issue
Block a user