Skip to content

Commit

Permalink
Merge PR #3965 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by sergiocorato
  • Loading branch information
OCA-git-bot committed Feb 28, 2024
2 parents e951df4 + 29d9d59 commit 3d77345
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions l10n_it_intrastat/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
],
"data": [
"security/ir.model.access.csv",
"security/rules.xml",
"data/account.intrastat.transaction.nature.csv",
"data/account.intrastat.transaction.nature.b.csv",
"data/account.intrastat.transport.csv",
Expand Down
7 changes: 7 additions & 0 deletions l10n_it_intrastat/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,13 @@ def _get_partner_data(self, partner):
ondelete="cascade",
required=True,
)
company_id = fields.Many2one(
related="invoice_id.company_id",
store=True,
readonly=True,
precompute=True,
index=True,
)
partner_id = fields.Many2one(
string="Partner", readonly=True, related="invoice_id.partner_id", store=True
)
Expand Down
10 changes: 10 additions & 0 deletions l10n_it_intrastat/security/rules.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="account_invoice_intrastat_comp_rule" model="ir.rule">
<field name="name">Intrastat Lines</field>
<field name="model_id" ref="model_account_invoice_intrastat" />
<field
name="domain_force"
>['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
</record>
</odoo>

0 comments on commit 3d77345

Please sign in to comment.