Skip to Content
Menu
This question has been flagged

I'm just finishing adding some field in stock.pack.operation , but now i need to call value from order.sales.line(field description which is "name")to stock.pack.operation  (description_picking) . Last time i call the product_id for testing my code , its works . Now im change my code to call value from (field description) it return blank or no data . Thanks.

<field name="arch" type="xml">
<xpath expr="//page/field[@name='pack_operation_product_ids']/tree/field[@name='product_id']" position="after">
<field name="description_picking"/>
</xpath>
class descmoduledo(models.Model):
_inherit ='stock.picking'
#product_id = fields.Many2one("product.product", "Product") TESTING

order_line = fields.Many2one('sale.order.line', string='Description')
#   description_picking = fields.Text(string='Picking Description',store=True,related='order_line.product_id'
    description_picking = fields.Text(string='Picking Description',store=True,related='order_line.name')


class StockPackOperation(models.Model):
_inherit ='stock.pack.operation'
order_line = fields.Many2one('sale.order.line', string='Description')
description_picking = fields.Text(string='Picking Description',store=True,related='order_line.name')
Avatar
Discard
Related Posts Replies Views Activity
0
Aug 22
897
1
Jul 22
17732
0
Apr 22
1613
3
Sep 21
1916
2
Sep 21
3208