From 873d19a629655e857981b271d4fc8f99cf215f89 Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Fri, 18 Feb 2011 14:28:56 +0530 Subject: [PATCH 1/2] [FIX]: misleading terminology on workcenter lp bug: https://launchpad.net/bugs/720282 fixed bzr revid: ksa@tinyerp.co.in-20110218085856-0x2gqq3i8r2wb5t4 --- addons/mrp/__openerp__.py | 2 +- addons/mrp/i18n/mrp.pot | 12 ++++----- addons/mrp/mrp.py | 26 +++++++++---------- addons/mrp/mrp_view.xml | 1 - addons/mrp_operations/__openerp__.py | 2 +- addons/mrp_operations/i18n/mrp_operations.pot | 6 ++--- addons/mrp_operations/mrp_operations.py | 8 +++--- addons/mrp_operations/mrp_operations_view.xml | 14 +++++----- .../report/mrp_workorder_analysis.py | 6 ++--- .../report/mrp_workorder_analysis_view.xml | 2 +- 10 files changed, 39 insertions(+), 40 deletions(-) diff --git a/addons/mrp/__openerp__.py b/addons/mrp/__openerp__.py index b7a6466bbaf..3168d987fa9 100644 --- a/addons/mrp/__openerp__.py +++ b/addons/mrp/__openerp__.py @@ -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:: diff --git a/addons/mrp/i18n/mrp.pot b/addons/mrp/i18n/mrp.pot index 40d9196fc6a..fd00ec2ed6e 100644 --- a/addons/mrp/i18n/mrp.pot +++ b/addons/mrp/i18n/mrp.pot @@ -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 diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 3ba8d4bde47..926d54e8d76 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -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), } @@ -281,14 +281,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) diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 52a3dc6aca4..76dd1d2904b 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -9,7 +9,6 @@ - - + mrp.production.form.inherit mrp.production @@ -22,7 +22,7 @@ - + mrp.production.form.inherit2 mrp.production @@ -40,7 +40,7 @@ - + mrp.production.workcenter.line.tree mrp.production.workcenter.line @@ -151,9 +151,9 @@ - - - + + + @@ -228,7 +228,7 @@ - + Work Centers ir.actions.act_window diff --git a/addons/mrp_operations/report/mrp_workorder_analysis.py b/addons/mrp_operations/report/mrp_workorder_analysis.py index 47fb562e96a..e559f97fbed 100644 --- a/addons/mrp_operations/report/mrp_workorder_analysis.py +++ b/addons/mrp_operations/report/mrp_workorder_analysis.py @@ -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 )""") diff --git a/addons/mrp_operations/report/mrp_workorder_analysis_view.xml b/addons/mrp_operations/report/mrp_workorder_analysis_view.xml index 6052feb1936..d25ec5132f6 100644 --- a/addons/mrp_operations/report/mrp_workorder_analysis_view.xml +++ b/addons/mrp_operations/report/mrp_workorder_analysis_view.xml @@ -70,7 +70,7 @@ - + From 00ff5ceb5bec1edc8b4bd8f66a19a2e458814d6d Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Fri, 18 Feb 2011 15:23:57 +0530 Subject: [PATCH 2/2] [IMP]: Improve minor changes bzr revid: ksa@tinyerp.co.in-20110218095357-nz4emmmsxn1pwpgn --- addons/mrp/__openerp__.py | 2 +- addons/mrp/i18n/mrp.pot | 4 ++-- addons/mrp/mrp.py | 4 ++-- addons/mrp_operations/i18n/mrp_operations.pot | 2 +- addons/mrp_operations/mrp_operations.py | 22 +++++++++---------- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/addons/mrp/__openerp__.py b/addons/mrp/__openerp__.py index 3168d987fa9..4514c146a05 100644 --- a/addons/mrp/__openerp__.py +++ b/addons/mrp/__openerp__.py @@ -50,7 +50,7 @@ Reports provided by this module: * Bill of Material structure and components - * Load forecast on work Centers + * Load forecast on Work Centers * Print a production order * Stock forecasts Dashboard provided by this module:: diff --git a/addons/mrp/i18n/mrp.pot b/addons/mrp/i18n/mrp.pot index fd00ec2ed6e..25a8bea531d 100644 --- a/addons/mrp/i18n/mrp.pot +++ b/addons/mrp/i18n/mrp.pot @@ -1053,7 +1053,7 @@ msgid "\n" "\n" " Reports provided by this module:\n" " * Bill of Material structure and components\n" -" * Load forecast on work Centers\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 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." +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 diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 926d54e8d76..e457ebf6df7 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -109,10 +109,10 @@ class mrp_routing_workcenter(osv.osv): _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 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."), diff --git a/addons/mrp_operations/i18n/mrp_operations.pot b/addons/mrp_operations/i18n/mrp_operations.pot index dd464e3a843..80d543551c3 100644 --- a/addons/mrp_operations/i18n/mrp_operations.pot +++ b/addons/mrp_operations/i18n/mrp_operations.pot @@ -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 work center" +msgid "This is lead time between operation start and stop in this Work Center" msgstr "" #. module: mrp_operations diff --git a/addons/mrp_operations/mrp_operations.py b/addons/mrp_operations/mrp_operations.py index 313d8f7046f..3ae5bb75f0c 100644 --- a/addons/mrp_operations/mrp_operations.py +++ b/addons/mrp_operations/mrp_operations.py @@ -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 work center",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')], @@ -174,12 +174,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 @@ -233,17 +233,17 @@ 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: wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_start_working', cr) return super(mrp_production,self).action_in_production(cr, uid, ids) - + def action_cancel(self, cr, uid, ids): """ Cancels work order if production order is canceled. @return: Super method @@ -298,7 +298,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: @@ -326,7 +326,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: @@ -510,7 +510,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) @@ -537,7 +537,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)