Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] New module ir_actions_report_xml_multi_company
- Loading branch information
Jonathan Nemry (ACSONE)
committed
Jan 24, 2017
1 parent
69cccc2
commit 66e531e
Showing
13 changed files
with
162 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,72 @@ | ||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
|
||
=================================== | ||
Ir Actions Report Xml Multy Company | ||
=================================== | ||
|
||
Make Report Actions multy-company Aware | ||
|
||
Installation | ||
============ | ||
|
||
There is no specific installatin procedure for this module | ||
|
||
Configuration | ||
============= | ||
|
||
There is no specific configuration for this module | ||
|
||
Usage | ||
===== | ||
|
||
The usual multi-company record rule is installed automatically | ||
|
||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas | ||
:alt: Try me on Runbot | ||
:target: https://runboddt.odoo-community.org/runbot/133/10.0 | ||
|
||
.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt | ||
.. branch is "8.0" for example | ||
Known issues / Roadmap | ||
====================== | ||
|
||
* ... | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/OCA/multi-company/issues>`_. In case of trouble, please | ||
check there if your issue has already been reported. If you spotted it first, | ||
help us smashing it by providing a detailed and welcomed feedback. | ||
|
||
Credits | ||
======= | ||
|
||
Images | ||
------ | ||
|
||
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_. | ||
|
||
Contributors | ||
------------ | ||
|
||
* Jonathan Nemry <jonathan.nemry@acsone.eu> | ||
|
||
Maintainer | ||
---------- | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
This module is maintained by the OCA. | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
To contribute to this module, please visit https://odoo-community.org. |
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 @@ | ||
from . import models |
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,21 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2016 ACSONE SA/NV, Odoo Community Association (OCA) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
'name': 'Ir Actions Report Xml Multy Company', | ||
'summary': """ | ||
Make Report Actions multy-company aware""", | ||
'version': '10.0.1.0.0', | ||
'license': 'AGPL-3', | ||
'author': 'ACSONE SA/NV,' | ||
'Odoo Community Association (OCA)', | ||
'website': 'www.acsone.eu', | ||
'depends': [ | ||
'report', | ||
], | ||
'data': [ | ||
'views/ir_actions_report_xml.xml', | ||
'security/multi_company.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 @@ | ||
from . import ir_actions_report_xml |
18 changes: 18 additions & 0 deletions
18
ir_actions_report_xml_multy_company/models/ir_actions_report_xml.py
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,18 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2016 ACSONE SA/NV | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class IrActionsReportXml(models.Model): | ||
|
||
_inherit = 'ir.actions.report.xml' | ||
|
||
@api.model | ||
def _default_company(self): | ||
return self.env['res.company']._company_default_get('res.partner') | ||
|
||
company_id = fields.Many2one( | ||
comodel_name='res.company', | ||
string='Company', default=_default_company) |
14 changes: 14 additions & 0 deletions
14
ir_actions_report_xml_multy_company/security/multi_company.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,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<data noupdate="1"> | ||
|
||
<record id="ir_actions_report_xml_rule" model="ir.rule"> | ||
<field name="name" >Ir Actins Report XML multi-company</field> | ||
<field name="model_id" ref="report.model_ir_actions_report_xml"/> | ||
<field name="global" eval="True"/> | ||
<field name="domain_force"> ['|',('company_id','=',user.company_id.id),('company_id','=',False)]</field> | ||
<field name="active" eval="True"/> | ||
</record> | ||
|
||
</data> | ||
</odoo> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions
20
ir_actions_report_xml_multy_company/views/ir_actions_report_xml.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,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2016 ACSONE SA/NV | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
|
||
<odoo> | ||
<data> | ||
|
||
<record model="ir.ui.view" id="ir_actions_report_xml_form_view"> | ||
<field name="name">ir.actions.report.xml.form (in ir_actions_report_xml_multy_company)</field> | ||
<field name="model">ir.actions.report.xml</field> | ||
<field name="inherit_id" ref="base.act_report_xml_view"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='name']" position="after"> | ||
<field name="company_id"/> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
</data> | ||
</odoo> |
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 @@ | ||
This directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins. | ||
|
||
This directory caches those eggs to prevent repeated downloads. | ||
|
||
However, it is safe to delete this directory. | ||
|
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 @@ | ||
__import__('pkg_resources').declare_namespace(__name__) |
1 change: 1 addition & 0 deletions
1
setup/ir_actions_report_xml_multy_company/odoo/addons/__init__.py
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 @@ | ||
__import__('pkg_resources').declare_namespace(__name__) |
1 change: 1 addition & 0 deletions
1
setup/ir_actions_report_xml_multy_company/odoo/addons/ir_actions_report_xml_multy_company
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 @@ | ||
../../../../ir_actions_report_xml_multy_company |
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, | ||
) |