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

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

Avatar
Discard
Author

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

Best Answer

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

Avatar
Discard
Author

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

Related Posts Replies Views Activity
4
Aug 15
5390
1
Mar 24
1170
1
Jan 24
521
0
Dec 23
335
4
Apr 24
57473