Skip to content

Commit

Permalink
[IMP]subscription_oca: Multi-company security
Browse files Browse the repository at this point in the history
  • Loading branch information
quoc-pn committed Aug 19, 2024
1 parent 93830e4 commit 366b0dc
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions subscription_oca/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ Contributors

* Ilyas <[email protected]>

* `Komit <https://komit-consulting.com>`__:

* Pham Ngoc Quoc <[email protected]>

Maintainers
~~~~~~~~~~~

Expand Down
1 change: 1 addition & 0 deletions subscription_oca/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"data/sale_subscription_data.xml",
"wizard/close_subscription_wizard.xml",
"security/ir.model.access.csv",
"security/ir_rule.xml",
],
"installable": True,
"application": True,
Expand Down
1 change: 1 addition & 0 deletions subscription_oca/models/sale_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class SaleSubscription(models.Model):
_description = "Subscription"
_inherit = ["mail.thread", "mail.activity.mixin"]
_order = "id desc"
_check_company_auto = True

color = fields.Integer("Color Index")
name = fields.Char(
Expand Down
4 changes: 4 additions & 0 deletions subscription_oca/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
* `Ooops404 <https://www.ooops404.com>`__:

* Ilyas <[email protected]>

* `Komit <https://komit-consulting.com>`__:

* Pham Ngoc Quoc <[email protected]>
12 changes: 12 additions & 0 deletions subscription_oca/security/ir_rule.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>

<record id="sale_subscription_comp_rule" model="ir.rule">
<field name="name">Sale Subscription</field>
<field name="model_id" ref="model_sale_subscription" />
<field
name="domain_force"
>['|',('company_id','=',False), ('company_id', 'in', company_ids)]</field>
</record>

</odoo>
4 changes: 4 additions & 0 deletions subscription_oca/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<li>Ilyas &lt;<a class="reference external" href="mailto:irazor147&#64;gmail.com">irazor147&#64;gmail.com</a>&gt;</li>
</ul>
</li>
<li><a class="reference external" href="https://komit-consulting.com">Komit</a>:<ul>
<li>Pham Ngoc Quoc &lt;<a class="reference external" href="mailto:quoc-pn&#64;komit-consulting.com">quoc-pn&#64;komit-consulting.com</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down

0 comments on commit 366b0dc

Please sign in to comment.