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

[MIG] operating_unit to v10.0 #45

Merged
merged 7 commits into from
Jan 26, 2017
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
19 changes: 5 additions & 14 deletions operating_unit/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ following features:
* Product and customer independence of OU.
* OU specific P&L and Balance sheet.

Installation
============

No external library is used.

Configuration
=============

Expand All @@ -37,19 +32,15 @@ Other modules extend the standard Odoo apps with the OU.

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/213/9.0
:target: https://runbot.odoo-community.org/runbot/213/10.0

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/213/issues>`_. In case of trouble, please
<https://github.com/OCA/operating-unit/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
<https://github.com/OCA/
213/issues/new?body=module:%20
operating_unit%0Aversion:%20
9.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
help us smash it by providing detailed and welcomed feedback.

Credits
=======
Expand All @@ -62,7 +53,7 @@ Images
Contributors
------------

* Eficent Business and IT Consulting Services S.L. <contact@eficent.com>
* Eficent <contact@eficent.com>
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>

Maintainer
Expand All @@ -78,4 +69,4 @@ 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 http://odoo-community.org.
To contribute to this module, please visit http://odoo-community.org.
4 changes: 2 additions & 2 deletions operating_unit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# © 2015 Eficent Business and IT Consulting Services S.L.
# © 2015-2017 Eficent
# - Jordi Ballester Alomar
# © 2015 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya
# © 2015-2017 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from . import models
12 changes: 6 additions & 6 deletions operating_unit/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# -*- coding: utf-8 -*-
# © 2015 Eficent Business and IT Consulting Services S.L.
# © 2015-2017 Eficent
# - Jordi Ballester Alomar
# © 2015 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
# © 2015-2017 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya
# License: LGPL-3 or later (https://www.gnu.org/licenses/lgpl.html).

{
"name": "Operating Unit",
"summary": "An operating unit (OU) is an organizational entity part of a "
"company",
"version": "9.0.1.0.0",
"author": "Eficent Business and IT Consulting Services S.L., "
"version": "10.0.1.0.0",
"author": "Eficent, "
"Serpent Consulting Services Pvt. Ltd.,"
"Odoo Community Association (OCA)",
"website": "http://www.eficent.com",
Expand All @@ -26,5 +26,5 @@
'demo': [
"demo/operating_unit_demo.xml"
],
'installable': False,
'installable': True,
}
34 changes: 15 additions & 19 deletions operating_unit/data/operating_unit_data.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<odoo noupdate="1">
<!-- Basic Operating Unit -->
<record id="main_operating_unit" model="operating.unit">
<field name="name">Main Operating Unit</field>
<field name="code">OU1</field>
<field name="partner_id" ref="base.main_partner"/>
</record>

<!-- Basic Operating Unit -->
<record id="main_operating_unit" model="operating.unit">
<field name="name">Main Operating Unit</field>
<field name="code">OU1</field>
<field name="partner_id" ref="base.main_partner"/>
</record>

<record model="res.users" id="base.user_root">
<field name="default_operating_unit_id" ref="main_operating_unit"/>
<field name="operating_unit_ids"
eval="[(4, ref('main_operating_unit'))]"/>
<field name="groups_id"
eval="[(4,ref('operating_unit.group_multi_operating_unit'))]"/>
</record>

</data>
</openerp>
<record model="res.users" id="base.user_root">
<field name="default_operating_unit_id" ref="main_operating_unit"/>
<field name="operating_unit_ids"
eval="[(4, ref('main_operating_unit'))]"/>
<field name="groups_id"
eval="[(4,ref('operating_unit.group_multi_operating_unit'))]"/>
</record>
</odoo>
43 changes: 20 additions & 23 deletions operating_unit/demo/operating_unit_demo.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">
<odoo noupdate="0">
<record id="b2b_operating_unit" model="operating.unit">
<field name="name">B2B</field>
<field name="code">B2B</field>
<field name="partner_id" ref="base.main_partner"/>
</record>

<record id="b2b_operating_unit" model="operating.unit">
<field name="name">B2B</field>
<field name="code">B2B</field>
<field name="partner_id" ref="base.main_partner"/>
</record>

<record id="b2c_operating_unit" model="operating.unit">
<field name="name">B2C</field>
<field name="code">B2C</field>
<field name="partner_id" ref="base.main_partner"/>
</record>
<record id="b2c_operating_unit" model="operating.unit">
<field name="name">B2C</field>
<field name="code">B2C</field>
<field name="partner_id" ref="base.main_partner"/>
</record>

<record model="res.users" id="base.user_demo">
<field name="default_operating_unit_id"
ref="main_operating_unit"/>
<field name="operating_unit_ids"
eval="[(4, ref('main_operating_unit')),(4, ref('b2b_operating_unit')),(4, ref('b2b_operating_unit')),(4, ref('b2c_operating_unit'))]"/>
<field name="groups_id"
eval="[(4,ref('operating_unit.group_multi_operating_unit'))]"/>
</record>

</data>
</openerp>
<record model="res.users" id="base.user_demo">
<field name="default_operating_unit_id"
ref="main_operating_unit"/>
<field name="operating_unit_ids"
eval="[(4, ref('main_operating_unit')),(4, ref('b2b_operating_unit')),(4, ref('b2b_operating_unit')),(4, ref('b2c_operating_unit'))]"/>
<field name="groups_id"
eval="[(4,ref('operating_unit.group_multi_operating_unit'))]"/>
</record>
</odoo>
4 changes: 2 additions & 2 deletions operating_unit/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# © 2015 Eficent Business and IT Consulting Services S.L.
# © 2015-2017 Eficent
# - Jordi Ballester Alomar
# © 2015 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya
# © 2015-2017 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from . import operating_unit
from . import res_users
6 changes: 3 additions & 3 deletions operating_unit/models/operating_unit.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
# © 2015 Eficent Business and IT Consulting Services S.L.
# © 2015-2017 Eficent
# - Jordi Ballester Alomar
# © 2015 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya
# © 2015-2017 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from openerp import api, fields, models
from odoo import api, fields, models


class OperatingUnit(models.Model):
Expand Down
6 changes: 3 additions & 3 deletions operating_unit/models/res_users.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
# © 2015 Eficent Business and IT Consulting Services S.L.
# © 2015-2017 Eficent
# - Jordi Ballester Alomar
# © 2015 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya
# © 2015-2017 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from openerp import api, fields, models
from odoo import api, fields, models


class ResUsers(models.Model):
Expand Down
2 changes: 1 addition & 1 deletion operating_unit/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_account_operating_unit_erp_manager,operating.unit erp.manager,model_operating_unit,base.group_erp_manager,1,1,1,1
access_account_operating_unit_user,operating_unit user,model_operating_unit,,1,0,0,0
access_account_operating_unit_user,operating_unit user,model_operating_unit,,1,0,0,0
7 changes: 2 additions & 5 deletions operating_unit/security/operating_unit_security.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<odoo noupdate="1">

<record id="group_multi_operating_unit" model="res.groups">
<field name="name">Multi Operating Unit</field>
Expand All @@ -13,6 +12,4 @@
<field name="global" eval="True"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>

</data>
</openerp>
</odoo>
107 changes: 52 additions & 55 deletions operating_unit/view/operating_unit_view.xml
Original file line number Diff line number Diff line change
@@ -1,60 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>

<record id="view_operating_unit_form" model="ir.ui.view">
<field name="name">operating.unit.form</field>
<field name="model">operating.unit</field>
<field name="arch" type="xml">
<form string="Operating Unit" version="7.0">
<group>
<field name="name"/>
<field name="code"/>
<field name="active"/>
<field name="partner_id"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
</form>
</field>
</record>

<record id="view_operating_unit_tree" model="ir.ui.view">
<field name="name">operating.unit.tree</field>
<field name="model">operating.unit</field>
<field name="arch" type="xml">
<tree string="Operating Unit">
<field name="code"/>
<odoo>
<record id="view_operating_unit_form" model="ir.ui.view">
<field name="name">operating.unit.form</field>
<field name="model">operating.unit</field>
<field name="arch" type="xml">
<form string="Operating Unit" version="7.0">
<group>
<field name="name"/>
<field name="code"/>
<field name="active"/>
<field name="partner_id"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<record id="view_operating_unit_search" model="ir.ui.view">
<field name="name">operating.unit.search</field>
<field name="model">operating.unit</field>
<field name="arch" type="xml">
<search string="Search Operating Unit">
<field name="name" string="Operating Unit"/>
<field name="code" string="Code"/>
</search>
</field>
</record>
</group>
</form>
</field>
</record>

<record id="view_operating_unit_tree" model="ir.ui.view">
<field name="name">operating.unit.tree</field>
<field name="model">operating.unit</field>
<field name="arch" type="xml">
<tree string="Operating Unit">
<field name="code"/>
<field name="name"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<record id="view_operating_unit_search" model="ir.ui.view">
<field name="name">operating.unit.search</field>
<field name="model">operating.unit</field>
<field name="arch" type="xml">
<search string="Search Operating Unit">
<field name="name" string="Operating Unit"/>
<field name="code" string="Code"/>
</search>
</field>
</record>

<record id="action_operating_unit_tree" model="ir.actions.act_window">
<field name="name">Operating Units</field>
<field name="res_model">operating.unit</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to start a new Operating Unit.
</p>
</field>
</record>
<record id="action_operating_unit_tree" model="ir.actions.act_window">
<field name="name">Operating Units</field>
<field name="res_model">operating.unit</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to start a new Operating Unit.
</p>
</field>
</record>

<menuitem action="action_operating_unit_tree"
id="menu_action_operating_unit_tree"
parent="base.menu_users"
groups="operating_unit.group_multi_operating_unit"/>
</data>
</openerp>
<menuitem action="action_operating_unit_tree"
id="menu_action_operating_unit_tree"
parent="base.menu_users"
groups="operating_unit.group_multi_operating_unit"/>
</odoo>
34 changes: 15 additions & 19 deletions operating_unit/view/res_users_view.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>

<record id="view_users_form" model="ir.ui.view">
<field name="name">res.users.form</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<field name="groups_id" position="before">
<group string="Allowed Operating Units">
<field name="default_operating_unit_id"/>
<field name="operating_unit_ids" groups="operating_unit.group_multi_operating_unit"
widget="many2many_tags"/>
</group>
</field>
<odoo>
<record id="view_users_form" model="ir.ui.view">
<field name="name">res.users.form</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<field name="groups_id" position="before">
<group string="Allowed Operating Units">
<field name="default_operating_unit_id"/>
<field name="operating_unit_ids" groups="operating_unit.group_multi_operating_unit"
widget="many2many_tags"/>
</group>
</field>
</record>

</data>
</openerp>
</field>
</record>
</odoo>