[FIX] sale: sales_to_invoice_count in Sales Channel
The count sales_to_invoice_count was wrong due to the domain wrote in function _compute_sales_to_invoice. Using 'order_line.qty_to_invoice' in the domain included duplicate orders in the read_group on 'sale.order' because there is auto_join=True on the field order_line. opw:2009808 closes odoo/odoo#34391 Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This commit is contained in:
@@ -51,7 +51,7 @@ class CrmTeam(models.Model):
|
||||
def _compute_sales_to_invoice(self):
|
||||
sale_order_data = self.env['sale.order'].read_group([
|
||||
('team_id', 'in', self.ids),
|
||||
('order_line.qty_to_invoice', '>', 0),
|
||||
('invoice_status','=','to invoice'),
|
||||
], ['team_id'], ['team_id'])
|
||||
for datum in sale_order_data:
|
||||
self.browse(datum['team_id'][0]).sales_to_invoice_count = datum['team_id_count']
|
||||
|
||||
@@ -852,7 +852,7 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,calendar,graph,kanban,pivot</field>
|
||||
<field name="search_view_id" ref="sale.sale_order_view_search_inherit_sale"/>
|
||||
<field name="domain">[('state', '=', 'sale'),('invoice_status','=','to invoice')]</field>
|
||||
<field name="domain">[('invoice_status','=','to invoice')]</field>
|
||||
<field name="context">{
|
||||
'search_default_team_id': [active_id],
|
||||
'default_team_id': active_id,
|
||||
|
||||
Reference in New Issue
Block a user