-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] mis_builder_company_comparison
- Loading branch information
1 parent
8efc40a
commit f551475
Showing
12 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
from . import model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# © 2023 ForgeFlow S.L. | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
{ | ||
"name": "MIS Builder with compared companies", | ||
"version": "14.0.1.0.0", | ||
"category": "Reporting", | ||
"author": "ForgeFlow, " "Odoo Community Association (OCA)", | ||
"license": "AGPL-3", | ||
"website": "https://github.com/OCA/mis-builder-contrib", | ||
"depends": ["mis_builder"], | ||
"data": ["security/mis_builder_security.xml", "view/mis_builder.xml"], | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
from . import mis_builder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Copyright 2023 ForgeFlow S.L. | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class MisReportInstance(models.Model): | ||
|
||
_inherit = "mis.report.instance" | ||
|
||
company_ids = fields.Many2many( | ||
"res.company", | ||
string="Companies", | ||
) | ||
|
||
|
||
class MisReportInstancePeriod(models.Model): | ||
|
||
_inherit = "mis.report.instance.period" | ||
|
||
company_ids = fields.Many2many( | ||
"res.company", | ||
string="Companies", | ||
) | ||
|
||
def _get_additional_move_line_filter(self): | ||
aml_domain = super( | ||
MisReportInstancePeriod, self | ||
)._get_additional_move_line_filter() | ||
sudoself = self.sudo() | ||
if sudoself.report_instance_id.company_ids: | ||
aml_domain.append( | ||
( | ||
"company_id", | ||
"in", | ||
sudoself.report_instance_id.company_ids.ids, | ||
) | ||
) | ||
if sudoself.company_ids: | ||
aml_domain.append(("company_id", "in", sudoself.company_ids.ids)) | ||
return aml_domain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* Joan Sisquella <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Introduces the company column to MIS Builder report instances. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Set the company in a MIS Builder instance. |
16 changes: 16 additions & 0 deletions
16
mis_builder_company_comparison/security/mis_builder_security.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<!--Copyright 2023 ForgeFlow S.L. - --> | ||
<record id="ir_rule_mis_builder_allowed_companies" model="ir.rule"> | ||
<field name="model_id" ref="mis_builder.model_mis_report_instance" /> | ||
<field | ||
name="domain_force" | ||
>['|',('company_ids','=',False),('company_ids','in',[g.id for g in user.company_ids])]</field> | ||
<field name="name">MIS Reports from allowed companies</field> | ||
<field name="global" eval="True" /> | ||
<field eval="1" name="perm_unlink" /> | ||
<field eval="1" name="perm_write" /> | ||
<field eval="1" name="perm_read" /> | ||
<field eval="1" name="perm_create" /> | ||
</record> | ||
</odoo> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<record model="ir.ui.view" id="mis_report_instance_view_tree"> | ||
<field name="name">mis.report.instance.view.tree</field> | ||
<field name="model">mis.report.instance</field> | ||
<field name="inherit_id" ref="mis_builder.mis_report_instance_view_tree" /> | ||
<field name="arch" type="xml"> | ||
<field name="target_move" position="after"> | ||
<field | ||
name="company_ids" | ||
widget="many2many_tags" | ||
groups="base.group_multi_company" | ||
/> | ||
</field> | ||
</field> | ||
</record> | ||
<record model="ir.ui.view" id="mis_report_instance_view_form"> | ||
<field name="name">mis.report.instance.view.form</field> | ||
<field name="model">mis.report.instance</field> | ||
<field name="inherit_id" ref="mis_builder.mis_report_instance_view_form" /> | ||
<field name="priority" eval="16" /> | ||
<field name="arch" type="xml"> | ||
<field name="target_move" position="after"> | ||
<field | ||
name="company_ids" | ||
widget="many2many_tags" | ||
groups="base.group_multi_company" | ||
/> | ||
</field> | ||
</field> | ||
</record> | ||
<record model="ir.ui.view" id="mis_report_instance_period_view_form"> | ||
<field name="name">mis.report.instance.period.view.form</field> | ||
<field name="model">mis.report.instance.period</field> | ||
<field | ||
name="inherit_id" | ||
ref="mis_builder.mis_report_instance_period_view_form" | ||
/> | ||
<field name="priority" eval="16" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//group[@name='source_data']" position="inside"> | ||
<field | ||
name="company_ids" | ||
widget="many2many_tags" | ||
groups="base.group_multi_company" | ||
attrs="{'invisible': [('source', 'not in', ('actuals', 'actuals_alt'))]}" | ||
/> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |
1 change: 1 addition & 0 deletions
1
setup/mis_builder_company_comparison/odoo/addons/mis_builder_company_comparison
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../mis_builder_company_comparison |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |