From 4d01b8d074bb1487b77ad1eed5f8c3e422974efd Mon Sep 17 00:00:00 2001 From: michel Date: Tue, 6 Feb 2018 14:41:55 +0100 Subject: [PATCH] [TMP] Add Smartbutton invoices in member form --- golem_member/__manifest__.py | 2 +- golem_member/models/golem_member.py | 11 ++++++++++- golem_member/views/golem_member_views.xml | 12 ++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/golem_member/__manifest__.py b/golem_member/__manifest__.py index a9c06cd..ad3a380 100644 --- a/golem_member/__manifest__.py +++ b/golem_member/__manifest__.py @@ -24,7 +24,7 @@ 'license': 'AGPL-3', 'application': True, 'installable': True, - 'depends': ['golem_base', 'golem_activity', 'golem_season', + 'depends': ['account', 'golem_base', 'golem_activity', 'golem_season', 'odoo_partner_merge'], 'data': ['views/golem_member_views.xml', 'views/res_partner_views.xml', diff --git a/golem_member/models/golem_member.py b/golem_member/models/golem_member.py index 4329236..2ee2bde 100644 --- a/golem_member/models/golem_member.py +++ b/golem_member/models/golem_member.py @@ -66,7 +66,6 @@ class ResPartner(models.Model): gm_obj = self.env['golem.member'] gm_obj.create({'partner_id': self[0].id}) - class GolemMember(models.Model): """ GOLEM Member model """ _name = 'golem.member' @@ -220,6 +219,16 @@ class GolemMember(models.Model): self.generate_number() return res + @api.multi + def open_partner_invoices(self): + """ Go to member form """ + self.ensure_one() + if self[0].member_id: + return {'type': 'ir.actions.act_window', + 'res_model': 'account.invoice', + 'view_mode': 'tree', + 'res_id': self[0].member_id.id} + class GolemMemberNumber(models.Model): """ GOLEM Member Numbers """ diff --git a/golem_member/views/golem_member_views.xml b/golem_member/views/golem_member_views.xml index a1a4b77..836c82c 100644 --- a/golem_member/views/golem_member_views.xml +++ b/golem_member/views/golem_member_views.xml @@ -28,6 +28,17 @@ along with this program. If not, see .
Member form
+
+ +

@@ -42,6 +53,7 @@ along with this program. If not, see . +