Skip to content

Commit

Permalink
[IMP] make required field for partner account properties
Browse files Browse the repository at this point in the history
  • Loading branch information
legalsylvain committed Jan 21, 2025
1 parent 9e8d6de commit 800de15
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion fiscal_company_account/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,23 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).


from odoo import models
from odoo import fields, models


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

is_coa_installed = fields.Boolean(compute="_compute_is_coa_installed")

def _fiscal_property_creation_list(self):
res = super()._fiscal_property_creation_list()
res += [
"property_account_payable_id",
"property_account_receivable_id",
]
return res

def _compute_is_coa_installed(self):
result = bool(self.env.company.fiscal_company_id.chart_template_id)
for partner in self:
partner.is_coa_installed = result

0 comments on commit 800de15

Please sign in to comment.