Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] fiscal_company_*: more security regarding the impossibility to … #66

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fiscal_company_account/models/account_bank_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ class AccountBankStatement(models.Model):
_name = "account.bank.statement"
_inherit = ["account.bank.statement", "fiscal.company.check.company.mixin"]

_fiscal_company_forbid_fiscal_type = ["fiscal_mother"]
_fiscal_company_forbid_fiscal_type = ["group", "fiscal_mother"]

company_id = fields.Many2one(related=False)
3 changes: 3 additions & 0 deletions fiscal_company_account/models/account_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ class AccountJournal(models.Model):
_inherit = [
"account.journal",
"fiscal.company.change.search.domain.mixin",
"fiscal.company.check.company.mixin",
]

_fiscal_company_forbid_fiscal_type = ["group"]

def _get_journal_dashboard_data_batched(self):
# Modify Context to add domain based on allowed companies
# when making request on account.move
Expand Down
2 changes: 1 addition & 1 deletion fiscal_company_account/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AccountMove(models.Model):
"fiscal.company.check.company.mixin",
]

_fiscal_company_forbid_fiscal_type = ["fiscal_mother"]
_fiscal_company_forbid_fiscal_type = ["group", "fiscal_mother"]

journal_id = fields.Many2one(check_company=False)

Expand Down
2 changes: 1 addition & 1 deletion fiscal_company_account/models/account_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AccountMoveLine(models.Model):
"fiscal.company.check.company.mixin",
]

_fiscal_company_forbid_fiscal_type = ["fiscal_mother"]
_fiscal_company_forbid_fiscal_type = ["group", "fiscal_mother"]

account_id = fields.Many2one(check_company=False)

Expand Down
8 changes: 7 additions & 1 deletion fiscal_company_account/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@


class AccountPayment(models.Model):
_inherit = "account.payment"
_name = "account.payment"
_inherit = [
"account.payment",
"fiscal.company.check.company.mixin",
]

_fiscal_company_forbid_fiscal_type = ["group"]

destination_account_id = fields.Many2one(check_company=False)

Expand Down
2 changes: 1 addition & 1 deletion fiscal_company_account/models/account_tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ class AccountTax(models.Model):
"fiscal.company.check.company.mixin",
]

_fiscal_company_forbid_fiscal_type = ["fiscal_child"]
_fiscal_company_forbid_fiscal_type = ["group", "fiscal_child"]
8 changes: 7 additions & 1 deletion fiscal_company_point_of_sale/models/pos_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@


class PosConfig(models.Model):
_inherit = "pos.config"
_name = "pos.config"
_inherit = [
"pos.config",
"fiscal.company.check.company.mixin",
]

_fiscal_company_forbid_fiscal_type = ["group", "fiscal_mother"]

# Overwrite company constrains
@api.constrains("company_id", "invoice_journal_id")
Expand Down
2 changes: 1 addition & 1 deletion fiscal_company_sale/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ class SaleOrder(models.Model):
_name = "sale.order"
_inherit = ["sale.order", "fiscal.company.check.company.mixin"]

_fiscal_company_forbid_fiscal_type = ["fiscal_mother"]
_fiscal_company_forbid_fiscal_type = ["group", "fiscal_mother"]
Loading