From 3f6deb24ee85f8b1ab138555306e1d159f505a7a Mon Sep 17 00:00:00 2001 From: Cas Vissers Date: Thu, 25 Oct 2018 13:35:37 +0000 Subject: [PATCH 1/2] [CLA] Brahoo signs Odoo CCLA --- doc/cla/corporate/brahoo.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 doc/cla/corporate/brahoo.md diff --git a/doc/cla/corporate/brahoo.md b/doc/cla/corporate/brahoo.md new file mode 100644 index 00000000000..04e4d39cb31 --- /dev/null +++ b/doc/cla/corporate/brahoo.md @@ -0,0 +1,15 @@ +The Netherlands, 2018-10-24 + +Brahoo B.V. agrees to the terms of the Odoo Corporate Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Cas Vissers c.vissers@brahoo.nl https://github.com/CasVissers + +List of contributors: + +Cas Vissers c.vissers@brahoo.nl https://github.com/CasVissers \ No newline at end of file From 43edf08b265324bee11b95ff073f1596f11b4d9e Mon Sep 17 00:00:00 2001 From: Cas Vissers Date: Thu, 25 Oct 2018 13:36:10 +0000 Subject: [PATCH 2/2] [FIX] purchase: include refunds in invoice count If a supplier had a refund, it was not included in the supplier invoice count nor in the results in the statbutton On the customer side, fields like total_invoiced works on both the out_invoice and out_refund --- addons/purchase/models/res_partner.py | 2 +- addons/purchase/views/res_partner_views.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/purchase/models/res_partner.py b/addons/purchase/models/res_partner.py index dd120858885..75b849af619 100644 --- a/addons/purchase/models/res_partner.py +++ b/addons/purchase/models/res_partner.py @@ -19,7 +19,7 @@ class res_partner(models.Model): def _compute_supplier_invoice_count(self): Invoice = self.env['account.invoice'] for partner in self: - partner.supplier_invoice_count = Invoice.search_count([('partner_id', 'child_of', partner.id), ('type', '=', 'in_invoice')]) + partner.supplier_invoice_count = Invoice.search_count([('partner_id', 'child_of', partner.id), ('type', 'in', ('in_invoice', 'in_refund'))]) @api.model def _commercial_fields(self): diff --git a/addons/purchase/views/res_partner_views.xml b/addons/purchase/views/res_partner_views.xml index d125006be9a..39d2f994767 100644 --- a/addons/purchase/views/res_partner_views.xml +++ b/addons/purchase/views/res_partner_views.xml @@ -52,7 +52,7 @@ account.invoice form tree,form,graph - [('type','=','in_invoice')] + [('type','in',('in_invoice', 'in_refund'))] {'search_default_partner_id': active_id, 'default_type': 'in_invoice', 'type': 'in_invoice', 'journal_type': 'purchase'}