[IMP,MOD] mrp_modules : Usability Improvements in MRP modules

bzr revid: vir@tinyerp.com-20100512140551-bx331bz90n0bh5qp
This commit is contained in:
Vir (Open ERP) 2010-05-12 19:35:51 +05:30
parent 1a7b8c64db
commit e8d8813c4f
8 changed files with 321 additions and 249 deletions

View File

@ -119,7 +119,7 @@ class mrp_bom(osv.osv):
"""
_name = 'mrp.bom'
_description = 'Bills of Material'
def _child_compute(self, cr, uid, ids, name, arg, context={}):
""" Gets child bom.
@param self: The object pointer
@ -154,13 +154,13 @@ class mrp_bom(osv.osv):
result[bom.id] += map(lambda x: x.id, bom2.bom_lines)
return result
def _compute_type(self, cr, uid, ids, field_name, arg, context):
""" Sets particular method for the selected bom type.
@param field_name: Name of the field
@param arg: User defined argument
@return: Dictionary of values
"""
"""
res = dict(map(lambda x: (x,''), ids))
for line in self.browse(cr, uid, ids):
if line.type == 'phantom' and not line.bom_id:
@ -174,10 +174,10 @@ class mrp_bom(osv.osv):
else:
res[line.id] = 'order'
return res
_columns = {
'name': fields.char('Name', size=64, required=True),
'code': fields.char('Code', size=16),
'code': fields.char('Reference', size=16),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the bills of material without removing it."),
'type': fields.selection([('normal','Normal BoM'),('phantom','Sets / Phantom')], 'BoM Type', required=True,
help= "If a sub-product is used in several products, it can be useful to create its own BoM."\
@ -212,7 +212,7 @@ class mrp_bom(osv.osv):
'product_rounding': lambda *a: 1.0,
'type': lambda *a: 'normal',
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.bom', context=c),
'multi_level_bom': lambda *a: 0,
'multi_level_bom': lambda *a: 0,
}
_order = "sequence"
_sql_constraints = [
@ -247,7 +247,7 @@ class mrp_bom(osv.osv):
v['name'] = prod.name
return {'value': v}
return {}
def _bom_find(self, cr, uid, product_id, product_uom, properties=[]):
""" Finds BoM for particular product and product uom.
@param product_id: Selected product.
@ -352,7 +352,7 @@ mrp_bom()
class mrp_bom_revision(osv.osv):
_name = 'mrp.bom.revision'
_description = 'Bill of material revisions'
_columns = {
'name': fields.char('Modification name', size=64, required=True),
'description': fields.text('Description'),
@ -399,7 +399,7 @@ class one2many_domain(fields.one2many):
def set(self, cr, obj, id, field, values, user=None, context=None):
if not values:
return
return super(one2many_domain, self).set(cr, obj, id, field, values,
return super(one2many_domain, self).set(cr, obj, id, field, values,
user=user, context=context)
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None):
@ -420,12 +420,12 @@ class mrp_production(osv.osv):
"""
_name = 'mrp.production'
_description = 'Production'
_date_name = 'date_planned'
_date_name = 'date_planned'
def _production_calc(self, cr, uid, ids, prop, unknow_none, context={}):
""" Calculates total hours and total no. of cycles for a production order.
@param prop: Name of field.
@param unknow_none:
@param unknow_none:
@return: Dictionary of values.
"""
result = {}
@ -442,7 +442,7 @@ class mrp_production(osv.osv):
def _production_date_end(self, cr, uid, ids, prop, unknow_none, context={}):
""" Finds production end date.
@param prop: Name of field.
@param unknow_none:
@param unknow_none:
@return: Dictionary of values.
"""
result = {}
@ -453,7 +453,7 @@ class mrp_production(osv.osv):
def _production_date(self, cr, uid, ids, prop, unknow_none, context={}):
""" Finds production planned date.
@param prop: Name of field.
@param unknow_none:
@param unknow_none:
@return: Dictionary of values.
"""
result = {}
@ -526,7 +526,7 @@ class mrp_production(osv.osv):
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.production', context=c),
}
_order = 'date_planned asc, priority desc';
def unlink(self, cr, uid, ids, context=None):
productions = self.read(cr, uid, ids, ['state'])
unlink_ids = []
@ -586,7 +586,7 @@ class mrp_production(osv.osv):
def action_picking_except(self, cr, uid, ids):
""" Changes the state to Exception.
@return: True
@return: True
"""
self.write(cr, uid, ids, {'state': 'picking_except'})
return True
@ -669,12 +669,12 @@ class mrp_production(osv.osv):
@return: True or False
"""
res = True
for production in self.browse(cr, uid, ids):
if production.move_lines:
for production in self.browse(cr, uid, ids):
if production.move_lines:
res = False
if production.move_created_ids:
res = False
if production.move_created_ids:
res = False
return res
def action_produce(self, cr, uid, production_id, production_qty, production_mode, context=None):
@ -686,15 +686,15 @@ class mrp_production(osv.osv):
@param production_qty: specify qty to produce
@param production_mode: specify production mode (consume/consume&produce).
@return: True
"""
"""
stock_mov_obj = self.pool.get('stock.move')
production = self.browse(cr, uid, production_id)
raw_product_todo = []
final_product_todo = []
final_product_todo = []
if production_mode in ['consume','consume_produce']:
# To consume remaining qty of raw materials
# To consume remaining qty of raw materials
consumed_products = {}
produced_qty = 0
for consumed_product in production.move_lines2:
@ -703,18 +703,18 @@ class mrp_production(osv.osv):
if not consumed_products.get(consumed_product.product_id.id, False):
consumed_products[consumed_product.product_id.id] = 0
consumed_products[consumed_product.product_id.id] += consumed_product.product_qty
for produced_product in production.move_created_ids2:
if produced_product.scraped:
continue
produced_qty += produced_product.product_qty
for raw_product in production.move_lines:
consumed_qty = consumed_products.get(raw_product.product_id.id, 0)
consumed_qty -= produced_qty
rest_qty = production_qty - consumed_qty
for raw_product in production.move_lines:
consumed_qty = consumed_products.get(raw_product.product_id.id, 0)
consumed_qty -= produced_qty
rest_qty = production_qty - consumed_qty
if rest_qty > production.product_qty:
rest_qty = production.product_qty
rest_qty = production.product_qty
if rest_qty > 0:
stock_mov_obj.action_consume(cr, uid, [raw_product.id], rest_qty, production.location_src_id.id, context=context)
@ -731,17 +731,17 @@ class mrp_production(osv.osv):
produced_products[produced_product.product_id.id] = 0
produced_products[produced_product.product_id.id] += produced_product.product_qty
for produce_product in production.move_created_ids:
produced_qty = produced_products.get(produce_product.product_id.id, 0)
for produce_product in production.move_created_ids:
produced_qty = produced_products.get(produce_product.product_id.id, 0)
rest_qty = production.product_qty - produced_qty
if rest_qty <= production_qty:
production_qty = rest_qty
production_qty = rest_qty
if rest_qty > 0 :
stock_mov_obj.action_consume(cr, uid, [produce_product.id], production_qty, production.location_dest_id.id, context=context)
for raw_product in production.move_lines2:
new_parent_ids = []
stock_mov_obj.action_consume(cr, uid, [produce_product.id], production_qty, production.location_dest_id.id, context=context)
for raw_product in production.move_lines2:
new_parent_ids = []
parent_move_ids = [x.id for x in raw_product.move_history_ids]
for final_product in production.move_created_ids2:
if final_product.id not in parent_move_ids:
@ -792,9 +792,9 @@ class mrp_production(osv.osv):
def action_in_production(self, cr, uid, ids):
""" Changes state to In Production and writes starting date.
@return: True
@return: True
"""
move_ids = []
move_ids = []
self.write(cr, uid, ids, {'state': 'in_production', 'date_start': time.strftime('%Y-%m-%d %H:%M:%S')})
return True
@ -936,7 +936,7 @@ class mrp_production_workcenter_line(osv.osv):
_name = 'mrp.production.workcenter.line'
_description = 'Work Orders'
_order = 'sequence'
_columns = {
'name': fields.char('Work Order', size=64, required=True),
'workcenter_id': fields.many2one('mrp.workcenter', 'Work Center', required=True),
@ -955,7 +955,7 @@ mrp_production_workcenter_line()
class mrp_production_product_line(osv.osv):
_name = 'mrp.production.product.line'
_description = 'Production scheduled products'
_columns = {
'name': fields.char('Name', size=64, required=True),
'product_id': fields.many2one('product.product', 'Product', required=True),

View File

@ -7,7 +7,7 @@
<menuitem id="menu_mrp_reordering" name="Automatic Procurements" parent="stock.menu_stock_root" sequence="4"/>
<menuitem id="menu_mrp_manufacturing" name="Manufacturing" parent="base.menu_mrp_root" sequence="1"/>
<menuitem name="Control" id="menu_mrp_control" parent="base.menu_mrp_root" sequence="3" />
<!-- <menuitem name="Control" id="menu_mrp_control" parent="base.menu_mrp_root" sequence="3" />-->
<menuitem name="Master Data"
id="menu_mrp_bom"
parent="base.menu_mrp_root"
@ -24,8 +24,10 @@
<field name="arch" type="xml">
<form string="Properties categories">
<separator colspan="4" string="General Information"/>
<field colspan="4" name="name" select="1"/>
<field colspan="4" name="description"/>
<separator colspan="4" string="Property Group"/>
<field colspan="4" name="name" select="1" nolabel="1"/>
<separator colspan="4" string="Description"/>
<field colspan="4" name="description" nolabel="1"/>
</form>
</field>
</record>
@ -122,7 +124,7 @@
<notebook colspan="4">
<page string="Work Center">
<field name="resource_type"/>
<field name="calendar_id"/>
<field name="calendar_id" widget="selection"/>
<separator colspan="4" string="Description"/>
<field colspan="4" name="note" nolabel="1"/>
<separator colspan="4" string="Capacity Information"/>
@ -245,21 +247,21 @@
<group colspan="4" col="6">
<field name="product_id" on_change="onchange_product_id(product_id, name)" select="1"/>
<field name="name" select="1"/>
<field name="code" select="1" groups="base.group_extended"/>
<field name="code" select="1" string="Reference" groups="base.group_extended"/>
<newline/>
<field name="product_uom"/>
<field name="product_uom" widget="selection"/>
<field name="product_qty"/>
<field name="routing_id" groups="base.group_extended"/>
<field name="routing_id" widget="selection" groups="base.group_extended"/>
<newline/>
<field name="product_uos" groups="product.group_uos"/>
<field name="product_uos_qty" groups="product.group_uos"/>
<field name="product_uos" groups="product.group_uos,base.group_extended" widget="selection"/>
<field name="product_uos_qty" groups="product.group_uos,base.group_extended" />
<newline/>
<field name="multi_level_bom" />
<field name="type" groups="base.group_extended"/>
<field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
</group>
<notebook colspan="4" >
<page string="General Information" attrs="{'invisible': [('bom_id','!=',False),('multi_level_bom','=',False)]}">
<page string="Components" attrs="{'invisible': [('bom_id','!=',False),('multi_level_bom','=',False)]}">
<field colspan="4" name="bom_lines" nolabel="1" widget="one2many_list" />
</page>
<page string="Revisions" groups="base.group_extended" attrs="{'invisible': [('bom_id','!=',False),('multi_level_bom','=',False)]}">
@ -274,7 +276,7 @@
<field name="date_start"/>
<field name="date_stop"/>
<field name="product_rounding"/>
<field name="product_efficiency"/>
<field name="product_efficiency" groups="base.group_extended"/>
<field colspan="4" name="property_ids" nolabel="2" groups="base.group_extended"/>
</page>
</notebook>
@ -282,6 +284,27 @@
</field>
</record>
<record id="view_mrp_bom_filter" model="ir.ui.view">
<field name="name">mrp.bom.select</field>
<field name="model">mrp.bom</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Bill Of Material">
<group col='4' colspan='4'>
<field name="name"/>
<field name="code" string="Reference"/>
<field name="product_id"/>
<field name="company_id"/>
</group>
<newline/>
<group expand="1" string="Group By" colspan="4" col="8">
<filter string="Product" icon="terp-mrp" domain="[]" context="{'group_by':'product_id'}"/>
<filter string="Routing" icon="terp-mrp" domain="[]" context="{'group_by':'routing_id'}"/>
</group>
</search>
</field>
</record>
<record id="mrp_bom_tree_view" model="ir.ui.view">
<field name="name">mrp.bom.tree</field>
<field name="model">mrp.bom</field>
@ -308,7 +331,7 @@
<field name="res_model">mrp.bom</field>
<field name="view_type">form</field>
<field name="domain">[('bom_id','=',False)]</field>
<field name="view_id" ref="mrp_bom_tree_view"/>
<field name="search_view_id" ref="view_mrp_bom_filter"/>
</record>
<record id="mrp_bom_form_action2" model="ir.actions.act_window">
<field name="name">Bill of Material Components</field>
@ -386,8 +409,8 @@
<menuitem action="mrp_procurement.mrp_procurement_action" id="menu_mrp_procurement_action"
parent="mrp.menu_mrp_manufacturing" sequence="2" />
<menuitem action="mrp_procurement.mrp_procurement_action5" id="menu_mrp_procurement_exception_action"
parent="mrp.menu_mrp_control" sequence="1" />
<!-- <menuitem action="mrp_procurement.mrp_procurement_action5" id="menu_mrp_procurement_exception_action"-->
<!-- parent="mrp.menu_mrp_control" sequence="1" />-->
<menuitem id="menu_mrp_scheduler" name="Schedulers" parent="base.menu_mrp_root" sequence="4"/>
<menuitem action="mrp_procurement.action_compute_schedulers" id="mrp_Sched_all" parent="mrp.menu_mrp_scheduler" sequence="90"/>
@ -406,7 +429,7 @@
<field name="model">mrp.production</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree colors="red:date_planned&lt;current_date and state not in ('done','cancel');black:date_planned&gt;=current_date and state in ('done','cancel') " string="Manufacturing Orders">
<tree colors="blue:state in ('confirmed');red:date_planned&lt;current_date and state not in ('done','cancel');black:date_planned&gt;=current_date;gray:state in ('done','cancel') " string="Manufacturing Orders">
<field name="name"/>
<field name="product_id"/>
<field name="product_qty" sum="Total Qty"/>
@ -477,25 +500,25 @@
<field name="product_id" on_change="product_id_change(product_id)" select="1"/>
<field name="product_qty"/>
<group colspan="2" col="3">
<field name="product_uom"/>
<field name="product_uom" widget="selection"/>
<button type="action"
name="%(mrp.action_change_production_qty)d"
string="Change Qty" states="ready,confirmed" />
</group>
<label string="" colspan="2"/>
<field name="product_uos_qty" groups="product.group_uos"/>
<group colspan="2" col="3" groups="product.group_uos">
<field name="product_uos"/>
<field name="product_uos_qty" groups="product.group_uos,base.group_extended"/>
<group colspan="2" col="3" groups="product.group_uos,base.group_extended">
<field name="product_uos" widget="selection"/>
<label string=""/>
</group>
</group>
<notebook colspan="4">
<page string="Consumed Products">
<field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]" on_change="bom_id_change(bom_id)"/>
<field name="routing_id" groups="base.group_extended" select="1"/>
<field name="location_src_id" domain="[('usage','=','internal')]" on_change="location_id_change(location_src_id,location_dest_id)"/>
<field name="location_dest_id" domain="[('usage','=','internal')]"/>
<field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]" on_change="bom_id_change(bom_id)" />
<field name="routing_id" groups="base.group_extended" select="1" widget="selection"/>
<field name="location_src_id" domain="[('usage','=','internal')]" widget="selection" on_change="location_id_change(location_src_id,location_dest_id)"/>
<field name="location_dest_id" domain="[('usage','=','internal')]" widget="selection"/>
<separator string="" colspan="4"/>
<field colspan="2" name="move_lines" nolabel="1" widget="one2many_list"
@ -636,7 +659,7 @@
<filter icon="terp-mrp" string="Draft"
domain="[('state','=','draft')]"
help="Non confirmed manufacturing orders"/>
<filter icon="terp-mrp" string="Current"
<filter icon="terp-mrp" string="Current" name="Current"
default="1"
domain="[('state','in',('confirmed','ready'))]"
help="Manufacturing Orders which are waiting for raw materials"/>
@ -676,6 +699,7 @@
<field name="view_mode">tree,form,calendar,graph,gantt</field>
<field name="view_id" eval="False"/>
<field name="search_view_id" ref="view_mrp_production_filter"/>
<field name="context">{'search_default_Current':1}</field>
</record>
<menuitem action="mrp_production_action" id="menu_mrp_production_action" parent="menu_mrp_manufacturing" sequence="1"/>
@ -778,8 +802,8 @@
<field name="product_id"/>
<field name="product_qty"/>
<field name="product_uom"/>
<field name="product_uos_qty" groups="product.group_uos"/>
<field name="product_uos" groups="product.group_uos"/>
<field name="product_uos_qty" groups="product.group_uos,base.group_extended"/>
<field name="product_uos" groups="product.group_uos,base.group_extended"/>
</tree>
</field>
</record>
@ -822,7 +846,7 @@
groups="base.group_extended"
sequence="2"/>
<menuitem action="resource.action_resource_resource_tree" id="menu_view_resource_search_mrp" parent="menu_pm_resources_mrp" sequence="1"/>
<menuitem action="resource.action_resource_calendar_form" id="menu_view_resource_calendar_search_mrp" parent="menu_pm_resources_mrp" sequence="1"/>
<menuitem action="resource.action_resource_calendar_form" id="menu_view_resource_calendar_search_mrp" parent="menu_mrp_configuration" sequence="1"/>
<menuitem action="resource.action_resource_calendar_leave_tree" id="menu_view_resource_calendar_leaves_search_mrp" parent="menu_pm_resources_mrp" sequence="1"/>
</data>

View File

@ -57,7 +57,7 @@
<field name="date_planned"/>
</group>
<newline/>
<group expand="1" string="Extended options..." colspan="10" col="12">
<group expand="1" string="Extended options..." colspan="10" col="12" groups="base.group_extended">
<filter icon="terp-mrp" string="Draft" domain="[('state','=','draft')]"/>
<filter icon="terp-mrp" string="Picking Exception" domain="[('state','=','picking_except')]"/>
<separator orientation="vertical"/>
@ -102,7 +102,7 @@
<field name="view_id" ref="view_report_mrp_production_order_tree"/>
<field name="search_view_id" ref="view_report_mrp_production_order_filter"/>
<field name="context">{'search_default_Product': 1}</field>
</record>
<record model="ir.actions.act_window.view" id="action_report_mrp_production_order_tree">

View File

@ -8,7 +8,7 @@
model="mrp.workcenter"
name="mrp.wc.barcode"
rml="mrp_operations/report/mrp_wc_barcode.rml"
header="False"/>
header="False" />
<report
id="report_code_barcode"

View File

@ -71,12 +71,12 @@
<separator string="Status" colspan="4"/>
<group colspan="8" col="8">
<field name="state"/>
<button name="button_draft" string="Set Draft" states="cancel"/>
<button name="button_start_working" string="Start" states="draft"/>
<button name="button_resume" string="Resume" states="pause"/>
<button name="button_cancel" string="Cancel" states="draft,startworking"/>
<button name="button_pause" string="Pause" states="startworking"/>
<button name="button_done" string="Finished" states="startworking"/>
<button name="button_draft" string="Set Draft" states="cancel" icon="gtk-convert"/>
<button name="button_start_working" string="Start" states="draft" icon="gtk-execute"/>
<button name="button_resume" string="Resume" states="pause" icon="gtk-media-pause"/>
<button name="button_cancel" string="Cancel" states="draft,startworking" icon="gtk-cancel"/>
<button name="button_pause" string="Pause" states="startworking" icon="gtk-execute"/>
<button name="button_done" string="Finished" states="startworking" icon="gtk-ok"/>
</group>
</page>
</notebook>
@ -84,6 +84,27 @@
</field>
</record>
<record id="view_mrp_production_workcenter_form_view_filter" model="ir.ui.view">
<field name="name">mrp.production.workcenter.line.select</field>
<field name="model">mrp.production.workcenter.line</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Work Orders">
<group col='6' colspan='4'>
<field name="name"/>
<field name="workcenter_id"/>
<field name="production_id"/>
</group>
<newline/>
<group expand="1" string="Group By" colspan="10" col="8">
<filter string="Product" icon="terp-mrp" domain="[]" context="{'group_by':'product'}"/>
<filter string="State" icon="terp-mrp" domain="[]" context="{'group_by':'state'}"/>
<filter string="Date" icon="terp-mrp" domain="[]" context="{'group_by':'date_planned'}"/>
</group>
</search>
</field>
</record>
<record id="workcenter_line_calendar" model="ir.ui.view">
<field name="name">mrp.production.workcenter.line.calendar</field>
<field name="model">mrp.production.workcenter.line</field>
@ -121,6 +142,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form,gantt,calendar,graph</field>
<field name="domain">[('id','=',active_id)]</field>
<field name="search_view_id" ref="view_mrp_production_workcenter_form_view_filter"/>
</record>
<!-- Action for All Operations -->

View File

@ -1,16 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<data>
<!--
Procurement
-->
<record id="mrp_procurement_tree_view" model="ir.ui.view">
<field name="name">mrp.procurement.tree</field>
<field name="model">mrp.procurement</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Procurement Lines" colors="red:state=='draft';black:state=='running';green:state=='confirmed';gray:state in ['done','cancel']">
<tree string="Procurement Lines" colors="red:date_planned&lt;current_date and state in ('exception');black:state=='running';green:state=='confirmed';gray:state in ['done','cancel'];blue:state in ('ready')">
<field name="date_planned" widget="date"/>
<field name="origin"/>
<field name="product_id"/>
@ -45,10 +45,10 @@
<field name="product_id" select="1" on_change="onchange_product_id(product_id)"/>
<field name="location_id" domain="[('usage','=','internal')]"/>
<field name="product_qty"/>
<field name="product_uom"/>
<field name="product_uom" widget="selection"/>
<field name="product_uos_qty" groups="product.group_uos"/>
<field name="product_uos" groups="product.group_uos"/>
<field name="product_uos_qty" groups="product.group_uos,base.group_extended"/>
<field name="product_uos" widget="selection" groups="product.group_uos,base.group_extended"/>
<separator colspan="4" string="Status"/>
<field colspan="4" name="message" readonly="1"/>
@ -85,7 +85,7 @@
<field name="arch" type="xml">
<search string="Search Procurement">
<group col='10' colspan='4'>
<filter icon="terp-mrp" string="Current" domain="[('state','in',('draft','confirmed'))]" default="1" help="Procurement Orders in draft or open state."/>
<filter icon="terp-mrp" string="Current" name="Current" domain="[('state','in',('draft','confirmed'))]" default="1" help="Procurement Orders in draft or open state."/>
<filter icon="terp-mrp" string="Exceptions" domain="[('state','=','exception')]" help="Procurement Orders with exceptions"/>
<filter icon="terp-mrp" string="Late"
domain="['&amp;', ('date_planned::date','&lt;', current_date), ('state', 'in', ('draft', 'confirmed'))]"
@ -102,6 +102,7 @@
<filter string="Product" icon="terp-mrp" domain="[]" context="{'group_by':'product_id'}"/>
<filter string="Reason" icon="terp-mrp" domain="[]" context="{'group_by':'name'}"/>
<filter string="Scheduled Date" icon="terp-mrp" domain="[]" context="{'group_by':'date_planned'}"/>
<filter string="State" icon="terp-mrp" domain="[]" context="{'group_by':'state'}"/>
</group>
</search>
</field>
@ -113,6 +114,7 @@
<field name="view_type">form</field>
<field name="view_id" eval="False"/>
<field name="search_view_id" ref="view_mrp_procurement_filter"/>
<field name="context">{'search_default_Current':1}</field>
</record>
<record id="mrp_procurement_action3" model="ir.actions.act_window">
@ -153,7 +155,7 @@
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','exception'), ('message', '=', '')]</field>
</record>
<!-- Order Point -->
<record id="view_warehouse_orderpoint_tree" model="ir.ui.view">
<field name="name">stock.warehouse.orderpoint.tree</field>
@ -246,6 +248,6 @@
name="Minimum Stock Rules"
res_model="stock.warehouse.orderpoint"
src_model="product.product"/>
</data>
</openerp>

View File

@ -2,174 +2,196 @@
<openerp>
<data>
<record id="view_repair_order_form" model="ir.ui.view">
<field name="name">mrp.repair.form</field>
<field name="model">mrp.repair</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Repairs order">
<group col="6" colspan="4">
<field name="name"/>
<field name="product_id" select="1" on_change="onchange_product_id(product_id)"/>
<field name="deliver_bool"/>
<newline/>
<field name="prodlot_id" on_change="onchange_lot_id(prodlot_id,product_id)"/>
<field name="move_id" on_change="onchange_move_id(product_id, move_id)"/>
<field name="repaired"/>
<newline/>
<field name="partner_id" on_change="onchange_partner_id(partner_id,address_id)"/>
<field name="address_id" attrs="{'readonly':[('deliver_bool','=', False)]}"/>
<field name="invoiced"/>
</group>
<notebook colspan="4">
<page string="Operations">
<field name="guarantee_limit" />
<newline/>
<field colspan="4" mode="tree,form" name="operations" nolabel="1" widget="one2many_list">
<form string="Operations">
<notebook>
<page string="Repair Line">
<field name="name" colspan="4"/>
<field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)" colspan="4"/>
<field name="product_uom_qty" string="Qty" />
<field name="product_uom" string="UoM"/>
<field name="price_unit"/>
<field name="price_subtotal"/>
<field name="location_id"/>
<field name="location_dest_id"/>
<newline/>
<field name="type" on_change="onchange_operation_type(type,parent.guarantee_limit)"/>
<group colspan="2">
<field name="to_invoice"/>
<field name="invoiced"/>
</group>
<newline/>
<field colspan="4" name="tax_id" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
<separator colspan="4" string="States"/>
<field name="state"/>
</page>
<page string="History" groups="base.group_extended">
<field colspan="4" name="move_id" />
<field colspan="4" name="invoice_line_id"/>
</page>
</notebook>
</form>
<tree string="Operations" editable="bottom">
<field name="type" on_change="onchange_operation_type(type,parent.guarantee_limit)"/>
<field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)"/>
<field name='name'/>
<field name="location_id"/>
<field name="location_dest_id"/>
<field name="product_uom_qty" string="Qty"/>
<field name="product_uom" string="UoM"/>
<field name="price_unit"/>
<field name="tax_id"/>
<field name="to_invoice"/>
<field name="price_subtotal"/>
</tree>
</field>
<newline/>
<group col="7" colspan="4">
<field name="amount_untaxed" sum="Untaxed amount"/>
<field name="amount_tax"/>
<field name="amount_total" sum="Total amount"/>
<button name="button_dummy" states="draft" string="Compute" type="object"/>
</group>
<newline/>
<group col="13" colspan="4">
<field name="state"/>
<button name="repair_confirm" states="draft" string="Confirm Repair"/>
<button name="repair_ready" states="confirmed" string="Start Repair"/>
<button name="action_repair_start" states="ready" string="Start Repair"/>
<button name="action_repair_end" states="under_repair" string="End Repair"/>
<button name="invoice_recreate" states="invoice_except" string="Recreate Invoice"/>
<button name="invoice_corrected" states="invoice_except" string="Invoice Corrected"/>
<button name="action_invoice_create" states="2binvoiced" string="Make Invoice"/>
<button name="%(action_cancel_repair)d" states="invoice_except" string="Cancel Repair" type="action"/>
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
<button name="cancel" states="draft" string="Cancel Repair"/>
<button name="%(action_cancel_repair)d" states="confirmed,2binvoiced,ready,under_repair" string="Cancel Repair" type="action"/>
</group>
</page>
<page string="Invoicing">
<field name="invoice_method" colspan="4"/>
<field
name="pricelist_id" context="product_id=product_id"
attrs="{'readonly':[('invoice_method','=', 'none')]}"/>
<field name="partner_invoice_id" attrs="{'readonly':[('invoice_method','=', 'none')]}"/>
<!-- <field name="invoice_id"/> -->
<field colspan="4" mode="tree,form" name="fees_lines" nolabel="1" widget="one2many_list">
<form string="Fees">
<notebook>
<page string="Fees Line">
<field name='name'/>
<field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id,parent.guarantee_limit)" colspan="4"/>
<field name="product_uom_qty" string="Qty"/>
<field name="product_uom" string="UoM" />
<field name="price_unit"/>
<field name="price_subtotal"/>
<newline/>
<group colspan="2">
<field name="to_invoice"/>
<field name="invoiced"/>
</group>
<newline/>
<field colspan="4" name="tax_id" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
</page>
<page string="History" groups="base.group_extended">
<field colspan="4" name="invoice_line_id" />
</page>
</notebook>
</form>
<tree string="Fees" editable="bottom">
<field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id,parent.guarantee_limit)"/>
<field name='name'/>
<field name="product_uom_qty" string="Qty"/>
<field name="product_uom" string="UoM"/>
<field name="price_unit"/>
<field name="to_invoice"/>
<field name="price_subtotal"/>
</tree>
</field>
</page>
<page string="Quality">
<separator colspan="4" string="Internal Notes"/>
<field colspan="4" name="internal_notes" nolabel="1"/>
<separator colspan="4" string="Quotation Notes"/>
<field colspan="4" name="quotation_notes" nolabel="1"/>
</page>
<page string="Extra Info" groups="base.group_extended">
<field name="invoice_id"/>
<field name="picking_id"/>
<field name="location_id"/>
<field name="location_dest_id" attrs="{'readonly':[('deliver_bool','=', False)], 'required':[('deliver_bool','=', True)]}"/>
</page>
</notebook>
</form>
</field>
</record>
<record id="view_repair_order_tree" model="ir.ui.view">
<record id="view_repair_order_tree" model="ir.ui.view">
<field name="name">mrp.repair.tree</field>
<field name="model">mrp.repair</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Repairs order">
<field name="name" select="1" />
<field name="product_id" select="1" />
<field name="prodlot_id"/>
<field name="partner_id"/>
<field name="address_id"/>
<field name="location_id"/>
<field name="state"/>
<field name="move_id"/>
<field name="location_dest_id"/>
<field name="guarantee_limit"/>
<field name="product_id" select="1" />
<field name="prodlot_id"/>
<field name="partner_id"/>
<field name="address_id"/>
<field name="location_id"/>
<field name="move_id"/>
<field name="location_dest_id"/>
<field name="guarantee_limit"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="view_repair_order_form" model="ir.ui.view">
<field name="name">mrp.repair.form</field>
<field name="model">mrp.repair</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Repairs order">
<group col="6" colspan="4">
<field name="name"/>
<field name="product_id" select="1" on_change="onchange_product_id(product_id)"/>
<field name="deliver_bool"/>
<newline/>
<field name="prodlot_id" on_change="onchange_lot_id(prodlot_id,product_id)"/>
<field name="move_id" on_change="onchange_move_id(product_id, move_id)"/>
<field name="repaired"/>
<newline/>
<field name="partner_id" on_change="onchange_partner_id(partner_id,address_id)"/>
<field name="address_id" attrs="{'readonly':[('deliver_bool','=', False)]}"/>
<field name="invoiced"/>
</group>
<notebook colspan="4">
<page string="Operations">
<field name="guarantee_limit" />
<newline/>
<field colspan="4" mode="tree,form" name="operations" nolabel="1" widget="one2many_list">
<form string="Operations">
<notebook>
<page string="Repair Line">
<field name="name" colspan="4"/>
<field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)" colspan="4"/>
<field name="product_uom_qty" string="Qty" />
<field name="product_uom" string="UoM"/>
<field name="price_unit"/>
<field name="price_subtotal"/>
<field name="location_id"/>
<field name="location_dest_id"/>
<newline/>
<field name="type" on_change="onchange_operation_type(type,parent.guarantee_limit)"/>
<group colspan="2">
<field name="to_invoice"/>
<field name="invoiced"/>
</group>
<newline/>
<field colspan="4" name="tax_id" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
<separator colspan="4" string="States"/>
<field name="state"/>
</page>
<page string="History" groups="base.group_extended">
<field colspan="4" name="move_id" />
<field colspan="4" name="invoice_line_id"/>
</page>
</notebook>
</form>
<tree string="Operations" editable="bottom">
<field name="type" on_change="onchange_operation_type(type,parent.guarantee_limit)"/>
<field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)"/>
<field name='name'/>
<field name="location_id"/>
<field name="location_dest_id"/>
<field name="product_uom_qty" string="Qty"/>
<field name="product_uom" string="UoM"/>
<field name="price_unit"/>
<field name="tax_id"/>
<field name="to_invoice"/>
<field name="price_subtotal"/>
</tree>
</field>
<newline/>
<group col="7" colspan="4">
<field name="amount_untaxed" sum="Untaxed amount"/>
<field name="amount_tax"/>
<field name="amount_total" sum="Total amount"/>
<button name="button_dummy" states="draft" string="Compute" type="object"/>
</group>
<newline/>
<group col="13" colspan="4">
<field name="state"/>
<button name="repair_confirm" states="draft" string="Confirm Repair" icon="gtk-apply"/>
<button name="repair_ready" states="confirmed" string="Start Repair" icon="gtk-execute"/>
<button name="action_repair_start" states="ready" string="Start Repair" icon="gtk-execute"/>
<button name="action_repair_end" states="under_repair" string="End Repair" icon="gtk-ok"/>
<button name="invoice_recreate" states="invoice_except" string="Recreate Invoice" icon="gtk-convert"/>
<button name="invoice_corrected" states="invoice_except" string="Invoice Corrected" icon="gtk-apply"/>
<button name="action_invoice_create" states="2binvoiced" string="Make Invoice" icon="gtk-ok"/>
<button name="%(action_cancel_repair)d" states="invoice_except" string="Cancel Repair" type="action" icon="gtk-cancel"/>
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="gtk-convert"/>
<button name="cancel" states="draft" string="Cancel Repair" icon="gtk-cancel"/>
<button name="%(action_cancel_repair)d" states="confirmed,2binvoiced,ready,under_repair" string="Cancel Repair" type="action" icon="gtk-cancel"/>
</group>
</page>
<page string="Invoicing">
<field name="invoice_method" colspan="4"/>
<field
name="pricelist_id" context="product_id=product_id"
attrs="{'readonly':[('invoice_method','=', 'none')]}"/>
<field name="partner_invoice_id" attrs="{'readonly':[('invoice_method','=', 'none')]}"/>
<!-- <field name="invoice_id"/> -->
<field colspan="4" mode="tree,form" name="fees_lines" nolabel="1" widget="one2many_list">
<form string="Fees">
<notebook>
<page string="Fees Line">
<field name='name'/>
<field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id,parent.guarantee_limit)" colspan="4"/>
<field name="product_uom_qty" string="Qty"/>
<field name="product_uom" string="UoM" />
<field name="price_unit"/>
<field name="price_subtotal"/>
<newline/>
<group colspan="2">
<field name="to_invoice"/>
<field name="invoiced"/>
</group>
<newline/>
<field colspan="4" name="tax_id" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
</page>
<page string="History" groups="base.group_extended">
<field colspan="4" name="invoice_line_id" />
</page>
</notebook>
</form>
<tree string="Fees" editable="bottom">
<field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id,parent.guarantee_limit)"/>
<field name='name'/>
<field name="product_uom_qty" string="Qty"/>
<field name="product_uom" string="UoM"/>
<field name="price_unit"/>
<field name="to_invoice"/>
<field name="price_subtotal"/>
</tree>
</field>
</page>
<page string="Quality">
<separator colspan="4" string="Internal Notes"/>
<field colspan="4" name="internal_notes" nolabel="1"/>
<separator colspan="4" string="Quotation Notes"/>
<field colspan="4" name="quotation_notes" nolabel="1"/>
</page>
<page string="Extra Info" groups="base.group_extended">
<field name="invoice_id"/>
<field name="picking_id"/>
<field name="location_id"/>
<field name="location_dest_id" attrs="{'readonly':[('deliver_bool','=', False)], 'required':[('deliver_bool','=', True)]}"/>
</page>
</notebook>
</form>
</field>
</record>
<record id="view_repair_order_form_filter" model="ir.ui.view">
<field name="name">mrp.repair.select</field>
<field name="model">mrp.repair</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Reair Orders">
<group col='4' colspan='4'>
<field name="name" />
<field name="product_id" />
</group>
<newline/>
<group expand="1" string="Group By" colspan="10" col="8">
<filter string="Product" icon="terp-mrp" domain="[]" context="{'group_by':'product_id'}"/>
<filter string="State" icon="terp-mrp" domain="[]" context="{'group_by':'state'}"/>
<filter string="Partner" icon="terp-mrp" domain="[]" context="{'group_by':'partner_id'}"/>
</group>
</search>
</field>
</record>
<record id="action_repair_order_form" model="ir.actions.act_window">
<field name="name">New Repair</field>
<field name="type">ir.actions.act_window</field>
@ -184,6 +206,7 @@
<field name="res_model">mrp.repair</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_repair_order_form_filter"/>
</record>
<record id="action_repair_quotation_tree" model="ir.actions.act_window">

