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
2762 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
srp 20
3320
1
lis 19
4892
2
pro 23
14637
0
říj 23
33
3
říj 23
788