I develop module with name "sites" in odoo 10v i have few fields in this module,
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
To add a new field to sale order form
py file:
class SomeClassName(models.Model):
_inherit = 'sale.order'
_rec_name=' your_ref_field' #if you want to see this field's name in sale order
your_ref_field = fields.Many2one('sites.sites', string='Some Name')
xml file
<record model="ir.ui.view" id="sale_form_view_extends">
<field name="name">my.name</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="your_ref_field"/>
</xpath>
</field>
</record>
Thank you so much its working now but tell me one more thing
I want to expose more than 1 field in sales order how i can achieve it by,
_rec_name=' your_ref_field'
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up