Skip to Content
Menu
This question has been flagged
1 Reply
2074 Views

Hi,

I have created one One2many field shipping.order.line in sale same as sale.order.line. and I have one shipping fee field and want to add that value into shipping.order.line. shipping line is created in database but not display in view.

could anyone help me achieve this.

Thanks in advance!

Avatar
Discard
Best Answer

Hi,

Did you correctly given the relation between the models, like, in the sale.order.line model we have field order_id which is of type many2one of co-model sale.order , if there is no value in the field order_id this order.line wont show inside any sale order form. So in your  case check whether that relation is correctly done.

In your new model, there will be a many2one field with co-model as sale.order, check whether there is value in it.


And if you need to pass default value from model sale.order to field in your new model(ie, one2many field) you can do it by passing default value in the context.

See:-

<field name="one2many_field_name" context="{'default_cost': cost}">
<tree string="string" editable="bottom">
<field name="cost"/>
</tree>
</field>

Thanks

Avatar
Discard
Related Posts Replies Views Activity
0
Aug 20
2456
1
Nov 19
4017
2
Dec 23
12010
0
Oct 23
33
3
Oct 23
787