I have a non-iterable type error. the idea is to read one line of the dps_montant, you can one or more.
I read that you can not go int or float, but I can not find how to do it.
Thank you,class UMAJournalEvennement(models.Model):
_name = 'uma.debour.prestation'
_description = 'Debour & Prestation et Service Uma'
_rec_name = 'dps_prestation'
template_id = fields.Many2one('uma.template', string="Template UMA")
dps_debour = fields.Char(string="Debour")
dps_montant = fields.Monetary(currency_field='currency_id', string="Montant")
dps_prestation = fields.Char(string="Prestation et Service")
dps_tva = fields.Char(string="TVA")
dps_montant_ht = fields.Monetary(currency_field='currency_id', string="Montant HT")
dps_montant_tva = fields.Monetary(currency_field='currency_id', string="Montant TVA")
dps_montant_ttc = fields.Monetary(currency_field='currency_id', string="Montant TTC")
test_total = fields.Monetary(currency_field='currency_id', string="Montant test", compute="compute_total")
currency_id = fields.Many2one('res.currency')
def compute_total(self):
for rec in self:
rec.test_total = sum(rec.dps_montant)
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Akuntansi
- Inventaris
- PoS
- Project
- MRP
Pertanyaan ini telah diberikan tanda
1
Balas
3636
Tampilan
I think you must use de mapped method to get all the values of that field on every record:
sum(self.mapped('dps_montant'))
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
|
1
Okt 18
|
3604 | ||
|
3
Jun 16
|
11104 | ||
|
0
Okt 15
|
3138 | ||
|
1
Jan 25
|
1172 | ||
Remove link from offer and invoice email
Diselesaikan
|
|
2
Nov 24
|
1840 |