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_report_part_flow_index: add multi-company restrictions #451

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_report_part_flow_index/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
],
"data": [
"security/ir.model.access.csv",
"security/report_ddmrp_part_plan_flow_index_security.xml",
"reports/report_ddmrp_part_plan_flow_index_views.xml",
"views/ddmrp_flow_index_group_views.xml",
"views/stock_buffer_view.xml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class ReportDdmrpPartsPlanFlowIndex(models.Model):
buffer_id = fields.Many2one("stock.buffer", string="Buffer", readonly=True)
product_id = fields.Many2one("product.product", string="Product", readonly=True)
location_id = fields.Many2one("stock.location", string="Location", readonly=True)
company_id = fields.Many2one("res.company", string="Company", readonly=True)
adu = fields.Float(
string="Average Daily Usage (ADU)",
default=0.0,
Expand All @@ -30,6 +31,7 @@ def _sub_select(self):
id,
product_id,
location_id,
company_id,
adu,
flow_index_group_id,
green_zone_qty,
Expand All @@ -46,6 +48,7 @@ def _select(self):
a.id as buffer_id,
a.product_id as product_id,
a.location_id as location_id,
a.company_id as company_id,
a.adu as adu,
a.flow_index_group_id as flow_index_group_id,
a.green_zone_qty as green_zone_qty,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
<field name="order_frequency" />
<field name="order_frequency_group" />
<field name="order_frequency_group_count" />
<field
name="company_id"
groups="base.group_multi_company"
optional="hide"
/>
</tree>
</field>
</record>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<odoo>
<record model="ir.rule" id="report_ddmrp_part_plan_flow_index_comp_rule">
<field name="name">Report DDMRP Part Plan Flow Index multi-company</field>
<field name="model_id" ref="model_report_ddmrp_part_plan_flow_index" />
<field name="global" eval="True" />
<field
name="domain_force"
>['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
</record>
</odoo>
Loading