From dd2b1bed63e62bfcadfca8c1760d4ea9ab47afeb Mon Sep 17 00:00:00 2001 From: Niels Huylebroeck Date: Wed, 15 Sep 2010 13:58:12 +0200 Subject: [PATCH 01/18] [FIX] Removed all code and XML mentions of "finnished", as it's written "finished" (Bug #326160) bzr revid: niels@bubbles-it.be-20100915115812-j6lec74or0y61psp --- addons/mrp/mrp.py | 4 ++-- addons/mrp/mrp_view.xml | 4 ++-- addons/mrp/report/mrp_production_order.py | 6 +++--- addons/mrp/report/mrp_production_order_view.xml | 2 +- addons/mrp_operations/mrp_operations.py | 16 ++++++++-------- addons/mrp_operations/mrp_operations_view.xml | 4 ++-- addons/procurement/procurement.py | 6 +++--- addons/procurement/procurement_workflow.xml | 2 +- addons/sale/process/sale_process.xml | 2 +- addons/stock/stock.py | 2 +- addons/stock/stock_workflow.xml | 4 ++-- 11 files changed, 26 insertions(+), 26 deletions(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 8b616c3d7ac..eb5fd5d15e7 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -450,7 +450,7 @@ class mrp_production(osv.osv): 'date_planned_date': fields.function(_production_date, method=True, type='date', string='Scheduled Date'), 'date_planned': fields.datetime('Scheduled date', required=True, select=1), 'date_start': fields.datetime('Start Date'), - 'date_finnished': fields.datetime('End Date'), + 'date_finished': fields.datetime('End Date'), 'bom_id': fields.many2one('mrp.bom', 'Bill of Material', domain=[('bom_id','=',False)]), 'routing_id': fields.many2one('mrp.routing', string='Routing', on_delete='set null', help="The list of operations (list of workcenters) to produce the finished product. The routing is mainly used to compute workcenter costs during operations and to plan future loads on workcenters based on production plannification."), @@ -652,7 +652,7 @@ class mrp_production(osv.osv): """ for production in self.browse(cr, uid, ids): self._costs_generate(cr, uid, production) - return self.write(cr, uid, ids, {'state': 'done', 'date_finnished': time.strftime('%Y-%m-%d %H:%M:%S')}) + return self.write(cr, uid, ids, {'state': 'done', 'date_finished': time.strftime('%Y-%m-%d %H:%M:%S')}) def test_production_done(self, cr, uid, ids): """ Tests whether production is done or not. diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index ba7ebef1973..bd0a52159bf 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -530,7 +530,7 @@ mrp.production gantt - + @@ -696,7 +696,7 @@ - + diff --git a/addons/mrp/report/mrp_production_order.py b/addons/mrp/report/mrp_production_order.py index 9aeae1781cd..3ad4184c413 100644 --- a/addons/mrp/report/mrp_production_order.py +++ b/addons/mrp/report/mrp_production_order.py @@ -51,7 +51,7 @@ class mrp_production_order(osv.osv): 'date_planned':fields.date('Scheduled Date'), 'location_src_id': fields.many2one('stock.location', 'Raw Materials Location', readonly=True), 'date_start': fields.datetime('Start Date',readonly=True), - 'date_finnished': fields.datetime('End Date',readonly=True), + 'date_finished': fields.datetime('End Date',readonly=True), 'location_dest_id': fields.many2one('stock.location', 'Finished Products Location', readonly=True), 'company_id': fields.many2one('res.company','Company',readonly=True), 'bom_id': fields.many2one('mrp.bom', 'Bill of Material',readonly=True), @@ -100,7 +100,7 @@ class mrp_production_order(osv.osv): s.routing_id, s.picking_id, s.date_start, - s.date_finnished, + s.date_finished, to_date(to_char(s.date_planned, 'dd-MM-YYYY'),'dd-MM-YYYY') as date_planned, s.origin, s.priority, @@ -128,7 +128,7 @@ class mrp_production_order(osv.osv): to_date(to_char(s.date_planned, 'dd-MM-YYYY'),'dd-MM-YYYY'), s.origin, s.date_start, - s.date_finnished, + s.date_finished, s.company_id )""") mrp_production_order() diff --git a/addons/mrp/report/mrp_production_order_view.xml b/addons/mrp/report/mrp_production_order_view.xml index 7617c8f55e4..31a8b36a59d 100644 --- a/addons/mrp/report/mrp_production_order_view.xml +++ b/addons/mrp/report/mrp_production_order_view.xml @@ -97,7 +97,7 @@ - + diff --git a/addons/mrp_operations/mrp_operations.py b/addons/mrp_operations/mrp_operations.py index ab936e78daf..2d6ef47b81e 100644 --- a/addons/mrp_operations/mrp_operations.py +++ b/addons/mrp_operations/mrp_operations.py @@ -85,7 +85,7 @@ class mrp_production_workcenter_line(osv.osv): 'date_planned': fields.datetime('Scheduled Date'), 'date_planned_end': fields.function(_get_date_end, method=True, string='End Date', type='datetime'), 'date_start': fields.datetime('Start Date'), - 'date_finnished': fields.datetime('End 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), 'production_state':fields.related('production_id','state', type='selection', @@ -171,7 +171,7 @@ class mrp_production_workcenter_line(osv.osv): delay += (date_finished-date_start).days * 24 delay += (date_finished-date_start).seconds / float(60*60) - self.write(cr, uid, ids, {'state':'done', 'date_finnished': date_now,'delay':delay}) + self.write(cr, uid, ids, {'state':'done', 'date_finished': date_now,'delay':delay}) self.modify_production_order_state(cr,uid,ids,'done') return True @@ -280,7 +280,7 @@ class mrp_production(osv.osv): dt_end = DateTime.strptime(wc.date_planned_end, '%Y-%m-%d %H:%M:%S') old = wc.sequence or 0 super(mrp_production, self).write(cr, uid, [po.id], { - 'date_finnished': dt_end + 'date_finished': dt_end }) return dt_end @@ -298,7 +298,7 @@ class mrp_production(osv.osv): if l.state in ('done','cancel','draft'): continue todo += l.move_dest_id_lines - if l.production_id and (l.production_id.date_finnished > dt): + if l.production_id and (l.production_id.date_finished > dt): if l.production_id.state not in ('done','cancel'): for wc in l.production_id.workcenter_lines: i = self.pool.get('resource.calendar').interval_min_get( @@ -327,8 +327,8 @@ class mrp_production(osv.osv): break if l.production_id.state in ('done','cancel'): break - if l.production_id and (l.production_id.date_start < po.date_finnished): - self.write(cr, uid, [l.production_id.id], {'date_start': po.date_finnished}) + if l.production_id and (l.production_id.date_start < po.date_finished): + self.write(cr, uid, [l.production_id.id], {'date_start': po.date_finished}) break @@ -503,7 +503,7 @@ class mrp_operations_operation(osv.osv): if code.start_stop=='done': tmp=self.pool.get('mrp.production.workcenter.line').action_done(cr,uid,wc_op_id) wf_service.trg_validate(uid, 'mrp.production.workcenter.line', wc_op_id[0], 'button_done', cr) - self.pool.get('mrp.production').write(cr,uid,vals['production_id'],{'date_finnished':DateTime.now().strftime('%Y-%m-%d %H:%M:%S')}) + self.pool.get('mrp.production').write(cr,uid,vals['production_id'],{'date_finished':DateTime.now().strftime('%Y-%m-%d %H:%M:%S')}) if code.start_stop=='pause': tmp=self.pool.get('mrp.production.workcenter.line').action_pause(cr,uid,wc_op_id) @@ -524,7 +524,7 @@ class mrp_operations_operation(osv.osv): line_vals['delay'] = delay if vals.get('date_start',False): if code.start_stop == 'done': - line_vals['date_finnished'] = vals['date_start'] + line_vals['date_finished'] = vals['date_start'] elif code.start_stop == 'start': line_vals['date_start'] = vals['date_start'] diff --git a/addons/mrp_operations/mrp_operations_view.xml b/addons/mrp_operations/mrp_operations_view.xml index 4af63c52b77..37a02956ce0 100644 --- a/addons/mrp_operations/mrp_operations_view.xml +++ b/addons/mrp_operations/mrp_operations_view.xml @@ -101,7 +101,7 @@ - + @@ -170,7 +170,7 @@ mrp.production.workcenter.line calendar - + diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index 5c6caf1e9db..72dc73f025b 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -440,7 +440,7 @@ class procurement_order(osv.osv): wf_service.trg_trigger(uid, 'procurement.order', id, cr) return True - def action_check_finnished(self, cr, uid, ids): + def action_check_finished(self, cr, uid, ids): return self.check_move_done(cr, uid, ids) def action_check(self, cr, uid, ids): @@ -493,9 +493,9 @@ procurement_order() class StockPicking(osv.osv): _inherit = 'stock.picking' - def test_finnished(self, cursor, user, ids): + def test_finished(self, cursor, user, ids): wf_service = netsvc.LocalService("workflow") - res = super(StockPicking, self).test_finnished(cursor, user, ids) + res = super(StockPicking, self).test_finished(cursor, user, ids) for picking in self.browse(cursor, user, ids): for move in picking.move_lines: if move.state == 'done' and move.procurements: diff --git a/addons/procurement/procurement_workflow.xml b/addons/procurement/procurement_workflow.xml index ff4325e248f..b4bcd1e1f04 100644 --- a/addons/procurement/procurement_workflow.xml +++ b/addons/procurement/procurement_workflow.xml @@ -187,7 +187,7 @@ - action_check_finnished() + action_check_finished() stock.move [move_id.id] diff --git a/addons/sale/process/sale_process.xml b/addons/sale/process/sale_process.xml index b4a54d5afa5..55bb3d6a2c3 100644 --- a/addons/sale/process/sale_process.xml +++ b/addons/sale/process/sale_process.xml @@ -261,7 +261,7 @@ - + diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 5ecbd5f40ba..6e50587d014 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -786,7 +786,7 @@ class stock_picking(osv.osv): self.log_picking(cr, uid, ids, context=context) return True - def test_finnished(self, cr, uid, ids): + def test_finished(self, cr, uid, ids): """ Tests whether the move is in done or cancel state or not. @return: True or False """ diff --git a/addons/stock/stock_workflow.xml b/addons/stock/stock_workflow.xml index 3254f7b6984..2a682833a1c 100644 --- a/addons/stock/stock_workflow.xml +++ b/addons/stock/stock_workflow.xml @@ -86,12 +86,12 @@ - test_finnished() + test_finished() - not test_finnished() + not test_finished() From f69cf2457e527c9bf8bc270e4e16dd9d9d9bf5e7 Mon Sep 17 00:00:00 2001 From: "uco (Open ERP)" Date: Mon, 4 Oct 2010 12:40:36 +0530 Subject: [PATCH 02/18] [FIX] mrp_operations,mrp_repair, stock: Fixed errors. bzr revid: uco@tinyerp.com-20101004071036-3kah01azasv4k86o --- addons/mrp_operations/mrp_operations.py | 2 +- addons/mrp_repair/mrp_repair.py | 2 +- addons/stock/stock.py | 25 +++++++++++++------------ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/addons/mrp_operations/mrp_operations.py b/addons/mrp_operations/mrp_operations.py index 4ab3bf90956..36f4b18cddb 100644 --- a/addons/mrp_operations/mrp_operations.py +++ b/addons/mrp_operations/mrp_operations.py @@ -68,7 +68,7 @@ class mrp_production_workcenter_line(osv.osv): @return: Dictionary of values. """ ops = self.browse(cr, uid, ids, context=context) - date_and_hours_by_cal = [(op.date_planned, op.hour, op.workcenter_id.calendar_id.id) for op in ops] + date_and_hours_by_cal = [(op.production_id.date_planned, op.hour, op.workcenter_id.calendar_id.id) for op in ops] intervals = self.pool.get('resource.calendar').interval_get_multi(cr, uid, date_and_hours_by_cal) res = {} diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index af88c32f42a..4689295f53f 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -687,7 +687,7 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): if type == 'add': stock_id = self.pool.get('stock.location').search(cr, uid, [('name','=','Stock')])[0] to_invoice = False - if guarantee_limit and date.today() > datetime.strptime(guarantee_limit, '%Y-%m-%d'): + if guarantee_limit and datetime.today() > datetime.strptime(guarantee_limit, '%Y-%m-%d'): to_invoice=True return {'value': { 'to_invoice': to_invoice, diff --git a/addons/stock/stock.py b/addons/stock/stock.py index d73a842bedd..c57ce030bf1 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -128,18 +128,19 @@ class stock_location(osv.osv): c['location'] = loc_id for prod in product_product_obj.browse(cr, uid, product_ids, context=c): for f in field_names: - if f == 'stock_real': - result[loc_id][f] += prod.qty_available - elif f == 'stock_virtual': - result[loc_id][f] += prod.virtual_available - elif f == 'stock_real_value': - amount = prod.qty_available * prod.standard_price - amount = currency_obj.round(cr, uid, currency, amount) - result[loc_id][f] += amount - elif f == 'stock_virtual_value': - amount = prod.virtual_available * prod.standard_price - amount = currency_obj.round(cr, uid, currency, amount) - result[loc_id][f] += amount + if loc_id in result.keys(): + if f == 'stock_real': + result[loc_id][f] += prod.qty_available + elif f == 'stock_virtual': + result[loc_id][f] += prod.virtual_available + elif f == 'stock_real_value': + amount = prod.qty_available * prod.standard_price + amount = currency_obj.round(cr, uid, currency, amount) + result[loc_id][f] += amount + elif f == 'stock_virtual_value': + amount = prod.virtual_available * prod.standard_price + amount = currency_obj.round(cr, uid, currency, amount) + result[loc_id][f] += amount return result From f881f95bfe14d636766f9cad8e3940eaffcbcbe0 Mon Sep 17 00:00:00 2001 From: "uco (Open ERP)" Date: Mon, 4 Oct 2010 12:55:32 +0530 Subject: [PATCH 03/18] [FIX] point_of_sale: Typo error corrected. bzr revid: uco@tinyerp.com-20101004072532-33yw0bs97in3jsgq --- addons/point_of_sale/wizard/pos_return.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/wizard/pos_return.py b/addons/point_of_sale/wizard/pos_return.py index 4b975b820cb..6d926c8d408 100644 --- a/addons/point_of_sale/wizard/pos_return.py +++ b/addons/point_of_sale/wizard/pos_return.py @@ -123,7 +123,7 @@ class pos_return(osv.osv_memory):