Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2870 Lượt xem

Hi, how can I modify quotation form view on sales app? Thanks for this cool platform.

Ảnh đại diện
Huỷ bỏ
Tác giả

as it threw me an error editing the list view / form view

UncaughtPromiseError > OwlError
Uncaught Promise > The following error occurred in onWillStart: "View is not a constructor"
OwlError: The following error occurred in onWillStart: "View is not a constructor"
at wrapError (https://toa-global3.odoo.com/web/assets/190-23b30da/web.assets_common.min.js:1543:77)
at onWillStart (https://toa-global3.odoo.com/web/assets/190-23b30da/web.assets_common.min.js:1549:117)
at EditorAdapter.setup (https://toa-global3.odoo.com/web/assets/191-1ea2b0d/web.assets_backend.min.js:8946:401)
at EditorAdapter.setup (https://toa-global3.odoo.com/web/assets/199-0627d94/web_studio.studio_assets.min.js:48:15)
at new ComponentNode (https://toa-global3.odoo.com/web/assets/190-23b30da/web.assets_common.min.js:1506:136)
at https://toa-global3.odoo.com/web/assets/190-23b30da/web.assets_common.min.js:2026:6
at ControllerComponent.template (eval at compile (https://toa-global3.odoo.com/web/assets/190-23b30da/web.assets_common.min.js:1990:370), <anonymous>:11:27)
at Fiber._render (https://toa-global3.odoo.com/web/assets/190-23b30da/web.assets_common.min.js:1433:96)
at Fiber.render (https://toa-global3.odoo.com/web/assets/190-23b30da/web.assets_common.min.js:1432:6)
at ComponentNode.initiateRender (https://toa-global3.odoo.com/web/assets/190-23b30da/web.assets_common.min.js:1511:47)

Caused by: TypeError: View is not a constructor
at Class._getX2mFieldsView (https://toa-global3.odoo.com/web/assets/199-0627d94/web_studio.studio_assets.min.js:801:425)
at Class.start (https://toa-global3.odoo.com/web/assets/199-0627d94/web_studio.studio_assets.min.js:774:259)
at prototype.<computed> [as start] (https://toa-global3.odoo.com/web/assets/190-23b30da/web.assets_common.min.js:5681:488)
at https://toa-global3.odoo.com/web/assets/190-23b30da/web.assets_common.min.js:6018:52

Câu trả lời hay nhất

Hi,

In order to modify the quotation form view or any other views in Odoo, you can just inherit that view and can add the desired changes to the view.
For example, for modifying the sales view, you can add this xml code in your xml file and add it in module manifest.

<record id="view_order_form_inherit_example" model="ir.ui.view">


               <field name="name">sale.order.form.inherit.example</field>


              <field name="model">sale.order</field>


              <field name="inherit_id" ref="sale.view_order_form"/>


              <field name="arch" type="xml">


                     <xpath expr="//field[@name='partner_id']" position="after">


                            <field name="custom_field_name"/>


                      </xpath>


                </field>


          </record>


Regards

Ảnh đại diện
Huỷ bỏ
Tác giả

Hi @Cybrosys Techno Solutions Pvt.Ltd so meaning to say, I couldn't just edit straightaway? Thanks for your response, really appreciated it :)

Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 8 15
6472
1
thg 4 25
1008
1
thg 3 24
2428
1
thg 1 24
1616
0
thg 12 23
1161