[MERGE] lp:720282

bzr revid: qdp-launchpad@openerp.com-20110311151819-11hyz2byqmee3w22
This commit is contained in:
Quentin (OpenERP) 2011-03-11 16:18:19 +01:00
commit 6ec75017ed
10 changed files with 48 additions and 50 deletions

View File

@ -50,7 +50,7 @@
Reports provided by this module:
* Bill of Material structure and components
* Load forecast on workcenters
* Load forecast on Work Centers
* Print a production order
* Stock forecasts
Dashboard provided by this module::

View File

@ -534,7 +534,7 @@ msgstr ""
#. module: mrp
#: help:mrp.workcenter,costs_cycle:0
msgid "Specify Cost of Work center per cycle."
msgid "Specify Cost of Work Center per cycle."
msgstr ""
#. module: mrp
@ -751,7 +751,7 @@ msgstr ""
#. module: mrp
#: model:ir.model,name:mrp.model_mrp_routing_workcenter
msgid "Workcenter Usage"
msgid "Work Center Usage"
msgstr ""
#. module: mrp
@ -913,7 +913,7 @@ msgstr ""
#. module: mrp
#: help:mrp.workcenter,capacity_per_cycle:0
msgid "Number of operations this work center can do in parallel. If this work center represents a team of 5 workers, the capacity per cycle is 5."
msgid "Number of operations this Work Center can do in parallel. If this Work Center represents a team of 5 workers, the capacity per cycle is 5."
msgstr ""
#. module: mrp
@ -1053,7 +1053,7 @@ msgid "\n"
"\n"
" Reports provided by this module:\n"
" * Bill of Material structure and components\n"
" * Load forecast on workcenters\n"
" * Load forecast on Work Centers\n"
" * Print a production order\n"
" * Stock forecasts\n"
" Dashboard provided by this module::\n"
@ -2012,7 +2012,7 @@ msgstr ""
#. module: mrp
#: help:mrp.routing.workcenter,routing_id:0
msgid "Routing indicates all the workcenters used, for how long and/or cycles.If Routing is indicated then,the third tab of a production order (workcenters) will be automatically pre-completed."
msgid "Routing indicates all the Work Centers used, for how long and/or cycles.If Routing is indicated then,the third tab of a production order (Work Centers) will be automatically pre-completed."
msgstr ""
#. module: mrp
@ -2039,7 +2039,7 @@ msgstr ""
#. module: mrp
#: help:mrp.workcenter,note:0
msgid "Description of the work center. Explain here what's a cycle according to this work center."
msgid "Description of the Work Center. Explain here what's a cycle according to this Work Center."
msgstr ""
#. module: mrp

View File

