Hi Odoo Community,
I’m running Odoo on-premise (Docker, no Studio) and I’m trying to make a few product fields compulsory when creating a product, in the same way that the Name field works (red highlight + “invalid fields” message if empty).
Specifically, I want these fields to be required:
- Internal Reference (default_code)
- Company (company_id)
- Cost (standard_price)
What I’ve tried so far:
- Created a custom module that inherits product.template and sets these fields with required=True.
- Restarted Odoo and upgraded the module with -u.
But nothing changes:
- The fields can still be left blank.
- No red highlight appears.
- Only Name behaves as expected, since it is required in the core model.
Questions:
- Is it possible to make existing fields behave exactly like name (red highlight + cannot save without value)?
Environment:
- Odoo 18, running in Docker (on-premise)
- PostgreSQL in separate container
Any guidance (or working examples) would be appreciated.
Thanks in advance!
"Created a custom module that inherits product.template and sets these fields with required=True." - you should share your code.