تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2204 أدوات العرض

How to change quantity field decimal number based on field decimal_digit record

class AccountAnalyticInvoiceLine(models.Model):
    _inherit = 'account.analytic.invoice.line'
    quantity = fields.Float(digits=(16, 2)
class AccountInvoice(models.Model):
    _inherit = 'account.invoice'
    
    decimal_digit = fields.Integer(string='Decimal Digit', default=2)

I tried

@api.onchange('decimal_digits')
    def _onchange_decimal_digits(self):
        for record in self:
            record.quantity = round(record.quantity, record.decimal_digits)

but it seems not working


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
فبراير 18
7580
0
فبراير 18
5693
2
سبتمبر 22
8850
1
مايو 20
3808
2
أكتوبر 18
6161