Hello I am using odoo13 and i have to make field date_done (labelled as Effective date which is only visible when delivery order is in done state) visible using my code , can somebody please help me out with this ?
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
Sometimes replacing a field is dangerous if that field is used in other modules in xpath.
The better option is to use "attributes" to change the attribute of the tag.
Ex:
field name="date_done" position="attributes">
attribute name="string">Effective Date attribute>
field>
XML:
<field name="date_done" position="attributes">
<attribute name="string">Effective Date</attribute>
</field>
Hello Shaktisinh
I have defined the same field in the inherited model and gave <xpath> with position as replace and it worked for me .
class Picking(models.Model):
_inherit = "stock.picking"
date_done = fields.Datetime('Date of Transfer', copy=False, readonly=False, help="Date at which the transfer has been processed or cancelled.")
<xpath expr="//field[@name='date_done']" position="replace">
<field name="date_done" string="Effective Date"/>
</xpath>
This is my code , It works properly and please do correct me if i am wrong or you have any other way.
Thank you for response
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
Hello akshat Dave
you have inherited form view and use <xpath> to bypass the invisible condition of base. for visible those fields.