19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:30:07 +01:00
parent ba20ce7443
commit 768b70e05e
2357 changed files with 1057103 additions and 712486 deletions

View file

@ -14,6 +14,7 @@ class AccountCashRounding(models.Model):
"""
_name = 'account.cash.rounding'
_description = 'Account Cash Rounding'
_check_company_auto = True
name = fields.Char(string='Name', translate=True, required=True)
rounding = fields.Float(string='Rounding Precision', required=True, default=0.01,
@ -21,12 +22,25 @@ class AccountCashRounding(models.Model):
strategy = fields.Selection([('biggest_tax', 'Modify tax amount'), ('add_invoice_line', 'Add a rounding line')],
string='Rounding Strategy', default='add_invoice_line', required=True,
help='Specify which way will be used to round the invoice amount to the rounding precision')
profit_account_id = fields.Many2one('account.account', string='Profit Account', company_dependent=True, domain="[('deprecated', '=', False), ('company_id', '=', current_company_id)]")
loss_account_id = fields.Many2one('account.account', string='Loss Account', company_dependent=True, domain="[('deprecated', '=', False), ('company_id', '=', current_company_id)]")
profit_account_id = fields.Many2one(
'account.account',
string='Profit Account',
company_dependent=True,
check_company=True,
domain="[('account_type', 'not in', ('asset_receivable', 'liability_payable'))]",
ondelete='restrict',
)
loss_account_id = fields.Many2one(
'account.account',
string='Loss Account',
company_dependent=True,
check_company=True,
domain="[('account_type', 'not in', ('asset_receivable', 'liability_payable'))]",
ondelete='restrict',
)
rounding_method = fields.Selection(string='Rounding Method', required=True,
selection=[('UP', 'Up'), ('DOWN', 'Down'), ('HALF-UP', 'Nearest')],
default='HALF-UP', help='The tie-breaking rule used for float rounding operations')
company_id = fields.Many2one('res.company', related='profit_account_id.company_id')
@api.constrains('rounding')
def validate_rounding(self):