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
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
Create an account today to enjoy exclusive features and engage with our awesome community!
Registrar-se| Related Posts | Respostes | Vistes | Activitat | |
|---|---|---|---|---|
|
Tracking Maintenance Request
Solved
|
2
de set. 25
|
3916 | ||
|
2
de des. 23
|
3760 | |||
|
1
de des. 23
|
3426 | |||
|
1
de juny 23
|
3733 | |||
|
1
de juny 23
|
6669 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.