Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2765 Widoki

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!

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
sie 20
3326
1
lis 19
4892
2
gru 23
14641
0
paź 23
33
3
paź 23
788