Skip to content

Commit

Permalink
IMP: remove depends
Browse files Browse the repository at this point in the history
  • Loading branch information
dnplkndll committed Feb 15, 2025
1 parent 6a7abf3 commit 6402215
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions account_avatax_exemption_sign_oca/models/exemption.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Copyright 2023 ForgeFlow S.L. (http://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import api, fields, models
from odoo import fields, models


class ResPartnerExemption(models.Model):
_inherit = "res.partner.exemption"

sign_oca_request_id = fields.Many2one("sign.oca.request")

@api.depends("state")
def _cancel_sign_request_id(self):
for rec in self:
if rec.state == "cancel":
rec.sign_oca_request_id.cancel()
def write(self, vals):
if vals.get("state") == "cancel":
for record in self:
record.sign_oca_request_id.cancel()
return super().write(vals)

0 comments on commit 6402215

Please sign in to comment.