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

[16.0][IMP] ddmrp_history: add multicompany rules #448

Merged
merged 1 commit into from
May 7, 2024
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
1 change: 1 addition & 0 deletions ddmrp_history/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"depends": ["ddmrp"],
"data": [
"security/ir.model.access.csv",
"security/security.xml",
"views/ddmrp_history_view.xml",
"views/stock_buffer_view.xml",
],
Expand Down
3 changes: 3 additions & 0 deletions ddmrp_history/models/ddmrp_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ class DdmrpHistory(models.Model):
group_operator="avg",
help="Average Daily Usage",
)
company_id = fields.Many2one(
related="buffer_id.company_id",
)
13 changes: 13 additions & 0 deletions ddmrp_history/security/security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com)
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0) -->
<odoo>
<record id="ddmrp_history_multicompany" model="ir.rule">
<field name="name">DDMRP History Multi-Company</field>
<field name="model_id" ref="model_ddmrp_history" />
<field eval="True" name="global" />
<field
name="domain_force"
>['|',('company_id', 'in', company_ids),('company_id','=',False)]</field>
</record>
</odoo>
5 changes: 5 additions & 0 deletions ddmrp_history/views/ddmrp_history_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
<field name="net_flow_position" />
<field name="on_hand_position" />
<field name="date" />
<field
name="company_id"
groups="base.group_multi_company"
optional="hide"
/>
</tree>
</field>
</record>
Expand Down
Loading