sale_order_add_bom: fix related field definition

This commit is contained in:
Alexis de Lattre
2019-12-02 11:21:59 +01:00
committed by Alexis de Lattre
parent 5a58ae0d9a
commit 9a9459f013
2 changed files with 5 additions and 4 deletions

View File

@@ -1,12 +1,13 @@
# -*- coding: utf-8 -*-
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# Copyright 2016-2019 Akretion France
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, fields
from odoo import models, fields
class MrpBom(models.Model):
_inherit = 'mrp.bom'
_rec_name = 'product_id'
sale_ok = fields.Boolean(related='product_id.sale_ok', store=True, compute_sudo=True)
sale_ok = fields.Boolean(related='product_tmpl_id.sale_ok', store=True)

View File

@@ -13,7 +13,7 @@
<field name="arch" type="xml">
<form string="Add Phantom BOM to the Quotation">
<group name="main">
<field name="bom_id"/>
<field name="bom_id" default_focus="1"/>
<field name="qty"/>
</group>
<footer>