i want to create field where countinues count
i have field
odometer_pasang = fields.Integer(string='Odometer Pemasangan Sebelumnya')
odometer_tire = fields.Integer(string='Odometer Tire', compute='_compute_odometer_tire')
odometer_pengecekan = fields.Integer(string='Odometer Pengecekan')
odometer_cek = fields.Integer(string='KM Pemasangan - KM Pengecekan', compute='_compute_odometer_cek')
@api.depends('odometer_pengecekan','odometer_pasang')
def _compute_odometer_cek(self):
for r in self:
if r.odometer_pengecekan and r.odometer_pasang:
r.odometer_cek = r.odometer_pengecekan - r.odometer_pasang
@api.depends('odometer_pengecekan','odometer_pasang')
def _compute_odometer_tire(self):
for r in self:
tampung = r.odometer_pengecekan - r.odometer_pasang
r.odometer_tire += tampung
i want to make field odometer_tire always count from odometer_cek but for now odometer_tire not counting sum
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
2
Replies
3373
Views
you need to add onchange method to achieve your goal...
Why ignore the onchange method?
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
2
Dec 23
|
686 | ||
|
3
Feb 21
|
16406 | ||
|
1
Aug 18
|
6745 | ||
|
2
Aug 18
|
2770 | ||
|
0
Apr 18
|
2676 |