Skip to Content
Menu
This question has been flagged

I created the float field on client side, x_price_area and tried many ways to load the default price from pricelist into sale.order.line. The fields on both pricelist.item and sale.order.line are set as same. It just doesnt copy the price when I create a new line on SO. I have only created few pricelist items on one pricelist (Prblic Pricelist) in the databse. Here is what I have tried:

Tried to Insert on View by context: (not working)

<field name="x_price_area" class="oe_inline" widget="monetary" context="{'partner_id':parent.partner_id,
'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom,
'company_id': parent.company_id}"/>

Tried to insert on View by context of "product_id": (not working)

<field name="product_id" context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, .... , 
'x_price_area', parent.pricelist_ids.item_ids_x_price_area}"/>
OR
'x_price_area', product_id.pricelist_item_ids.x_price_area}"/>

Tried to compute the field: (works but non-savable with stored=true)

for record in self:
    record['x_price_area'] = record.product_id.pricelist_item_ids.x_price_width

 Tried to make related field: (works, but also change the pricelist item SOMETIMES)

related='product_id.pricelist_item_ids.x_price_width'

Of course I have tried nothing to fill. Any ideas how I could copy the price from pricelist item on SO? It shall be copied and editable field. I know the Price Calculation doesnt change by the custom new_field. 

Avatar
Discard
Related Posts Replies Views Activity
3
Dec 22
5952
0
Sep 24
122
3
Aug 24
527
0
Feb 24
263
0
Feb 24
157