mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[IMP] quality_control_mrp: required changes
* Limit access by groups in views * Use api.model
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user