[IMP] account_analytic_default: select default product when creating analytic rule from product

This commit is contained in:
Kinjal Mehta
2016-09-06 16:06:57 +02:00
committed by This Is Banana
parent 7fa2691175
commit 8698307374
@@ -29,5 +29,5 @@ class ProductTemplate(models.Model):
result = self.env.ref('account_analytic_default.action_product_default_list').read()[0]
result['domain'] = [('product_id', 'in', self.mapped('product_variant_ids').ids)]
# Remove context so it is not going to filter on product_id with active_id of template
result['context'] = "{}"
result['context'] = {'default_product_id': self.mapped('product_variant_ids').id}
return result