mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[ADD] mrp_workcenter_group module
[
This commit is contained in:
24
mrp_workcenter_group/__init__.py
Normal file
24
mrp_workcenter_group/__init__.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- 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,
|
||||
)
|
||||
62
mrp_workcenter_group/__openerp__.py
Normal file
62
mrp_workcenter_group/__openerp__.py
Normal file
@@ -0,0 +1,62 @@
|
||||
# -*- 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',
|
||||
'summary': "Organise Workcenters by section",
|
||||
'maintener': 'Akretion',
|
||||
'category': 'Manufacturing',
|
||||
'depends': [
|
||||
'mrp_operations',
|
||||
],
|
||||
'description': """
|
||||
Features
|
||||
--------
|
||||
|
||||
* Add a new model: Workcenter Groups
|
||||
* Add a many2one field 'Group' in workcenter view form based on this model
|
||||
* Define a new 'Group by' entry named 'Group' in search view
|
||||
|
||||
|
||||
|
||||
Contributors
|
||||
------------
|
||||
* David BEAL <david.beal@akretion.com>
|
||||
|
||||
""",
|
||||
'website': 'http://www.akretion.com/',
|
||||
'data': [
|
||||
'workcenter_view.xml',
|
||||
],
|
||||
'demo': [
|
||||
],
|
||||
'external_dependencies': {
|
||||
'python': [],
|
||||
},
|
||||
'license': 'AGPL-3',
|
||||
'tests': [],
|
||||
'installable': True,
|
||||
'auto_install': False,
|
||||
'application': False,
|
||||
}
|
||||
44
mrp_workcenter_group/workcenter.py
Normal file
44
mrp_workcenter_group/workcenter.py
Normal file
@@ -0,0 +1,44 @@
|
||||
# -*- 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'),
|
||||
}
|
||||
|
||||
|
||||
class MrpWorkcenter(orm.Model):
|
||||
_inherit = 'mrp.workcenter'
|
||||
|
||||
_columns = {
|
||||
'workcenter_group_id': fields.many2one(
|
||||
'workcenter.group',
|
||||
string='Group'),
|
||||
}
|
||||
52
mrp_workcenter_group/workcenter_view.xml
Normal file
52
mrp_workcenter_group/workcenter_view.xml
Normal file
@@ -0,0 +1,52 @@
|
||||
<?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>
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
Reference in New Issue
Block a user