跳至內容
選單
此問題已被標幟

Hi!

I'm using Odoo 12, last docker build, clean install.

I installed the sales addon, went into settings, checked the delivery costs options (which installed the delivery addon).

Then, I tried to install my custom addon that has a view that inherits the `delivery.view_order_form_with_carrier`, located in `odoo/addons/delivery/views/delivery_view.xml` at line 280.

For now, my view does nothing (just inherits, locate the `carrier_id` field, and write `hello world` after it).

During the installation of my addon, the following error appears :

Le champ `product_qty` n'existe pas

Contexte de l'erreur : 
Vue `custom.delivery.sale.order.form.view.with_carrier` [view_id: 1014, xml_id: n/a, model: sale.order, parent_id: 1003] None" while parsing /mnt/extra-addons/custom/views/delivery/delivery_view.xml:3, near <record id="custom.delivery__view_order_form_with_carrier" model="ir.ui.view">
        <field name="name">custom.delivery.sale.order.form.view.with_carrier</field>
        <field name="model">sale.order</field> <field name="inherit_id" ref="delivery.view_order_form_with_carrier"/> <field name="arch" type="xml"> <xpath expr="//field[@name='carrier_id']" position="after"> <span>Hello, World!</span> </xpath> </field> </record>

Which means that the field `product_qty` does not exist.

This field is used in the view I'm trying to inherit, I'm not using it in my custom view as you can see.
This field is defined in the `SaleOrderLine` model in the `delivery` module.
The view i'm trying to inherit is related to the `SaleOrder` model.

I don't know why it works if no inheritance (to me, it should not as the field is not defined on SaleOrder model), and why not if I use inheritance on this view.

Is there something I don't know about views and inheritance? Or maybe a bug?
Do you know how can I inherit this view to make some customizations?

Thank you a lot in advance.

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
11月 24
1617
5
7月 24
92867
1
12月 23
3034
1
5月 22
3619
0
1月 20
2868