Hi Odoo community,
I'm currently customizing the account.payment.register model in Odoo 17. Specifically, I want to override an existing computed field (amount) defined with @api.depends to remove one specific field (date_payments) from its dependency list.
Base model : module account of odoo
amount = fields.Monetary(currency_field='currency_id', store=True, readonly=False, compute='_compute_amount') @api.depends('can_edit_wizard', 'source_amount', 'source_amount_currency', 'source_currency_id', 'company_id', 'currency_id', 'payment_date') def _compute_amount(self): for wizard in self: if not wizard.journal_id or not wizard.currency_id or not wizard.payment_date: wizard.amount = wizard.amount elif wizard.source_currency_id and wizard.can_edit_wizard: batch_result = wizard._get_batches()[0] wizard.amount = wizard._get_total_amount_in_wizard_currency_to_full_reconcile(batch_result)[0] else: # The wizard is not editable so no partial payment allowed and then, 'amount' is not used. wizard.amount = None
i want to inherit this from custom module
class AccountPaymentRegisterInherit(models.TransientModel): _inherit = "account.payment.register" @api.depends('can_edit_wizard', 'source_amount', 'source_amount_currency', 'source_currency_id', 'company_id', 'currency_id') def _compute_amount(self): """Custom compute method for 'amount' that excludes 'payment_date' dependance to prevent unwanted recomputation after modifying the payment date. """ return super()._compute_amount()
The problem is that it's not working; it's still using the parent module's API dependency fields
please help me understand this weird behaviour