View File

@ -59,6 +59,7 @@
<newline/>
<group expand="1" string="Group By..." colspan="4" col="20">
<filter string="Resouce" icon="terp-project" domain="[]" context="{'group_by':'resource_id'}"/>
<filter string="Company" icon="terp-project" domain="[]" context="{'group_by':'company_id'}"/>
</group>
</search>
</field>
@ -165,10 +166,10 @@
<field name="name" />
<field name="active"/>
<field name="company_id" widget="selection"/>
<field name="calendar_id" />
<field name="calendar_id" widget="selection"/>
<field name="resource_type" />
<field name="user_id" attrs="{'required':[('resource_type','=','user')]}"/>
<field name="time_efficiency" />
<field name="time_efficiency" groups="base.group_extended"/>
</form>
</field>
</record>
@ -182,7 +183,7 @@
<field name="company_id" />
<field name="resource_type" />
<field name="calendar_id" />
<field name="time_efficiency" />
<field name="time_efficiency" groups="base.group_extended"/>
<field name="user_id" />
</tree>
</field>
@ -205,7 +206,7 @@
<field name="calendar_id" />
<field name="date_from" />
<field name="date_to" />
<field name="resource_id" on_change="onchange_resource(resource_id)"/>
<field name="resource_id" widget="selection" on_change="onchange_resource(resource_id)"/>
</form>
</field>
</record>