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',
|
'name': 'GOLEM members account',
|
||||||
'summary': 'GOLEM non-profit members account',
|
'summary': 'GOLEM non-profit members account',
|
||||||
'description': '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',
|
'category': 'GOLEM',
|
||||||
'author': 'Fabien Bourgeois, Michel Dessenne',
|
'author': 'Fabien Bourgeois, Michel Dessenne',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
|
@ -47,34 +47,22 @@ class GolemMember(models.Model):
|
|||||||
def open_partner_invoices(self):
|
def open_partner_invoices(self):
|
||||||
""" Open member invoices """
|
""" Open member invoices """
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
action = self.env.ref('account.action_invoice_tree1')
|
action = self.env.ref('account.action_invoice_tree1').read()[0]
|
||||||
context = {'type':'out_invoice', 'journal_type': 'sale',
|
action['context'] = {'type':'out_invoice', 'journal_type': 'sale',
|
||||||
'search_default_partner_id': self[0].partner_id.id,
|
'search_default_partner_id': self[0].partner_id.id,
|
||||||
'default_partner_id': self[0].partner_id.id}
|
'default_partner_id': self[0].partner_id.id}
|
||||||
return {'type': 'ir.actions.act_window',
|
return action
|
||||||
'name': action.name,
|
|
||||||
'res_model': 'account.invoice',
|
|
||||||
'view_type': action.view_type,
|
|
||||||
'view_mode': action.view_mode,
|
|
||||||
'domain': action.domain,
|
|
||||||
'context': context}
|
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def open_partner_payments(self):
|
def open_partner_payments(self):
|
||||||
""" Open member payments """
|
""" Open member payments """
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
action = self.env.ref('account.action_account_payments')
|
action = self.env.ref('account.action_account_payments').read()[0]
|
||||||
context = {'default_payment_type': 'inbound',
|
action['context'] = {'default_payment_type': 'inbound',
|
||||||
'default_partner_type': 'customer',
|
'default_partner_type': 'customer',
|
||||||
'search_default_partner_id': self[0].partner_id.id,
|
'search_default_partner_id': self[0].partner_id.id,
|
||||||
'default_partner_id': self[0].partner_id.id}
|
'default_partner_id': self[0].partner_id.id}
|
||||||
return {'type': 'ir.actions.act_window',
|
return action
|
||||||
'name': action.name,
|
|
||||||
'res_model': 'account.payment',
|
|
||||||
'view_type': action.view_type,
|
|
||||||
'view_mode': action.view_mode,
|
|
||||||
'domain': action.domain,
|
|
||||||
'context': context}
|
|
||||||
|
|
||||||
@api.depends('invoice_ids')
|
@api.depends('invoice_ids')
|
||||||
def _compute_last_payment_state(self):
|
def _compute_last_payment_state(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user