[IMP] sale_product_matrix: add related field to reduce rpc calls
The matrix configurators makes a rpc call to know if the edited line is configurable through matrix or standard configurator. This rpc can be avoided (and the logic simplified while converting the widget to owl) with a related field on the lines. closes odoo/odoo#100613 Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from . import sale_order
|
||||
|
||||
from . import product_template
|
||||
from . import sale_order
|
||||
from . import sale_order_line
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class SaleOrderLine(models.Model):
|
||||
_inherit = 'sale.order.line'
|
||||
|
||||
product_add_mode = fields.Selection(related='product_template_id.product_add_mode', depends=['product_template_id'])
|
||||
Reference in New Issue
Block a user