I want to inherited the "serial_no" from "maintenance.equipment" to "maintenance.request" if it's possible how ?
Note: the request and equipment model once inherited to my custom module
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I want to inherited the "serial_no" from "maintenance.equipment" to "maintenance.request" if it's possible how ?
Note: the request and equipment model once inherited to my custom module
Hi,
You can use Delegation Inheritance for this case. In delegation inheritance, you create a new object that delegates some of its functionality to an existing object.
Here's an example :
class MaintenanceRequest(models.Model):
_name = 'maintenance.request'
_inherit = 'maintenance.equipment'
For more information please refer to this blog: Different Types of Inheritance in Odoo
Hope it helps
Hi Nasrat
Try to add a serial_no field in maintenance request and use related to fetch its value based on maintenance.equipment
Class MaintenanceRequest(models.Model):
_inherit = 'maintenance.request'
serial_no = fields.Char(string='Serial No',related='equipment_id.serial_no')
Regards
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
RegistratiPost correlati | Risposte | Visualizzazioni | Attività | |
---|---|---|---|---|
|
2
feb 25
|
1261 | ||
|
2
dic 23
|
1521 | ||
|
1
dic 23
|
1405 | ||
|
1
giu 23
|
1812 | ||
|
1
giu 23
|
4640 |