In sale module how can I create a new form containing product name,attribute and attribute value while clicking the add a product in the sale order line?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- Müşteri İlişkileri Yönetimi
- e-Commerce
- Muhasebe
- Envanter
- PoS
- Proje Yönetimi
- MRP
Bu soru işaretlendi
1
Cevapla
1945
Görünümler
Hi,
For opening the form view when clicking on the add a product you have to remove the editable="bottom" from the sale order line tree view first. Once you do this, a form view will get opened.
To add new fields to that form view:
in the python:
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
test = fields.Char(string='Test')
In the XML,
<record id="sale_order_view_inherit" model="ir.ui.view">
<field name="name">sale.order.view</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='order_line']/form/group/group/field[@name='price_unit']" position="after">
<field name="test"/>
</xpath>
</field>
</record>
You will see many other fields in the form, you can hide unnecessary fields depending on your use case.
Thanks
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Üye Ol