Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
1692 Zobrazení

under tab Components  in Bills of Materials 


class StockMoveLine(models.Model):  

  _inherit = "stock.move.line"
    bom_line_id = fields.Many2one('mrp.bom.line', 'BoM Line')
    To Consume  = fields.Float(related='move_id.bom_line_id.product_qty', store=True)

 

the appear  Quantity fields not  Quantity under tab Components

Avatar
Zrušit
Nejlepší odpověď

Hi,

Try this:class StockMoveLine(models.Model):

    _inherit = "stock.move.line"


    bom_line_id = fields.Many2one('mrp.bom.line', 'BoM Line')

    to_consume = fields.Float(related='bom_line_id.product_qty', string='To Consume')


Hope it helps

Avatar
Zrušit