[IMP] quality_control_mrp: required changes

* Limit access by groups in views
* Use api.model
This commit is contained in:
oihane
2015-11-18 16:55:01 +01:00
parent 75d638db0a
commit ba059c5572
6 changed files with 25 additions and 24 deletions

View File

@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
# (c) 2014 Serv. Tec. Avanzados - Pedro M. Baeza
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import models

View File

@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
# (c) 2014 Serv. Tec. Avanzados - Pedro M. Baeza
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import qc_inspection
from . import mrp_production

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
# (c) 2014 Serv. Tec. Avanzados - Pedro M. Baeza
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields, api
from openerp.addons.quality_control.models.qc_trigger_line import\
_filter_trigger_lines
@@ -21,14 +21,7 @@ class MrpProduction(models.Model):
created_inspections = fields.Integer(
compute="_count_inspections", string="Created inspections")
@api.v7
def action_produce(self, cr, uid, production_id, production_qty,
production_mode, wiz=False, context=None):
production = self.browse(cr, uid, production_id, context=context)
production.action_produce(
production_id, production_qty, production_mode, wiz=wiz)
@api.v8
@api.model
def action_produce(self, production_id, production_qty, production_mode,
wiz=False):
res = super(MrpProduction, self).action_produce(

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
# (c) 2014 Serv. Tec. Avanzados - Pedro M. Baeza
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields, api

View File

@@ -24,6 +24,8 @@
<field name="name">mrp.production.form.qc</field>
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_buttons" />
<field name="groups_id"
eval="[(4, ref('quality_control.group_quality_control_user'))]" />
<field name="arch" type="xml">
<div name="buttons" position="inside">
<button class="oe_inline oe_stat_button"

View File

@@ -6,6 +6,8 @@
<field name="name">qc.inspection.form.view.production</field>
<field name="model">qc.inspection</field>
<field name="inherit_id" ref="quality_control.qc_inspection_form_view" />
<field name="groups_id"
eval="[(4, ref('mrp.group_mrp_user'))]" />
<field name="arch" type="xml">
<field name="product" position="after">
<field name="production" />
@@ -17,6 +19,8 @@
<field name="name">qc.inspection.tree.view.production</field>
<field name="model">qc.inspection</field>
<field name="inherit_id" ref="quality_control.qc_inspection_tree_view" />
<field name="groups_id"
eval="[(4, ref('mrp.group_mrp_user'))]" />
<field name="arch" type="xml">
<field name="product" position="after">
<field name="production" />
@@ -28,10 +32,11 @@
<field name="name">qc.inspection.search.view.production</field>
<field name="model">qc.inspection</field>
<field name="inherit_id" ref="quality_control.qc_inspection_search_view" />
<field name="groups_id"
eval="[(4, ref('mrp.group_mrp_user'))]" />
<field name="arch" type="xml">
<filter string="Product" position="after">
<filter string="Production"
domain="[]"
<filter string="Production" domain="[]"
context="{'group_by': 'production'}" />
</filter>
</field>
@@ -41,6 +46,8 @@
<field name="name">qc.inspection.line.tree.production</field>
<field name="model">qc.inspection.line</field>
<field name="inherit_id" ref="quality_control.qc_inspection_line_tree_view"/>
<field name="groups_id"
eval="[(4, ref('mrp.group_mrp_user'))]" />
<field name="arch" type="xml">
<field name="product" position="after">
<field name="production" />
@@ -52,13 +59,14 @@
<field name="name">qc.inspection.line.search.production</field>
<field name="model">qc.inspection.line</field>
<field name="inherit_id" ref="quality_control.qc_inspection_line_search_view" />
<field name="groups_id"
eval="[(4, ref('mrp.group_mrp_user'))]" />
<field name="arch" type="xml">
<field name="product" position="after">
<field name="production" />
</field>
<filter string="Product" position="after">
<filter string="Production order"
domain="[]"
<filter string="Production order" domain="[]"
context="{'group_by': 'production'}" />
</filter>
</field>