Skip to content

Commit

Permalink
Merge PR #76 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by legalsylvain
  • Loading branch information
github-grap-bot committed Jan 24, 2025
2 parents 7bb630e + 0410a69 commit ae6a64e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions fiscal_company_point_of_sale/models/pos_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ class PosConfig(models.Model):

_fiscal_company_forbid_fiscal_type = ["group", "fiscal_mother"]

@api.depends("company_id")
def _compute_company_has_template(self):
for config in self.filtered(lambda x: x.company_id.fiscal_type == "child"):
config.company_has_template = (
self.env["account.chart.template"].existing_accounting(
config.company_id.fiscal_company_id
)
or config.company_id.fiscal_company_id.chart_template_id
)
return super(
PosConfig, self.filtered(lambda x: x.company_id.fiscal_type != "child")
)._compute_company_has_template()

# Overwrite company constrains
@api.constrains("company_id", "invoice_journal_id")
def _check_company_invoice_journal(self):
Expand Down

0 comments on commit ae6a64e

Please sign in to comment.