diff --git a/models/scop_cotisation_idf.py b/models/scop_cotisation_idf.py index 0ab6eebaac80fa97a1467f4cf55eda9892dce45e..4b544cd068c0c6d37507f07046aba967ad6f2374 100644 --- a/models/scop_cotisation_idf.py +++ b/models/scop_cotisation_idf.py @@ -212,3 +212,20 @@ class ScopCotisationsIDF(models.Model): 'target': 'current', 'res_id': self.invoice_id.id } + + def action_show_partner_invoice_idf(self): + form_view = self.env.ref( + 'cgscop_invoice_idf.view_scop_invoice_idf_form').id + tree_view = self.env.ref( + 'cgscop_invoice_idf.view_scop_invoice_idf_tree').id + return { + 'type': 'ir.actions.act_window', + 'name': 'Factures IDF - ' + self.partner_id.name, + 'views': [ + [tree_view, "tree"], [form_view, "form"] + ], + 'view_mode': 'form', + 'res_model': 'scop.invoice.idf', + 'target': 'current', + 'domain': [('partner_id', '=', self.partner_id.id)] + } diff --git a/models/scop_invoice_idf.py b/models/scop_invoice_idf.py index f739515d138ca70ebae63ecf96044a83d3d6d506..deb53133295b0ba4792a2d6409ecd644c823ef1e 100644 --- a/models/scop_invoice_idf.py +++ b/models/scop_invoice_idf.py @@ -195,3 +195,20 @@ class ScopInvoiceIDF(models.Model): 'target': 'current', 'res_id': self.invoice_id.id } + + def action_show_partner_invoice_idf(self): + form_view = self.env.ref( + 'cgscop_invoice_idf.view_scop_invoice_idf_form').id + tree_view = self.env.ref( + 'cgscop_invoice_idf.view_scop_invoice_idf_tree').id + return { + 'type': 'ir.actions.act_window', + 'name': 'Factures IDF - ' + self.partner_id.name, + 'views': [ + [tree_view, "tree"], [form_view, "form"] + ], + 'view_mode': 'form', + 'res_model': 'scop.invoice.idf', + 'target': 'current', + 'domain': [('partner_id', '=', self.partner_id.id)] + } diff --git a/views/scop_cotisation_idf.xml b/views/scop_cotisation_idf.xml index 0ee62ff3b8f88c07a8633206227ad2e9fc600e12..2a8578f5039f0994faba4c0aea27fb822442c9bb 100644 --- a/views/scop_cotisation_idf.xml +++ b/views/scop_cotisation_idf.xml @@ -52,6 +52,7 @@ <form string="Cotisations IDF"> <sheet> <div class="oe_button_box" name="button_box"> + <button name="action_show_partner_invoice_idf" type="object" class="oe_stat_button" icon="fa-puzzle-piece">En cours</button> <button name="action_show_payments" type="object" class="oe_stat_button" icon="fa-eur" attrs="{'invisible': ['|', ('type', '!=', 'inv'), ('payments_ids', '=', False)]}">Paiments</button> <button name="action_show_invoice" type="object" class="oe_stat_button" icon="fa-calculator" diff --git a/views/scop_invoice_idf.xml b/views/scop_invoice_idf.xml index 5d626a84098f01951f47b5b44c0dafc1b5d002b7..8bac0cd86075b0b658693a1833deb4bfa1535c51 100644 --- a/views/scop_invoice_idf.xml +++ b/views/scop_invoice_idf.xml @@ -50,6 +50,7 @@ <form string="Paiements IDF"> <sheet> <div class="oe_button_box" name="button_box"> + <button name="action_show_partner_invoice_idf" type="object" class="oe_stat_button" icon="fa-puzzle-piece">En cours</button> <button name="action_show_payments" type="object" class="oe_stat_button" icon="fa-eur" attrs="{'invisible': ['|', ('type', '!=', 'inv'), ('payments_ids', '=', False)]}">Paiments</button> <button name="action_show_invoice" type="object" class="oe_stat_button" icon="fa-calculator"