Merge pull request #17 from akretion/7-workc-grp

7.0 Add module workcenter group
This commit is contained in:
beau sebastien
2015-04-10 14:08:21 +02:00
14 changed files with 379 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
Description
===========
See __openerp__.py
Define your workcenter groups
-----------------------------
.. image:: static/description/group.png
:alt: Define your workcenter groups on Odoo ERP
Attach a group to your workcenter
---------------------------------
.. image:: static/description/workc.png
:alt: Attach a group to your workcenter with Odoo ERP

View File

@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) All Rights Reserved 2015 Akretion
# @author David BEAL <david.beal@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
from . import workcenter

View File

@@ -0,0 +1,96 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) All Rights Reserved 2015 Akretion
# @author David BEAL <david.beal@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
{
'name': 'MRP Workcenter Group',
'version': '0.5',
'author': 'Akretion,Odoo Community Association (OCA)',
'summary': "Organise Workcenters by section",
'category': 'Manufacturing',
'depends': [
'mrp_operations',
],
'description': """
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License
MRP Workcenter Group
====================
* Add Workcenter Groups to apply some behavior to several Workcenters at once
* Define a new 'Group by' entry named 'Group' in Workcenter search view
Configuration
=============
To visualize features offered by this module, you need to:
* go to Settings > Configuration > Manufacturing
* in the section Manufacturing Order / Planning,
check "Manage routings and work orders" and Validate
Usage
=====
To use this module, you need to go to:
* Manufacturing > Configuration > Workcenter Groups
Credits
=======
Contributors
------------
* David BEAL <david.beal@akretion.com>
* Sébastien BEAU <sebastien.beau@akretion.com>
Maintainer
----------
.. image:: http://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://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 http://odoo-community.org.
""",
'website': 'http://www.akretion.com/',
'data': [
'workcenter_view.xml',
],
'demo': [
'demo/workcenter.group.csv',
'demo/mrp.workcenter.csv',
],
'license': 'AGPL-3',
'tests': [],
'installable': True,
'auto_install': False,
'application': False,
}

View File

@@ -0,0 +1,4 @@
id,workcenter_group_id/id
mrp.mrp_workcenter_0,assemble
mrp.mrp_workcenter_2,assemble
mrp.mrp_workcenter_1,other
1 id workcenter_group_id/id
2 mrp.mrp_workcenter_0 assemble
3 mrp.mrp_workcenter_2 assemble
4 mrp.mrp_workcenter_1 other

View File

@@ -0,0 +1,3 @@
id,name
assemble,Assemble
other,Other
1 id name
2 assemble Assemble
3 other Other

View File

@@ -0,0 +1,62 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * mrp_workcenter_group
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-03-19 10:15+0000\n"
"PO-Revision-Date: 2015-03-19 10:15+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: mrp_workcenter_group
#: field:workcenter.group,active:0
msgid "Active"
msgstr ""
#. module: mrp_workcenter_group
#: view:mrp.workcenter:0
#: field:mrp.workcenter,workcenter_group_id:0
#: view:workcenter.group:0
msgid "Group"
msgstr ""
#. module: mrp_workcenter_group
#: view:workcenter.group:0
#: field:workcenter.group,workcenter_ids:0
msgid "Linked Workcenters"
msgstr ""
#. module: mrp_workcenter_group
#: field:workcenter.group,name:0
msgid "Name"
msgstr ""
#. module: mrp_workcenter_group
#: field:workcenter.group,sequence:0
msgid "Sequence"
msgstr ""
#. module: mrp_workcenter_group
#: code:_description:0
#: model:ir.model,name:mrp_workcenter_group.model_mrp_workcenter
#, python-format
msgid "Work Center"
msgstr ""
#. module: mrp_workcenter_group
#: code:_description:0
#: model:ir.actions.act_window,name:mrp_workcenter_group.act_open_workcenter_group_view
#: model:ir.model,name:mrp_workcenter_group.model_workcenter_group
#: model:ir.ui.menu,name:mrp_workcenter_group.menu_mrp_workcenter_group
#: view:workcenter.group:0
#, python-format
msgid "Workcenter Groups"
msgstr ""

View File

