Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3646 มุมมอง
class Employee(models.Model):
_name = "hr.employee"
_description = "Employee"
_order = 'name_related'
_inherits = {'resource.resource': "resource_id"}
_inherit = ['mail.thread', 'hr.contract']
rel_field = fields.Many2one('hr.contract')
hr_wage = fields.Char(string='wage', related='rel_field.wage')


class Contract(models.Model):
_name = 'hr.contract'
_description = 'Contract'
_inherit = ['mail.thread', 'ir.needaction_mixin']
wage = fields.Float('Wage', digits=(16, 2), required=True, help="Basic Salary of the employee")

   in hr.xml file i have this field<field name ='hr_wage' />

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Many2one related field แก้ไขแล้ว
3
ก.ย. 21
9386
Representation of Many2one in view แก้ไขแล้ว
4
ม.ค. 20
3193
0
พ.ย. 18
4429
1
ม.ค. 25
1874
3
ต.ค. 22
5895