Skip to content

Commit

Permalink
[ADD] New module ir_actions_report_xml_multi_company
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Nemry (ACSONE) committed Jan 24, 2017
1 parent 69cccc2 commit 66e531e
Show file tree
Hide file tree
Showing 13 changed files with 162 additions and 0 deletions.
72 changes: 72 additions & 0 deletions ir_actions_report_xml_multy_company/README.rst
@@ -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.
1 change: 1 addition & 0 deletions ir_actions_report_xml_multy_company/__init__.py
@@ -0,0 +1 @@
from . import models
21 changes: 21 additions & 0 deletions ir_actions_report_xml_multy_company/__manifest__.py
@@ -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',
],
}
1 change: 1 addition & 0 deletions ir_actions_report_xml_multy_company/models/__init__.py
@@ -0,0 +1 @@
from . import ir_actions_report_xml
@@ -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 ir_actions_report_xml_multy_company/security/multi_company.xml
@@ -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.
@@ -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>
6 changes: 6 additions & 0 deletions setup/ir_actions_report_xml_multy_company/.eggs/README.txt
@@ -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.

1 change: 1 addition & 0 deletions setup/ir_actions_report_xml_multy_company/odoo/__init__.py
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
6 changes: 6 additions & 0 deletions setup/ir_actions_report_xml_multy_company/setup.py
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit 66e531e

Please sign in to comment.