[MOV] sale_stock->sale: product_type field

This related field is useful in sale to simplify the logic of the 
product configurators (incoming adaptation to OWL).
Thanks to that, we'll be able to avoid an useless rpc to get the 
detailed type of the SOL product.

closes odoo/odoo#100310

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
Victor Feyens
2022-09-15 20:17:57 +02:00
parent 48801a0d40
commit cb7ecfaed9
2 changed files with 1 additions and 1 deletions
+1
View File
@@ -252,6 +252,7 @@ class SaleOrderLine(models.Model):
store=True)
# Technical computed fields for UX purposes (hide/make fields readonly, ...)
product_type = fields.Selection(related='product_id.detailed_type', depends=['product_id'])
product_updatable = fields.Boolean(
string="Can Edit Product",
compute='_compute_product_updatable')
@@ -15,7 +15,6 @@ class SaleOrderLine(models.Model):
qty_delivered_method = fields.Selection(selection_add=[('stock_move', 'Stock Moves')])
route_id = fields.Many2one('stock.route', string='Route', domain=[('sale_selectable', '=', True)], ondelete='restrict', check_company=True)
move_ids = fields.One2many('stock.move', 'sale_line_id', string='Stock Moves')
product_type = fields.Selection(related='product_id.detailed_type', depends=['product_id'])
virtual_available_at_date = fields.Float(compute='_compute_qty_at_date', digits='Product Unit of Measure')
scheduled_date = fields.Datetime(compute='_compute_qty_at_date')
forecast_expected_date = fields.Datetime(compute='_compute_qty_at_date')