@@ -0,0 +1,4 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_workcenter_group_user","access_workcenter_group","model_workcenter_group","base.group_user",1,0,0,0
"access_workcenter_group_mrp_user","access_workcenter_group_mrp_user","model_workcenter_group","stock.group_mrp_user",1,1,0,0
"access_workcenter_group_mrp_user_mng","access_workcenter_group_mrp_user_mng","model_workcenter_group","stock.group_mrp_manager",1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_workcenter_group_user access_workcenter_group model_workcenter_group base.group_user 1 0 0 0
3 access_workcenter_group_mrp_user access_workcenter_group_mrp_user model_workcenter_group stock.group_mrp_user 1 1 0 0
4 access_workcenter_group_mrp_user_mng access_workcenter_group_mrp_user_mng model_workcenter_group stock.group_mrp_manager 1 1 1 1

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Multi - Company Rules -->
<record model="ir.rule" id="workcenter_group_comp_rule">
<field name="name">Workcenter multi-company</field>
<field name="model_id" ref="model_workcenter_group"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
</data>
</openerp>

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View File

@@ -0,0 +1,22 @@
<section class="oe_container oe_website_only">
<div class="oe_row oe_more_spaced">
<h3 class="oe_slogan">Workcenter Groups</h3>
<h3 class="oe_slogan"><a href="http://odoo-community.org/">An OCA module</a> : validated by Odoo community experts</h3>
<h4 class="oe_slogan"><a href="http://www.akretion.com/fr">By Akretion</a></h4>
<div class="oe_span6">
<h2>Workcenter Groups</h2>
<table>
<tr><td><h3>Define your workcenter groups</h3><div class="oe_row_img oe_centered"><img class="oe_picture" width="80%" src="group.png"></div><br/><br/></td></tr>
<tr><td><h3>Attach a group to your workcenter</h3><div class="oe_row_img oe_centered"><img class="oe_picture" src="workc.png"></div><br/><br/></td></tr>
</table>
<div class="oe_row oe_centeralign oe_more_space">
<a href="http://www.akretion.com/contact" class="oe_button oe_big">Contact us</a><br>
<a href="https://github.com/OCA/manufacture/tree/7.0" class="oe_button oe_big">Access to the code</a>
</div>
</section>

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@@ -0,0 +1,54 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: David BEAL
# Copyright 2015 Akretion
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.osv import orm, fields
class WorkcenterGroup(orm.Model):
_name = 'workcenter.group'
_description = 'Workcenter Groups'
_order = 'sequence ASC, name ASC'
_columns = {
'name': fields.char('Name'),
'sequence': fields.integer('Sequence'),
'active': fields.boolean('Active'),
'workcenter_ids': fields.one2many(
'mrp.workcenter',
'workcenter_group_id',
readonly=True,
string="Workcenters"
),
}
_defaults = {
'active': True,
}
class MrpWorkcenter(orm.Model):
_inherit = 'mrp.workcenter'
_columns = {
'workcenter_group_id': fields.many2one(
'workcenter.group',
string='Group'),
}

View File

@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--Workcenter Groups-->
<record model="ir.actions.act_window" id="act_open_workcenter_group_view">
<field name="name">Workcenter Groups</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">workcenter.group</field>
<field name="view_mode">tree,form</field>
<field name="domain">[]</field>
<field name="context">{}</field>
</record>
<record id="view_workcenter_group_tree" model="ir.ui.view">
<field name="model">workcenter.group</field>
<field name="type">tree</field>
<field name="priority" eval="8"/>
<field name="arch" type="xml">
<tree string="Group">
<field name="sequence"/>
<field name="name"/>
</tree>
</field>
</record>
<record id="view_workcenter_group_form" model="ir.ui.view">
<field name="model">workcenter.group</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Workcenter Groups" version="7.0">
<group name="main" cols="4">
<group name="group" string="Group" cols="4">
<field name="name"/>
<field name="active"/>
<field name="sequence"/>
</group>
<group name="link" string="Workcenters" cols="4">
<field name="workcenter_ids" nolabel="1"/>
</group>
</group>
</form>
</field>
</record>
<menuitem
id="menu_mrp_workcenter_group"
action="act_open_workcenter_group_view"
name="Workcenter Groups"
parent="mrp.menu_mrp_configuration"
sequence="40"
groups="mrp.group_mrp_manager"/>
<!--Workcenters-->
<record id="view_mrp_workcenter_search" model="ir.ui.view">
<field name="model">mrp.workcenter</field>
<field name="inherit_id" ref="mrp.view_mrp_workcenter_search"/>
<field name="arch" type="xml">
<xpath expr="//filter[@string='Type']" position="before">
<filter string="Group" domain="[]" name="group_by_workcenter"
context="{'group_by':'workcenter_group_id'}"/>
</xpath>
</field>
</record>
<record id="mrp_workcenter_view" model="ir.ui.view">
<field name="model">mrp.workcenter</field>
<field name="inherit_id" ref="mrp.mrp_workcenter_view"/>
<field name="arch" type="xml">
<field name="active" position="after">
<field name="workcenter_group_id"/>
</field>
</field>
</record>
</data>
</openerp>