I need add field and operation in purchase lines puth inerith dont work for purschase.order.line
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
2
Replies
3352
Views
Hi,
For adding a new field in purchase order line, try the below code
in python
class PurchaseOrderLine(models.Model):
_inherit = 'purchase.order.line'
your_custom_field = fields.Char(string="Custom Field")
in XML
<record id="purchase_order_form_inherit" model="ir.ui.view">
<field name="name">purchase.order.form.inherit</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='order_line']/tree/field[@name='field_name']" position="after">
<field name="your_custom_field"/>
</xpath>
</field>
</record>
Regards
thanks for your answer
it is very useful
thanks for your answer
it is very useful
What you have done so far?
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
0
Dec 24
|
26 | ||
|
1
Dec 24
|
38 | ||
|
0
Nov 24
|
29 | ||
|
1
Nov 24
|
216 | ||
|
0
Nov 24
|
63 |