mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[8.0.1.0.0][mrp_production_request] Backport From 9.0
This commit is contained in:
@@ -82,6 +82,7 @@ Contributors
|
||||
|
||||
* Lois Rilo Antelo <lois.rilo@eficent.com>
|
||||
* Jordi Ballester <jordi.ballester@eficent.com>
|
||||
* Opensynergy Indonesia <openerp@opensynergy-indonesia.com>
|
||||
|
||||
Maintainer
|
||||
----------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"summary": "Allows you to use Manufacturing Request as a previous "
|
||||
"step to Manufacturing Orders for better manufacture "
|
||||
"planification.",
|
||||
"version": "9.0.1.0.0",
|
||||
"version": "8.0.1.0.0",
|
||||
"category": "Manufacturing",
|
||||
"website": "https://github.com/OCA/manufacture",
|
||||
"author": "Eficent,"
|
||||
|
||||
@@ -2,14 +2,21 @@
|
||||
<!-- Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
|
||||
<odoo noupdate="1">
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<record id="seq_mrp_production_request" model="ir.sequence">
|
||||
<field name="name">Manufacturing Request</field>
|
||||
<field name="code">mrp.production.request</field>
|
||||
<field name="prefix">MR/%(range_year)s/</field>
|
||||
<field name="padding">5</field>
|
||||
<field name="company_id" eval="False"/>
|
||||
</record>
|
||||
<record id="sequence_mrp_production_request" model="ir.sequence.type">
|
||||
<field name="name">MRP Production Request</field>
|
||||
<field name="code">mrp.production.request</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
<record id="seq_mrp_production_request" model="ir.sequence">
|
||||
<field name="name">Manufacturing Request</field>
|
||||
<field name="code">mrp.production.request</field>
|
||||
<field name="prefix">MR/%(year)s/</field>
|
||||
<field eval="5" name="padding"/>
|
||||
<field name="company_id" eval="False"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
from openerp import api, fields, models, _
|
||||
import openerp.addons.decimal_precision as dp
|
||||
from openerp.exceptions import UserError
|
||||
from openerp.exceptions import Warning as UserError
|
||||
|
||||
|
||||
class MrpProductionRequest(models.Model):
|
||||
@@ -15,7 +15,7 @@ class MrpProductionRequest(models.Model):
|
||||
@api.model
|
||||
def _company_get(self):
|
||||
company_id = self.env['res.company']._company_default_get(self._name)
|
||||
return self.env['res.company'].browse(company_id.id)
|
||||
return self.env['res.company'].browse(company_id)
|
||||
|
||||
@api.model
|
||||
def _get_default_requested_by(self):
|
||||
|
||||
@@ -1,73 +1,69 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0) -->
|
||||
<odoo>
|
||||
<openerp>
|
||||
<data noupdate="0">
|
||||
|
||||
<data noupdate="0">
|
||||
<record model="ir.module.category" id="module_category_mrp_production_request">
|
||||
<field name="name">Manufacturing Request</field>
|
||||
<field name="parent_id" ref="base.module_category_manufacturing"/>
|
||||
<field name="sequence">20</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.module.category" id="module_category_mrp_production_request">
|
||||
<field name="name">Manufacturing Request</field>
|
||||
<field name="parent_id" ref="base.module_category_manufacturing"/>
|
||||
<field name="sequence">20</field>
|
||||
</record>
|
||||
<record id="group_mrp_production_request_user" model="res.groups">
|
||||
<field name="name">User</field>
|
||||
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
|
||||
<field name="category_id" ref="module_category_mrp_production_request"/>
|
||||
</record>
|
||||
|
||||
<record id="group_mrp_production_request_user" model="res.groups">
|
||||
<field name="name">User</field>
|
||||
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
|
||||
<field name="category_id" ref="module_category_mrp_production_request"/>
|
||||
</record>
|
||||
<record id="group_mrp_production_request_manager" model="res.groups">
|
||||
<field name="name">Manager</field>
|
||||
<field name="implied_ids"
|
||||
eval="[(4, ref('mrp_production_request.group_mrp_production_request_user'))]"/>
|
||||
<field name="users" eval="[(4, ref('base.user_root'))]"/>
|
||||
<field name="category_id" ref="module_category_mrp_production_request"/>
|
||||
</record>
|
||||
|
||||
<record id="group_mrp_production_request_manager" model="res.groups">
|
||||
<field name="name">Manager</field>
|
||||
<field name="implied_ids"
|
||||
eval="[(4, ref('mrp_production_request.group_mrp_production_request_user'))]"/>
|
||||
<field name="users" eval="[(4, ref('base.user_root'))]"/>
|
||||
<field name="category_id" ref="module_category_mrp_production_request"/>
|
||||
</record>
|
||||
<record model="ir.rule" id="mrp_production_request_comp_rule">
|
||||
<field name="name">Manufacturing Request multi-company</field>
|
||||
<field name="model_id" ref="model_mrp_production_request"/>
|
||||
<field name="global" eval="True"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),
|
||||
('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
<data noupdate="0">
|
||||
<record id="mrp_production_request_followers_rule" model="ir.rule">
|
||||
<field name="name">Follow Manufacturing Request</field>
|
||||
<field name="model_id" ref="model_mrp_production_request"/>
|
||||
<field name="groups" eval="[(6,0, [ref('group_mrp_production_request_user')])]"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="False"/>
|
||||
<field name="perm_create" eval="False"/>
|
||||
<field name="perm_unlink" eval="False"/>
|
||||
<field name="domain_force">['|',('requested_by','=',user.id),
|
||||
('message_partner_ids', 'in', [user.partner_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.rule" id="mrp_production_request_comp_rule">
|
||||
<field name="name">Manufacturing Request multi-company</field>
|
||||
<field name="model_id" ref="model_mrp_production_request"/>
|
||||
<field name="global" eval="True"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),
|
||||
('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
<record id="mrp_production_request_rule" model="ir.rule">
|
||||
<field name="name">Manufacturing Request User</field>
|
||||
<field name="model_id" ref="model_mrp_production_request"/>
|
||||
<field name="groups" eval="[(6,0, [ref('group_mrp_production_request_user')])]"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="True"/>
|
||||
<field name="perm_create" eval="True"/>
|
||||
<field name="perm_unlink" eval="True"/>
|
||||
<field name="domain_force">[('requested_by','=',user.id)]</field>
|
||||
</record>
|
||||
|
||||
<record id="mrp_production_request_followers_rule" model="ir.rule">
|
||||
<field name="name">Follow Manufacturing Request</field>
|
||||
<field name="model_id" ref="model_mrp_production_request"/>
|
||||
<field name="groups" eval="[(6,0, [ref('group_mrp_production_request_user')])]"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="False"/>
|
||||
<field name="perm_create" eval="False"/>
|
||||
<field name="perm_unlink" eval="False"/>
|
||||
<field name="domain_force">['|',('requested_by','=',user.id),
|
||||
('message_partner_ids', 'in', [user.partner_id.id])]</field>
|
||||
</record>
|
||||
<record id="mpr_production_request_line_manager_rule" model="ir.rule">
|
||||
<field name="name">Manufacturing Request Line Manager</field>
|
||||
<field name="model_id" ref="model_mrp_production_request"/>
|
||||
<field name="groups" eval="[(6,0, [ref('group_mrp_production_request_manager')])]"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="True"/>
|
||||
<field name="perm_create" eval="True"/>
|
||||
<field name="perm_unlink" eval="True"/>
|
||||
</record>
|
||||
|
||||
<record id="mrp_production_request_rule" model="ir.rule">
|
||||
<field name="name">Manufacturing Request User</field>
|
||||
<field name="model_id" ref="model_mrp_production_request"/>
|
||||
<field name="groups" eval="[(6,0, [ref('group_mrp_production_request_user')])]"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="True"/>
|
||||
<field name="perm_create" eval="True"/>
|
||||
<field name="perm_unlink" eval="True"/>
|
||||
<field name="domain_force">[('requested_by','=',user.id)]</field>
|
||||
</record>
|
||||
|
||||
<record id="mpr_production_request_line_manager_rule" model="ir.rule">
|
||||
<field name="name">Manufacturing Request Line Manager</field>
|
||||
<field name="model_id" ref="model_mrp_production_request"/>
|
||||
<field name="groups" eval="[(6,0, [ref('group_mrp_production_request_manager')])]"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="True"/>
|
||||
<field name="perm_create" eval="True"/>
|
||||
<field name="perm_unlink" eval="True"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -4,10 +4,11 @@
|
||||
|
||||
from openerp.tests.common import TransactionCase
|
||||
from openerp import fields
|
||||
from openerp.exceptions import UserError
|
||||
from openerp.exceptions import Warning as UserError
|
||||
|
||||
|
||||
class TestMrpProductionRequest(TransactionCase):
|
||||
|
||||
def setUp(self, *args, **kwargs):
|
||||
super(TestMrpProductionRequest, self).setUp(*args, **kwargs)
|
||||
self.production_model = self.env['mrp.production']
|
||||
|
||||
@@ -1,224 +1,225 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0) -->
|
||||
<odoo>
|
||||
|
||||
<record model="ir.ui.view" id="view_mrp_production_request_form">
|
||||
<field name="name">mrp.production.request.form</field>
|
||||
<field name="model">mrp.production.request</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Manufacturing Request">
|
||||
<header>
|
||||
<button name="button_draft"
|
||||
states="to_approve,approved,cancel,done"
|
||||
string="Reset"
|
||||
type="object"
|
||||
groups="mrp_production_request.group_mrp_production_request_manager"/>
|
||||
<button name="button_to_approve" states="draft"
|
||||
string="Request approval" type="object"
|
||||
class="oe_highlight"/>
|
||||
<button name="button_approved" states="to_approve"
|
||||
string="Approve" type="object" class="oe_highlight"
|
||||
groups="mrp_production_request.group_mrp_production_request_manager"/>
|
||||
<button name="%(mrp_production_request_create_mo_action)d"
|
||||
context="{'default_mrp_production_request_id':active_id}"
|
||||
states="approved"
|
||||
string="Create Manufacturing Order" type="action"/>
|
||||
<button name="button_done" states="approved"
|
||||
string="Done" type="object" class="oe_highlight"
|
||||
groups="mrp_production_request.group_mrp_production_request_manager"/>
|
||||
<button name="button_cancel" states="to_approve,approved"
|
||||
string="Reject" type="object"
|
||||
groups="mrp_production_request.group_mrp_production_request_manager"/>
|
||||
<field name="state" widget="statusbar"
|
||||
statusbar_visible="draft,approved,done"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<label string="Manufacturing Request"/>
|
||||
<h1>
|
||||
<field name="name"/>
|
||||
</h1>
|
||||
<group name="request">
|
||||
<group>
|
||||
<field name="product_id"
|
||||
domain="[('bom_ids','!=',False),('bom_ids.type','!=','phantom')]"/>
|
||||
<field name="product_tmpl_id" invisible="1"/>
|
||||
<field name="bom_id"
|
||||
domain="['&', '|', ('product_id','=',product_id),
|
||||
'&', ('product_tmpl_id.product_variant_ids','=',product_id),
|
||||
('product_id','=',False), ('type', '=', 'normal')]"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="product_qty"/>
|
||||
<field name="done_qty"/>
|
||||
<field name="manufactured_qty"/>
|
||||
<field name="pending_qty"/>
|
||||
<field name="product_uom" groups="product.group_uom"/>
|
||||
<field name="category_uom_id" invisible="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<group name="users">
|
||||
<field name="requested_by"/>
|
||||
<field name="assigned_to"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="description"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page name="mrp_production" string="Manufacturing Orders">
|
||||
<field name="mrp_production_ids"/>
|
||||
</page>
|
||||
<page name="extra" string="Extra information">
|
||||
<openerp>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="view_mrp_production_request_form">
|
||||
<field name="name">mrp.production.request.form</field>
|
||||
<field name="model">mrp.production.request</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Manufacturing Request">
|
||||
<header>
|
||||
<button name="button_draft"
|
||||
states="to_approve,approved,cancel,done"
|
||||
string="Reset"
|
||||
type="object"
|
||||
groups="mrp_production_request.group_mrp_production_request_manager"/>
|
||||
<button name="button_to_approve" states="draft"
|
||||
string="Request approval" type="object"
|
||||
class="oe_highlight"/>
|
||||
<button name="button_approved" states="to_approve"
|
||||
string="Approve" type="object" class="oe_highlight"
|
||||
groups="mrp_production_request.group_mrp_production_request_manager"/>
|
||||
<button name="%(mrp_production_request_create_mo_action)d"
|
||||
context="{'default_mrp_production_request_id':active_id}"
|
||||
states="approved"
|
||||
string="Create Manufacturing Order" type="action"/>
|
||||
<button name="button_done" states="approved"
|
||||
string="Done" type="object" class="oe_highlight"
|
||||
groups="mrp_production_request.group_mrp_production_request_manager"/>
|
||||
<button name="button_cancel" states="to_approve,approved"
|
||||
string="Reject" type="object"
|
||||
groups="mrp_production_request.group_mrp_production_request_manager"/>
|
||||
<field name="state" widget="statusbar"
|
||||
statusbar_visible="draft,approved,done"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<label string="Manufacturing Request"/>
|
||||
<h1>
|
||||
<field name="name"/>
|
||||
</h1>
|
||||
<group name="request">
|
||||
<group>
|
||||
<group>
|
||||
<field name="procurement_id"/>
|
||||
<field name="procurement_state"/>
|
||||
<field name="origin"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="location_src_id"/>
|
||||
<field name="location_dest_id"/>
|
||||
<field name="date_planned"/>
|
||||
</group>
|
||||
<field name="product_id"
|
||||
domain="[('bom_ids','!=',False),('bom_ids.type','!=','phantom')]"/>
|
||||
<field name="product_tmpl_id" invisible="1"/>
|
||||
<field name="bom_id"
|
||||
domain="['&', '|', ('product_id','=',product_id),
|
||||
'&', ('product_tmpl_id.product_variant_ids','=',product_id),
|
||||
('product_id','=',False), ('type', '=', 'normal')]"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="product_qty"/>
|
||||
<field name="done_qty"/>
|
||||
<field name="manufactured_qty"/>
|
||||
<field name="pending_qty"/>
|
||||
<field name="product_uom" groups="product.group_uom"/>
|
||||
<field name="category_uom_id" invisible="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<group name="users">
|
||||
<field name="requested_by"/>
|
||||
<field name="assigned_to"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="description"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page name="mrp_production" string="Manufacturing Orders">
|
||||
<field name="mrp_production_ids"/>
|
||||
</page>
|
||||
<page name="extra" string="Extra information">
|
||||
<group>
|
||||
<group>
|
||||
<field name="procurement_id"/>
|
||||
<field name="procurement_state"/>
|
||||
<field name="origin"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="location_src_id"/>
|
||||
<field name="location_dest_id"/>
|
||||
<field name="date_planned"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_mrp_production_request_tree">
|
||||
<field name="name">mrp.production.request.tree</field>
|
||||
<field name="model">mrp.production.request</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree decoration-info="state in ('draft','to_approve')"
|
||||
decoration-muted="state in ('cancel')"
|
||||
string="Manufacturing Requests">
|
||||
<field name="name"/>
|
||||
<field name="product_id"/>
|
||||
<field name="requested_by"/>
|
||||
<field name="assigned_to"/>
|
||||
<field name="product_qty"/>
|
||||
<field name="pending_qty"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
<field name="origin"/>
|
||||
<field name="date_planned"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_mrp_production_request_tree">
|
||||
<field name="name">mrp.production.request.tree</field>
|
||||
<field name="model">mrp.production.request</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree decoration-info="state in ('draft','to_approve')"
|
||||
decoration-muted="state in ('cancel')"
|
||||
string="Manufacturing Requests">
|
||||
<field name="name"/>
|
||||
<field name="product_id"/>
|
||||
<field name="requested_by"/>
|
||||
<field name="assigned_to"/>
|
||||
<field name="product_qty"/>
|
||||
<field name="pending_qty"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
<field name="origin"/>
|
||||
<field name="date_planned"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_mrp_production_request_search" model="ir.ui.view">
|
||||
<field name="name">mrp.production.request.search</field>
|
||||
<field name="model">mrp.production.request</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Manufacturing Request">
|
||||
<field name="name" string="Manufacturing Request"/>
|
||||
<field name="mrp_production_ids" string="Manufacturing Orders"/>
|
||||
<field name="requested_by"/>
|
||||
<field name="assigned_to" />
|
||||
<field name="origin"/>
|
||||
<field name="state"/>
|
||||
<field name="pending_qty" invisible="1"/>
|
||||
<!--Filters:-->
|
||||
<filter name="unassigned" string="Unassigned"
|
||||
domain="[('assigned_to','=', False)]"
|
||||
help="Unassigned Request"/>
|
||||
<filter domain="[('assigned_to','=', uid)]"
|
||||
string="Assigned to me"/>
|
||||
<filter domain="[('requested_by','=', uid)]"
|
||||
string="My requests" help="Requested by me"/>
|
||||
<separator/>
|
||||
<filter domain="[('pending_qty','!=', 0.0)]"
|
||||
string="Pending Qty" name="pending"
|
||||
help="Request with pending quantity"/>
|
||||
<separator/>
|
||||
<filter name="state_draft" string="Draft"
|
||||
domain="[('state','=','draft')]"
|
||||
help="Request is to be approved"/>
|
||||
<filter name="state_to_approve" string="To Approve"
|
||||
domain="[('state','=','to_approve')]"
|
||||
help="Request is to be approved"/>
|
||||
<filter name="state_approved" string="Approved"
|
||||
domain="[('state','=','approved')]"
|
||||
help="Request is approved"/>
|
||||
<filter name="state_cancel" string="Cancelled"
|
||||
domain="[('state','=','cancel')]"
|
||||
help="Request is cancelled"/>
|
||||
<filter name="state_done" string="Done"
|
||||
domain="[('state','=','done')]"
|
||||
help="Request is done"/>
|
||||
<filter string="Unread Messages"
|
||||
name="message_needaction"
|
||||
domain="[('message_needaction','=',True)]"/>
|
||||
<filter domain="[('requested_by','=', uid)]"
|
||||
help="My requests"/>
|
||||
<!--Group by:-->
|
||||
<filter string="Requested by" icon="terp-personal"
|
||||
domain="[]"
|
||||
context="{'group_by':'requested_by'}"/>
|
||||
<filter string="Assigned to" icon="terp-personal"
|
||||
domain="[]"
|
||||
context="{'group_by':'assigned_to'}"/>
|
||||
<filter string="Source" icon="terp-gtk-jump-to-rtl" domain="[]"
|
||||
context="{'group_by':'origin'}"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_mrp_production_request_search" model="ir.ui.view">
|
||||
<field name="name">mrp.production.request.search</field>
|
||||
<field name="model">mrp.production.request</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Manufacturing Request">
|
||||
<field name="name" string="Manufacturing Request"/>
|
||||
<field name="mrp_production_ids" string="Manufacturing Orders"/>
|
||||
<field name="requested_by"/>
|
||||
<field name="assigned_to" />
|
||||
<field name="origin"/>
|
||||
<field name="state"/>
|
||||
<field name="pending_qty" invisible="1"/>
|
||||
<!--Filters:-->
|
||||
<filter name="unassigned" string="Unassigned"
|
||||
domain="[('assigned_to','=', False)]"
|
||||
help="Unassigned Request"/>
|
||||
<filter domain="[('assigned_to','=', uid)]"
|
||||
string="Assigned to me"/>
|
||||
<filter domain="[('requested_by','=', uid)]"
|
||||
string="My requests" help="Requested by me"/>
|
||||
<separator/>
|
||||
<filter domain="[('pending_qty','!=', 0.0)]"
|
||||
string="Pending Qty" name="pending"
|
||||
help="Request with pending quantity"/>
|
||||
<separator/>
|
||||
<filter name="state_draft" string="Draft"
|
||||
domain="[('state','=','draft')]"
|
||||
help="Request is to be approved"/>
|
||||
<filter name="state_to_approve" string="To Approve"
|
||||
domain="[('state','=','to_approve')]"
|
||||
help="Request is to be approved"/>
|
||||
<filter name="state_approved" string="Approved"
|
||||
domain="[('state','=','approved')]"
|
||||
help="Request is approved"/>
|
||||
<filter name="state_cancel" string="Cancelled"
|
||||
domain="[('state','=','cancel')]"
|
||||
help="Request is cancelled"/>
|
||||
<filter name="state_done" string="Done"
|
||||
domain="[('state','=','done')]"
|
||||
help="Request is done"/>
|
||||
<filter string="Unread Messages"
|
||||
name="message_needaction"
|
||||
domain="[('message_needaction','=',True)]"/>
|
||||
<filter domain="[('requested_by','=', uid)]"
|
||||
help="My requests"/>
|
||||
<!--Group by:-->
|
||||
<filter string="Requested by" icon="terp-personal"
|
||||
domain="[]"
|
||||
context="{'group_by':'requested_by'}"/>
|
||||
<filter string="Assigned to" icon="terp-personal"
|
||||
domain="[]"
|
||||
context="{'group_by':'assigned_to'}"/>
|
||||
<filter string="Source" icon="terp-gtk-jump-to-rtl" domain="[]"
|
||||
context="{'group_by':'origin'}"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="mrp_production_request_action">
|
||||
<field name="name">Manufacturing Requests</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">mrp.production.request</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{"search_default_pending":1}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to start a new manufacturing request process.
|
||||
</p><p>
|
||||
A Manufacturing Request is an instruction to production to produce
|
||||
a certain quantity of a given product.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="mrp_production_request_action">
|
||||
<field name="name">Manufacturing Requests</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">mrp.production.request</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{"search_default_pending":1}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to start a new manufacturing request process.
|
||||
</p><p>
|
||||
A Manufacturing Request is an instruction to production to produce
|
||||
a certain quantity of a given product.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
id="menu_mrp_production_request_act"
|
||||
sequence="10"
|
||||
parent="mrp.menu_mrp_manufacturing"
|
||||
action="mrp_production_request_action"
|
||||
/>
|
||||
<menuitem
|
||||
id="menu_mrp_production_request_act"
|
||||
sequence="10"
|
||||
parent="mrp.menu_mrp_manufacturing"
|
||||
action="mrp_production_request_action"
|
||||
/>
|
||||
|
||||
<!--Sever actions-->
|
||||
<record id="action_server_mrp_production_request_refresh"
|
||||
model="ir.actions.server">
|
||||
<field name="name">Refresh Quantities</field>
|
||||
<field name="condition">True</field>
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_mrp_production_request" />
|
||||
<field name="state">code</field>
|
||||
<field name="code">self._compute_manufactured_qty(cr, uid, context.get('active_ids', []), context=context)</field>
|
||||
</record>
|
||||
<!--Sever actions-->
|
||||
<record id="action_server_mrp_production_request_refresh"
|
||||
model="ir.actions.server">
|
||||
<field name="name">Refresh Quantities</field>
|
||||
<field name="condition">True</field>
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_mrp_production_request" />
|
||||
<field name="state">code</field>
|
||||
<field name="code">self._compute_manufactured_qty(cr, uid, context.get('active_ids', []), context=context)</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.values" id="action_mrp_production_request_refresh">
|
||||
<field name="name">Compute Quantities</field>
|
||||
<field name="action_id"
|
||||
ref="action_server_mrp_production_request_refresh" />
|
||||
<field name="value" eval="'ir.actions.server,' + str(ref('action_server_mrp_production_request_refresh'))" />
|
||||
<field name="key">action</field>
|
||||
<field name="model_id" ref="model_mrp_production_request" />
|
||||
<field name="model">mrp.production.request</field>
|
||||
<field name="key2">client_action_multi</field>
|
||||
</record>
|
||||
<record model="ir.values" id="action_mrp_production_request_refresh">
|
||||
<field name="name">Compute Quantities</field>
|
||||
<field name="action_id"
|
||||
ref="action_server_mrp_production_request_refresh" />
|
||||
<field name="value" eval="'ir.actions.server,' + str(ref('action_server_mrp_production_request_refresh'))" />
|
||||
<field name="key">action</field>
|
||||
<field name="model_id" ref="model_mrp_production_request" />
|
||||
<field name="model">mrp.production.request</field>
|
||||
<field name="key2">client_action_multi</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0) -->
|
||||
<odoo>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="mrp_production_form_view" model="ir.ui.view">
|
||||
<field name="name">mrp.production.form - mrp_production_request</field>
|
||||
<field name="model">mrp.production</field>
|
||||
<field name="inherit_id"
|
||||
ref="mrp.mrp_production_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="move_prod_id" position="after">
|
||||
<field name="mrp_production_request_id"/>
|
||||
<record id="mrp_production_form_view" model="ir.ui.view">
|
||||
<field name="name">mrp.production.form - mrp_production_request</field>
|
||||
<field name="model">mrp.production</field>
|
||||
<field name="inherit_id"
|
||||
ref="mrp.mrp_production_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="move_prod_id" position="after">
|
||||
<field name="mrp_production_request_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0) -->
|
||||
<odoo>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record model="ir.ui.view" id="procurement_form_view">
|
||||
<field name="name">procurement.order.form - mrp_production_request</field>
|
||||
<field name="model">procurement.order</field>
|
||||
<field name="inherit_id" ref="procurement.procurement_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='origin']" position="after">
|
||||
<field name="mrp_production_request_id"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="procurement_form_view">
|
||||
<field name="name">procurement.order.form - mrp_production_request</field>
|
||||
<field name="model">procurement.order</field>
|
||||
<field name="inherit_id" ref="procurement.procurement_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='origin']" position="after">
|
||||
<field name="mrp_production_request_id"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0) -->
|
||||
<odoo>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record model="ir.ui.view" id="view_template_property_form">
|
||||
<field name="name">product.template.form - mrp_production_request</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id"
|
||||
ref="stock.view_template_property_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="route_ids" position="after">
|
||||
<field name="mrp_production_request"/>
|
||||
<record model="ir.ui.view" id="view_template_property_form">
|
||||
<field name="name">product.template.form - mrp_production_request</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id"
|
||||
ref="stock.view_template_property_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="route_ids" position="after">
|
||||
<field name="mrp_production_request"/>
|
||||
</field>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -1,59 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0) -->
|
||||
<odoo>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="mrp_production_request_create_mo_view" model="ir.ui.view">
|
||||
<field name="name">mrp.production.request.create.mo.form</field>
|
||||
<field name="model">mrp.production.request.create.mo</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Select event to register">
|
||||
<group name="origin" string="Manufacture Request status"
|
||||
col="6">
|
||||
<group colspan="2">
|
||||
<field name="mrp_production_request_id"
|
||||
options='{"no_open": True}'/>
|
||||
<field name="pending_qty"/>
|
||||
<button name="compute_product_line_ids" type="object"
|
||||
string="Compute lines" colspan="2" icon="fa-cogs"/>
|
||||
<record id="mrp_production_request_create_mo_view" model="ir.ui.view">
|
||||
<field name="name">mrp.production.request.create.mo.form</field>
|
||||
<field name="model">mrp.production.request.create.mo</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Select event to register">
|
||||
<group name="origin" string="Manufacture Request status"
|
||||
col="6">
|
||||
<group colspan="2">
|
||||
<field name="mrp_production_request_id"
|
||||
options='{"no_open": True}'/>
|
||||
<field name="pending_qty"/>
|
||||
<button name="compute_product_line_ids" type="object"
|
||||
string="Compute lines" colspan="2" icon="gtk-execute"/>
|
||||
</group>
|
||||
<group colspan="4">
|
||||
<field name="product_line_ids" nolabel="1">
|
||||
<tree>
|
||||
<field name="product_id"/>
|
||||
<field name="product_uom"/>
|
||||
<field name="product_qty"/>
|
||||
<field name="available_qty"/>
|
||||
<field name="bottle_neck_factor"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
</group>
|
||||
<group colspan="4">
|
||||
<field name="product_line_ids" nolabel="1">
|
||||
<tree>
|
||||
<field name="product_id"/>
|
||||
<field name="product_uom"/>
|
||||
<field name="product_qty"/>
|
||||
<field name="available_qty"/>
|
||||
<field name="bottle_neck_factor"/>
|
||||
</tree>
|
||||
</field>
|
||||
<group name="destination" string="Manufacturing Order:" col="4">
|
||||
<field name="mo_qty"/>
|
||||
<field name="product_uom" options="{'no_open': True}"
|
||||
groups="product.group_uom"/>
|
||||
</group>
|
||||
</group>
|
||||
<group name="destination" string="Manufacturing Order:" col="4">
|
||||
<field name="mo_qty"/>
|
||||
<field name="product_uom" options="{'no_open': True}"
|
||||
groups="product.group_uom"/>
|
||||
</group>
|
||||
|
||||
<footer>
|
||||
<button name="create_mo"
|
||||
type="object"
|
||||
string="Create MO"
|
||||
class="oe_highlight"/>
|
||||
or
|
||||
<button special="cancel"
|
||||
string="Cancel"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<footer>
|
||||
<button name="create_mo"
|
||||
type="object"
|
||||
string="Create MO"
|
||||
class="oe_highlight"/>
|
||||
or
|
||||
<button special="cancel"
|
||||
string="Cancel"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="mrp_production_request_create_mo_action" model="ir.actions.act_window">
|
||||
<field name="name">Create Manufacturing Order</field>
|
||||
<field name="res_model">mrp.production.request.create.mo</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
<record id="mrp_production_request_create_mo_action" model="ir.actions.act_window">
|
||||
<field name="name">Create Manufacturing Order</field>
|
||||
<field name="res_model">mrp.production.request.create.mo</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -3,3 +3,4 @@
|
||||
product-attribute
|
||||
account-analytic
|
||||
product-variant
|
||||
stock-logistics-warehouse
|
||||
|
||||
Reference in New Issue
Block a user