@ -39,15 +39,15 @@ class mrp_workcenter(osv.osv):
_description = 'Work Center'
_inherits = {'resource.resource':"resource_id"}
_columns = {
'note': fields.text('Description', help="Description of the work center. Explain here what's a cycle according to this work center."),
'capacity_per_cycle': fields.float('Capacity per Cycle', help="Number of operations this work center can do in parallel. If this work center represents a team of 5 workers, the capacity per cycle is 5."),
'note': fields.text('Description', help="Description of the Work Center. Explain here what's a cycle according to this Work Center."),
'capacity_per_cycle': fields.float('Capacity per Cycle', help="Number of operations this Work Center can do in parallel. If this Work Center represents a team of 5 workers, the capacity per cycle is 5."),
'time_cycle': fields.float('Time for 1 cycle (hour)', help="Time in hours for doing one cycle."),
'time_start': fields.float('Time before prod.', help="Time in hours for the setup."),
'time_stop': fields.float('Time after prod.', help="Time in hours for the cleaning."),
'costs_hour': fields.float('Cost per hour', help="Specify Cost of Work center per hour."),
'costs_hour': fields.float('Cost per hour', help="Specify Cost of Work Center per hour."),
'costs_hour_account_id': fields.many2one('account.analytic.account', 'Hour Account', domain=[('type','<>','view')],
help="Complete this only if you want automatic analytic accounting entries on production orders."),
'costs_cycle': fields.float('Cost per cycle', help="Specify Cost of Work center per cycle."),
'costs_cycle': fields.float('Cost per cycle', help="Specify Cost of Work Center per cycle."),
'costs_cycle_account_id': fields.many2one('account.analytic.account', 'Cycle Account', domain=[('type','<>','view')],
help="Complete this only if you want automatic analytic accounting entries on production orders."),
'costs_journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal'),
@ -75,7 +75,7 @@ mrp_workcenter()
class mrp_routing(osv.osv):
"""
For specifying the routings of workcenters.
For specifying the routings of Work Centers.
"""
_name = 'mrp.routing'
_description = 'Routing'
@ -102,20 +102,20 @@ mrp_routing()
class mrp_routing_workcenter(osv.osv):
"""
Defines working cycles and hours of a workcenter using routings.
Defines working cycles and hours of a Work Center using routings.
"""
_name = 'mrp.routing.workcenter'
_description = 'Workcenter Usage'
_description = 'Work Center Usage'
_columns = {
'workcenter_id': fields.many2one('mrp.workcenter', 'Work Center', required=True),
'name': fields.char('Name', size=64, required=True),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of routing work centers."),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of routing Work Centers."),
'cycle_nbr': fields.float('Number of Cycles', required=True,
help="Number of iterations this work center has to do in the specified operation of the routing."),
'hour_nbr': fields.float('Number of Hours', required=True, help="Time in hours for this work center to achieve the operation of the specified routing."),
'hour_nbr': fields.float('Number of Hours', required=True, help="Time in hours for this Work Center to achieve the operation of the specified routing."),
'routing_id': fields.many2one('mrp.routing', 'Parent Routing', select=True, ondelete='cascade',
help="Routing indicates all the workcenters used, for how long and/or cycles." \
"If Routing is indicated then,the third tab of a production order (workcenters) will be automatically pre-completed."),
help="Routing indicates all the Work Centers used, for how long and/or cycles." \
"If Routing is indicated then,the third tab of a production order (Work Centers) will be automatically pre-completed."),
'note': fields.text('Description'),
'company_id': fields.related('routing_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
}
@ -299,14 +299,14 @@ class mrp_bom(osv.osv):
return result
def _bom_explode(self, cr, uid, bom, factor, properties=[], addthis=False, level=0):
""" Finds Products and Workcenters for related BoM for manufacturing order.
""" Finds Products and Work Centers for related BoM for manufacturing order.
@param bom: BoM of particular product.
@param factor: Factor of product UoM.
@param properties: A List of properties Ids.
@param addthis: If BoM found then True else False.
@param level: Depth level to find BoM lines starts from 10.
@return: result: List of dictionaries containing product details.
result2: List of dictionaries containing workcenter details.
result2: List of dictionaries containing Work Center details.
"""
factor = factor / (bom.product_efficiency or 1.0)
factor = rounding(factor, bom.product_rounding)

View File

@ -9,8 +9,6 @@
<menuitem id="menu_mrp_manufacturing" name="Manufacturing" parent="base.menu_mrp_root" sequence="1"/>
<menuitem name="Master Data"
id="menu_mrp_bom"
parent="base.menu_mrp_root"

View File

@ -35,7 +35,7 @@
Which is a view on "Work Centers" lines in production order,
editable tree
Add buttons in the form view of production order under workcenter tab:
Add buttons in the form view of production order under Work Center tab:
* start (set state to confirm), set date_start
* done (set state to done), set date_stop
* set to draft (set state to draft)

View File

@ -125,7 +125,7 @@ msgstr ""
#: view:mrp.production.workcenter.line:0
#: view:mrp.workorder:0
#: field:mrp.workorder,workcenter_id:0
msgid "Workcenter"
msgid "Work Center"
msgstr ""
#. module: mrp_operations
@ -413,7 +413,7 @@ msgid "\n"
" Which is a view on \"Work Centers\" lines in production order,\n"
" editable tree\n"
"\n"
" Add buttons in the form view of production order under workcenter tab:\n"
" Add buttons in the form view of production order under Work Center tab:\n"
" * start (set state to confirm), set date_start\n"
" * done (set state to done), set date_stop\n"
" * set to draft (set state to draft)\n"
@ -468,7 +468,7 @@ msgstr ""
#. module: mrp_operations
#: help:mrp.production.workcenter.line,delay:0
msgid "This is lead time between operation start and stop in this workcenter"
msgid "This is lead time between operation start and stop in this Work Center"
msgstr ""
#. module: mrp_operations

View File

@ -38,7 +38,7 @@ class stock_move(osv.osv):
_columns = {
'move_dest_id_lines': fields.one2many('stock.move','move_dest_id', 'Children Moves')
}
def copy(self, cr, uid, id, default=None, context=None):
if default is None:
default = {}
@ -46,7 +46,7 @@ class stock_move(osv.osv):
'move_dest_id_lines': [],
})
return super(stock_move, self).copy(cr, uid, id, default, context)
stock_move()
class mrp_production_workcenter_line(osv.osv):
@ -97,7 +97,7 @@ class mrp_production_workcenter_line(osv.osv):
'date_planned_end': fields.function(_get_date_end, method=True, string='End Date', type='datetime'),
'date_start': fields.datetime('Start Date'),
'date_finished': fields.datetime('End Date'),
'delay': fields.float('Working Hours',help="This is lead time between operation start and stop in this workcenter",readonly=True),
'delay': fields.float('Working Hours',help="This is lead time between operation start and stop in this Work Center",readonly=True),
'production_state':fields.related('production_id','state',
type='selection',
selection=[('draft','Draft'),('picking_except', 'Picking Exception'),('confirmed','Waiting Goods'),('ready','Ready to Produce'),('in_production','In Production'),('cancel','Canceled'),('done','Done')],
@ -107,7 +107,7 @@ class mrp_production_workcenter_line(osv.osv):
'qty':fields.related('production_id','product_qty',type='float',string='Qty',readonly=True, store=True),
'uom':fields.related('production_id','product_uom',type='many2one',relation='product.uom',string='UOM',readonly=True),
}
_defaults = {
'state': lambda *a: 'draft',
'delay': lambda *a: 0.0
@ -178,12 +178,12 @@ class mrp_production_workcenter_line(osv.osv):
delay = 0.0
date_now = time.strftime('%Y-%m-%d %H:%M:%S')
obj_line = self.browse(cr, uid, ids[0])
date_start = datetime.strptime(obj_line.date_start,'%Y-%m-%d %H:%M:%S')
date_finished = datetime.strptime(date_now,'%Y-%m-%d %H:%M:%S')
delay += (date_finished-date_start).days * 24
delay += (date_finished-date_start).seconds / float(60*60)
self.write(cr, uid, ids, {'state':'done', 'date_finished': date_now,'delay':delay})
self.modify_production_order_state(cr,uid,ids,'done')
return True
@ -237,11 +237,11 @@ class mrp_production(osv.osv):
for workcenter_line in obj.workcenter_lines:
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_done', cr)
return super(mrp_production,self).action_production_end(cr, uid, ids)
def action_in_production(self, cr, uid, ids):
""" Changes state to In Production and writes starting date.
@return: True
"""
@return: True
"""
obj = self.browse(cr, uid, ids)[0]
wf_service = netsvc.LocalService("workflow")
for workcenter_line in obj.workcenter_lines:
@ -304,7 +304,7 @@ class mrp_production(osv.osv):
def _move_pass(self, cr, uid, ids, context=None):
""" Calculates start date for stock moves finding interval from resource calendar.
@return: True
@return: True
"""
for po in self.browse(cr, uid, ids, context=context):
if po.allow_reorder:
@ -332,7 +332,7 @@ class mrp_production(osv.osv):
def _move_futur(self, cr, uid, ids, context=None):
""" Calculates start date for stock moves.
@return: True
@return: True
"""
for po in self.browse(cr, uid, ids, context=context):
if po.allow_reorder:
@ -516,7 +516,7 @@ class mrp_operations_operation(osv.osv):
if code.start_stop=='start':
self.pool.get('mrp.production.workcenter.line').action_start_working(cr,uid,wc_op_id)
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', wc_op_id[0], 'button_start_working', cr)
if code.start_stop=='done':
self.pool.get('mrp.production.workcenter.line').action_done(cr,uid,wc_op_id)
@ -543,7 +543,7 @@ class mrp_operations_operation(osv.osv):
if vals.get('date_start',False):
if code.start_stop == 'done':
line_vals['date_finished'] = vals['date_start']
elif code.start_stop == 'start':
elif code.start_stop == 'start':
line_vals['date_start'] = vals['date_start']
self.pool.get('mrp.production.workcenter.line').write(cr, uid, wc_op_id, line_vals, context=context)

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<openerp>
<data>
<record id="mrp_production_form_inherit_view" model="ir.ui.view">
<field name="name">mrp.production.form.inherit</field>
<field name="model">mrp.production</field>
@ -22,7 +22,7 @@
</xpath>
</field>
</record>
<record id="mrp_production_form_inherit_view2" model="ir.ui.view">
<field name="name">mrp.production.form.inherit2</field>
<field name="model">mrp.production</field>
@ -40,7 +40,7 @@
</xpath>
</field>
</record>
<record model="ir.ui.view" id="mrp_production_workcenter_tree_view_inherit">
<field name="name">mrp.production.workcenter.line.tree</field>
<field name="model">mrp.production.workcenter.line</field>
@ -151,9 +151,9 @@
</group>
<newline/>
<group expand="0" string="Group By..." colspan="10" col="8" groups="base.group_extended">
<filter string="Workcenter" icon="terp-go-home" domain="[]" context="{'group_by':'workcenter_id'}"/>
<filter string="Production" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'production_id'}"/>
<separator orientation="vertical"/>
<filter string="Work Center" icon="terp-go-home" domain="[]" context="{'group_by':'workcenter_id'}"/>
<filter string="Production" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'production_id'}"/>
<separator orientation="vertical"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_planned'}"/>
@ -228,7 +228,7 @@
</gantt>
</field>
</record>
<record model="ir.actions.act_window" id="mrp_production_wc_resource_planning">
<field name="name">Work Centers</field>
<field name="type">ir.actions.act_window</field>

