I want to extend my order.lines form view in my sales module.
Currently I have, my order.lines form and to the right is an empty space where the record history was going. I want to take advantage of that space and extend my order.lines form.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I want to extend my order.lines form view in my sales module.
Currently I have, my order.lines form and to the right is an empty space where the record history was going. I want to take advantage of that space and extend my order.lines form.
Odoo’s form views use groups and notebook tabs to structure content. To extend the view:
📌 Steps:
📌 Example XML Code (Extend the Order Line Form View):
xml
CopyEdit
<?xml version="1.0" encoding="utf-8"?> <odoo> <record id="view_order_line_form_extended" model="ir.ui.view"> <field name="name">sale.order.line.form.extended</field> <field name="model">sale.order.line</field> <field name="inherit_id" ref="sale.view_order_line_form"/> <field name="arch" type="xml"> <!-- Extend the main form layout --> <xpath expr="//sheet/group" position="attributes"> <attribute name="colspan">2</attribute> </xpath> <!-- Add extra fields or sections to the right --> <xpath expr="//sheet/group" position="after"> <group colspan="2"> <group> <field name="custom_field_1"/> <field name="custom_field_2"/> </group> <group> <field name="custom_notes" widget="text"/> </group> </group> </xpath> </field> </record> </odoo>
To fully utilize the extended area, define custom fields in your Python model (sale.order.line):
📌 Example Python Code (Adding New Fields):
python
CopyEdit
from odoo import models, fields class SaleOrderLine(models.Model): _inherit = 'sale.order.line' custom_field_1 = fields.Char(string="Custom Info") custom_field_2 = fields.Float(string="Extra Price") custom_notes = fields.Text(string="Additional Notes")
After adding the XML and Python changes:
bash
CopyEdit
odoo-bin -u your_module_name --stop-after-init
If you want to edit the view of the Odoo eCommerce (Web Sale) module, follow these steps:
If you need deeper customization, create a custom module to override the view.
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
2
Jul 25
|
1826 | ||
|
1
May 25
|
1258 | ||
|
1
May 25
|
1374 | ||
|
2
May 25
|
1881 | ||
|
2
Feb 25
|
10224 |