when I add a new field for the installed custom module, it does not appear in the data structure model and I have an error field that does not exit in the XML file.
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
Hi,
Try Refer the following blog to get the proper way to add new field to existing views.
https://www.cybrosys.com/blog/adding-custom-fields-to-existing-views-in-odoo-v12
Regards
Hi,
I followed the same steps in this article, but I still have the same problem.
Hi,
See this example of adding new field to sale order model.
Video: https://www.youtube.com/watch?v=z1Tx7EGkPy0
In python side, inherit the model and add the field:
# -*- coding: utf-8 -*- | |
from odoo import api, fields, models | |
class SaleOrder(models.Model): | |
_inherit = "sale.order" | |
sale_description = fields.Char(string='Sale Description') |
Then in the xml: https://github.com/odoomates/odooapps/blob/14.0/om_hospital/views/sale.xml#:~:text=%3Crecord id%3D%22view_order_form_inherit,%3C/record%3E
| |
Also make sure that you have restarted the odoo service before installing the module.
Thanks
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
Can you please explain a bit more, how did you add the new field? was it through the interface or code? how did you place it on the xml file?
I added the new field throght the code and then added it in XML file as same as the old fields