View File

@ -40,9 +40,9 @@ class mrp_workorder(osv.osv):
'total_cycles': fields.float('Total Cycles', readonly=True),
'delay': fields.float('Delay', readonly=True),
'production_id': fields.many2one('mrp.production', 'Production', readonly=True),
'workcenter_id': fields.many2one('mrp.workcenter', 'Workcenter', readonly=True)
'workcenter_id': fields.many2one('mrp.workcenter', 'Work Center', readonly=True)
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'mrp_workorder')
cr.execute("""
@ -66,7 +66,7 @@ class mrp_workorder(osv.osv):
from mrp_production_workcenter_line wl
left join mrp_workcenter w on (w.id = wl.workcenter_id)
left join mrp_production mp on (mp.id = wl.production_id)
group by
group by
w.costs_hour, mp.product_id, mp.name, wl.state, wl.date_planned, wl.production_id, wl.workcenter_id
)""")

View File

@ -70,7 +70,7 @@
<newline/>
<group expand="1" string="Group By...">
<filter string="Product" name="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}" />
<filter string="Workcenter" name="Workcenter" icon="terp-go-home" context="{'group_by':'workcenter_id'}" />
<filter string="Work Center" name="Workcenter" icon="terp-go-home" context="{'group_by':'workcenter_id'}" />
<separator orientation="vertical"/>
<filter string="Production" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'production_id'}"/>
<separator orientation="vertical"/>