[MERGE][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 closes odoo/odoo#28161
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<field name="res_model">account.invoice</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,graph</field>
|
||||
<field name="domain">[('type','=','in_invoice')]</field>
|
||||
<field name="domain">[('type','in',('in_invoice', 'in_refund'))]</field>
|
||||
<field name="context">{'search_default_partner_id': active_id, 'default_type': 'in_invoice', 'type': 'in_invoice', 'journal_type': 'purchase'}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user