DiningRoomLimit class (models.Model):
_name = 'dining.room.limit'
_order = 'sequence'
name = fields.Char (readonly = True, create = "false", store = True)
limit = fields.Float (string = 'Credit Limit', mandatory = True, digits = (64, 2))
@ api.onchange ('limit')
def _onchange_limit (self):
h = j = 0.0
to r itself:
h = r.limit
j = r.limit - h
result = self.env ['hr.employee']. search ([])
result.write ({
'limit_id': j,
})
DiningRoomIndexCord class (models.Model):
_rec_name = 'record'
_inherit = ['hr.employee']
limit_id = fieldss.Float (string = 'Credit Limit', mandatory = True, digits = (64, 2))
I am trying to perform a subtraction between the limit and the limit_id that is in the class hr.employee and this result is the one that is saved in limit_id
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
1865
มุมมอง
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อ
pls structure your code, and pls be specific what you want to do
I use this form to update the limit_id value that is found in hr.employee automatically but I want to make a subtraction before between the amount that is in limit_id and the amount that is in the limit class called limit and that result is the one that is place when you pass the value to travz
of this code
@api.onchange('limit')
def _onchange_limit(self):
h = j = 0.0
for r in self:
h = r.limit
j = r.limit - h
result = self.env['hr.employee'].search([])
result.write({
'limit_id': j,
})