From 7b852d44e3493a086e0451277a18377d67f258fb Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Mon, 6 Feb 2012 17:57:39 +0100 Subject: [PATCH 001/275] [IMP] stock: Give a new reference to the backorders, and keep the old reference for the partial picking done lp bug: https://launchpad.net/bugs/891664 fixed bzr revid: ls@numerigraphe.fr-20120206165739-d4ov9wz6fich0cr1 --- addons/stock/stock.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 9b4644c1161..4fb1c0ecafe 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1247,9 +1247,14 @@ class stock_picking(osv.osv): for move in too_few: product_qty = move_product_qty[move.id] if not new_picking: + new_picking_name = pick.name + self.write(cr, uid, [pick.id], + {'name': sequence_obj.get(cr, uid, + 'stock.picking.%s'%(pick.type)), + }) new_picking = self.copy(cr, uid, pick.id, { - 'name': sequence_obj.get(cr, uid, 'stock.picking.%s'%(pick.type)), + 'name': new_picking_name, 'move_lines' : [], 'state':'draft', }) From 4f01d6d6a48f3208f7bf91b83de65450ed6c9fa4 Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Tue, 7 Feb 2012 11:58:08 +0100 Subject: [PATCH 002/275] [IMP] Stock: reset traceability on backorder after partial move lp bug: https://launchpad.net/bugs/928191 fixed bzr revid: ls@numerigraphe.fr-20120207105808-xz7hrbjyyscj5fyg --- addons/stock/stock.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 9b4644c1161..df1e2380f0a 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1269,9 +1269,10 @@ class stock_picking(osv.osv): move_obj.copy(cr, uid, move.id, defaults) move_obj.write(cr, uid, [move.id], { - 'product_qty' : move.product_qty - partial_qty[move.id], + 'product_qty': move.product_qty - partial_qty[move.id], 'product_uos_qty': move.product_qty - partial_qty[move.id], #TODO: put correct uos_qty - + 'prodlot_id': False, + 'tracking_id': False, }) if new_picking: @@ -2573,8 +2574,10 @@ class stock_move(osv.osv): complete.append(self.browse(cr, uid, new_move)) self.write(cr, uid, [move.id], { - 'product_qty' : move.product_qty - product_qty, - 'product_uos_qty':move.product_qty - product_qty, + 'product_qty': move.product_qty - product_qty, + 'product_uos_qty': move.product_qty - product_qty, + 'prodlot_id': False, + 'tracking_id': False, }) From 292517875f81ba7fcf4d66b773a6f89271ac21be Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Fri, 10 Feb 2012 16:07:25 +0100 Subject: [PATCH 003/275] [FIX] don't add "[]" to tracking lot name lp bug: https://launchpad.net/bugs/930189 fixed bzr revid: ls@numerigraphe.fr-20120210150725-z65672axjekqsvdn --- addons/stock/stock.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 9b4644c1161..59b9f8883f1 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -504,9 +504,13 @@ class stock_tracking(osv.osv): return self.name_get(cr, user, ids, context) def name_get(self, cr, uid, ids, context=None): + """Append the serial to the name""" if not len(ids): return [] - res = [(r['id'], r['name']+' ['+(r['serial'] or '')+']') for r in self.read(cr, uid, ids, ['name', 'serial'], context)] + res = [ (r['id'], r['serial'] and '%s [%s]' % (r['name'], r['serial']) + or r['name'] ) + for r in self.read(cr, uid, ids, ['name', 'serial'], + context=context) ] return res def unlink(self, cr, uid, ids, context=None): From 9e346ccb118e8ed9575ec936f9f24260777a59b9 Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Wed, 22 Feb 2012 14:12:16 +0100 Subject: [PATCH 004/275] [IMP] procurement: consistent cording for MTS/MTO bzr revid: ls@numerigraphe.fr-20120222131216-z5mgm13ee5a3dmb3 --- addons/procurement/procurement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index 164314c4573..5804a2f002f 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -98,7 +98,7 @@ class procurement_order(osv.osv): 'move_id': fields.many2one('stock.move', 'Reservation', ondelete='set null'), 'close_move': fields.boolean('Close Move at end', required=True), 'location_id': fields.many2one('stock.location', 'Location', required=True, states={'draft':[('readonly',False)]}, readonly=True), - 'procure_method': fields.selection([('make_to_stock','from stock'),('make_to_order','on order')], 'Procurement Method', states={'draft':[('readonly',False)], 'confirmed':[('readonly',False)]}, + 'procure_method': fields.selection([('make_to_stock','Make to Stock'),('make_to_order','Make to Order')], 'Procurement Method', states={'draft':[('readonly',False)], 'confirmed':[('readonly',False)]}, readonly=True, required=True, help="If you encode manually a Procurement, you probably want to use" \ " a make to order method."), From 9ae977e92810f1c0cde09e925b5f256fbe993b59 Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Wed, 22 Feb 2012 14:18:49 +0100 Subject: [PATCH 005/275] [FIX] purchase: don't alter caller's context bzr revid: ls@numerigraphe.fr-20120222131849-42mv2m6mfdb41miw --- addons/purchase/purchase.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index a3135935045..9cb11ac420f 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -903,9 +903,10 @@ class procurement_order(osv.osv): purchase_date = self._get_purchase_order_date(cr, uid, procurement, company, schedule_date, context=context) #Passing partner_id to context for purchase order line integrity of Line name - context.update({'lang': partner.lang, 'partner_id': partner_id}) + new_context = context.copy() + new_context.update({'lang': partner.lang, 'partner_id': partner_id}) - product = prod_obj.browse(cr, uid, procurement.product_id.id, context=context) + product = prod_obj.browse(cr, uid, procurement.product_id.id, context=new_context) taxes_ids = procurement.product_id.product_tmpl_id.supplier_taxes_id taxes = acc_pos_obj.map_tax(cr, uid, partner.property_account_position, taxes_ids) @@ -933,7 +934,7 @@ class procurement_order(osv.osv): 'company_id': procurement.company_id.id, 'fiscal_position': partner.property_account_position and partner.property_account_position.id or False } - res[procurement.id] = self.create_procurement_purchase_order(cr, uid, procurement, po_vals, line_vals, context=context) + res[procurement.id] = self.create_procurement_purchase_order(cr, uid, procurement, po_vals, line_vals, context=new_context) self.write(cr, uid, [procurement.id], {'state': 'running', 'purchase_id': res[procurement.id]}) return res From 68015f9f9f385501b16181241c0bd6ff2ffe71aa Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Wed, 22 Feb 2012 15:26:09 +0100 Subject: [PATCH 006/275] [IMP] explicit help texts on stock move quantities lp bug: https://launchpad.net/bugs/904118 fixed bzr revid: ls@numerigraphe.fr-20120222142609-in23kx3atgeefig2 --- addons/stock/stock.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 885f7cd2077..5b8edce471d 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1572,10 +1572,28 @@ class stock_move(osv.osv): 'date_expected': fields.datetime('Scheduled Date', states={'done': [('readonly', True)]},required=True, select=True, help="Scheduled date for the processing of this move"), 'product_id': fields.many2one('product.product', 'Product', required=True, select=True, domain=[('type','<>','service')],states={'done': [('readonly', True)]}), - 'product_qty': fields.float('Quantity', digits_compute=dp.get_precision('Product UoM'), required=True,states={'done': [('readonly', True)]}), + 'product_qty': fields.float('Ordered quantity', + digits_compute=dp.get_precision('Product UoM'), required=True, + states={'done': [('readonly', True)]}, + help="This is the quantity of products from an inventory " + "point of view. For moves in the state 'done', this is the " + "quantity of products that were actually moved. For other " + "moves, this is the quantity of product that is planned to " + "be moved. Lowering this quantity does not generate a " + "backorder. Changing this quantity on assigned moves affects " + "the product reservation, and should be done with care."), 'product_uom': fields.many2one('product.uom', 'Unit of Measure', required=True,states={'done': [('readonly', True)]}), - 'product_uos_qty': fields.float('Quantity (UOS)', digits_compute=dp.get_precision('Product UoM'), states={'done': [('readonly', True)]}), - 'product_uos': fields.many2one('product.uom', 'Product UOS', states={'done': [('readonly', True)]}), + 'product_uos_qty': fields.float('Ordered quantity (UOS)', + digits_compute=dp.get_precision('Product UoM'), + states={'done': [('readonly', True)]}, + help="This is the quantity of products from a sales or invoicing " + "point of view. For moves in the state 'done', this is the " + "quantity of products that were actually moved. For other " + "moves, this is the quantity of product that is planned to " + "be moved. Lowering this quantity does not generate a " + "backorder. Changing this quantity on assigned moves affects " + "the product reservation, and should be done with care."), + 'product_uos': fields.many2one('product.uom', 'Unit of Sale', states={'done': [('readonly', True)]}), 'product_packaging': fields.many2one('product.packaging', 'Packaging', help="It specifies attributes of packaging like type, quantity of packaging,etc."), 'location_id': fields.many2one('stock.location', 'Source Location', required=True, select=True,states={'done': [('readonly', True)]}, help="Sets a location if you produce at a fixed location. This can be a partner location if you subcontract the manufacturing operations."), From 821fd5d7e455be27c5cec560f48bfde750995375 Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Fri, 24 Feb 2012 11:58:49 +0100 Subject: [PATCH 007/275] [IMP] stock: Make the name of backorder_id fields consistent (was wrong on moves) bzr revid: ls@numerigraphe.fr-20120224105849-uuq67bo447yasncr --- addons/stock/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 885f7cd2077..d1cdf48a35f 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1599,7 +1599,7 @@ class stock_move(osv.osv): 'price_currency_id': fields.many2one('res.currency', 'Currency for average price', help="Technical field used to record the currency chosen by the user during a picking confirmation (when average price costing method is used)"), 'company_id': fields.many2one('res.company', 'Company', required=True, select=True), 'partner_id': fields.related('picking_id','address_id','partner_id',type='many2one', relation="res.partner", string="Partner", store=True, select=True), - 'backorder_id': fields.related('picking_id','backorder_id',type='many2one', relation="stock.picking", string="Back Order", select=True), + 'backorder_id': fields.related('picking_id','backorder_id',type='many2one', relation="stock.picking", string="Back Order of", select=True), 'origin': fields.related('picking_id','origin',type='char', size=64, relation="stock.picking", string="Origin", store=True), # used for colors in tree views: From 96b5717bc056440f3e0fbe6173a56400851b0ada Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Mon, 27 Feb 2012 10:58:35 +0100 Subject: [PATCH 008/275] [FIX] check picking workflow when forcing a single move's availibility bzr revid: ls@numerigraphe.fr-20120227095835-91b9m1mjhnwivdih --- addons/stock/stock.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 885f7cd2077..151fbf2af5d 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1987,6 +1987,10 @@ class stock_move(osv.osv): @return: True """ self.write(cr, uid, ids, {'state': 'assigned'}) + wf_service = netsvc.LocalService('workflow') + for move in self.browse(cr, uid, ids, context): + if move.picking_id: + wf_service.trg_write(uid, 'stock.picking', move.picking_id.id, cr) return True def cancel_assign(self, cr, uid, ids, context=None): From 4b3c0dc716cefbabd66c00d524192338e1136a8d Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Mon, 27 Feb 2012 11:10:20 +0100 Subject: [PATCH 009/275] [REF] docstrings and comments bzr revid: ls@numerigraphe.fr-20120227101020-oxahk059rjeso09h --- addons/stock/stock.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 885f7cd2077..fdb732b9141 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -669,6 +669,7 @@ class stock_picking(osv.osv): ] def action_process(self, cr, uid, ids, context=None): + """Open the partial picking wizard""" if context is None: context = {} context = dict(context, active_ids=ids, active_model=self._name) partial_id = self.pool.get("stock.partial.picking").create(cr, uid, {}, context=context) @@ -844,14 +845,20 @@ class stock_picking(osv.osv): # TODO: change and create a move if not parents # def action_done(self, cr, uid, ids, context=None): - """ Changes picking state to done. + """Changes picking state to done. + + This method is called at the end of the workflow by the activity "done". @return: True """ self.write(cr, uid, ids, {'state': 'done', 'date_done': time.strftime('%Y-%m-%d %H:%M:%S')}) return True def action_move(self, cr, uid, ids, context=None): - """ Changes move state to assigned. + """Process the Stock Moves of the Picking + + This method is called by the workflow by the activity "move". + Normally that happens when the signal button_done is received (button + "Done" pressed on a Picking view). @return: True """ for pick in self.browse(cr, uid, ids, context=context): @@ -2367,6 +2374,7 @@ class stock_move(osv.osv): return res # action_split function is not used anywhere + # FIXME: deprecate this method def action_split(self, cr, uid, ids, quantity, split_by_qty=1, prefix=False, with_lot=True, context=None): """ Split Stock Move lines into production lot which specified split by quantity. @param cr: the database cursor From 6435b29dd5c893be16787432496fd642ac1b6cec Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Tue, 28 Feb 2012 16:05:27 +0100 Subject: [PATCH 010/275] [IMP] reset negative qty to 0.0 in onchanges in stock bzr revid: ls@numerigraphe.fr-20120228150527-8mwlpjvjcunni8ii --- addons/stock/stock.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 885f7cd2077..b552553bc42 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1764,6 +1764,7 @@ class stock_move(osv.osv): } if (not product_id) or (product_qty <=0.0): + result['product_qty'] = 0.0 return {'value': result} product_obj = self.pool.get('product.product') @@ -1790,6 +1791,7 @@ class stock_move(osv.osv): } if (not product_id) or (product_uos_qty <=0.0): + result['product_uos_qty'] = 0.0 return {'value': result} product_obj = self.pool.get('product.product') From 03d0c84871b5925a4bf0fc8b49279efa03a3b461 Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Tue, 28 Feb 2012 17:04:00 +0100 Subject: [PATCH 011/275] [IMP] docstring for picking.explode() bzr revid: ls@numerigraphe.fr-20120228160400-abndfkp5t157o32d --- addons/stock/stock.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index fdb732b9141..2cb5bbb1a5e 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -711,6 +711,7 @@ class stock_picking(osv.osv): return {} def action_explode(self, cr, uid, moves, context=None): + """Hook to allow other modules to split the moves of a picking.""" return moves def action_confirm(self, cr, uid, ids, context=None): From 9696b43f6c92fb58a5c43bc455088b3ddeb4b8e5 Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Wed, 29 Feb 2012 12:08:20 +0100 Subject: [PATCH 012/275] [IMP] Warn if the quantity is decreased in the stock moves bzr revid: ls@numerigraphe.fr-20120229110820-7ods08ps2rm0j03o --- addons/stock/stock.py | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 5b8edce471d..2470ec362d7 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1780,19 +1780,30 @@ class stock_move(osv.osv): result = { 'product_uos_qty': 0.00 } + warning = {} if (not product_id) or (product_qty <=0.0): return {'value': result} product_obj = self.pool.get('product.product') uos_coeff = product_obj.read(cr, uid, product_id, ['uos_coeff']) + + # Warn if the quantity was decreased + for move in self.read(cr, uid, ids, ['product_qty']): + if product_qty < move['product_qty']: + warning.update({ + 'title': _('Warning: No Back Order'), + 'message': _("By changing the quantity here, you accept the " + "new quantity as complete: OpenERP will not " + "automatically generate a Back Order.") }) + break if product_uos and product_uom and (product_uom != product_uos): result['product_uos_qty'] = product_qty * uos_coeff['uos_coeff'] else: result['product_uos_qty'] = product_qty - return {'value': result} + return {'value': result, 'warning': warning} def onchange_uos_quantity(self, cr, uid, ids, product_id, product_uos_qty, product_uos, product_uom): @@ -1806,19 +1817,29 @@ class stock_move(osv.osv): result = { 'product_qty': 0.00 } + warning = {} if (not product_id) or (product_uos_qty <=0.0): return {'value': result} product_obj = self.pool.get('product.product') uos_coeff = product_obj.read(cr, uid, product_id, ['uos_coeff']) + + # Warn if the quantity was decreased + for move in self.read(cr, uid, ids, ['product_uos_qty']): + if product_uos_qty < move['product_uos_qty']: + warning.update({ + 'title': _('Warning: No Back Order'), + 'message': _("By changing the quantity here, you accept the " + "new quantity as complete: OpenERP will not " + "automatically generate a Back Order.") }) + break if product_uos and product_uom and (product_uom != product_uos): result['product_qty'] = product_uos_qty / uos_coeff['uos_coeff'] else: result['product_qty'] = product_uos_qty - - return {'value': result} + return {'value': result, 'warning': warning} def onchange_product_id(self, cr, uid, ids, prod_id=False, loc_id=False, loc_dest_id=False, address_id=False): From 42742a440d5425c5da7945688de668787c78f902 Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Thu, 8 Mar 2012 09:31:39 +0100 Subject: [PATCH 013/275] [REF] clearer variable names bzr revid: ls@numerigraphe.fr-20120308083139-hv80tnovazjrps14 --- addons/procurement/procurement.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index 164314c4573..7dca3a8a9e4 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -409,23 +409,24 @@ class procurement_order(osv.osv): return 0 def action_cancel(self, cr, uid, ids): - """ Cancels procurement and writes move state to Assigned. + """Cancel Procurements and either cancel or assign the related Stock Moves, depending on the procurement configuration. + @return: True """ - todo = [] - todo2 = [] + to_assign = [] + to_cancel = [] move_obj = self.pool.get('stock.move') for proc in self.browse(cr, uid, ids): if proc.close_move and proc.move_id: if proc.move_id.state not in ('done', 'cancel'): - todo2.append(proc.move_id.id) + to_cancel.append(proc.move_id.id) else: if proc.move_id and proc.move_id.state == 'waiting': - todo.append(proc.move_id.id) - if len(todo2): - move_obj.action_cancel(cr, uid, todo2) - if len(todo): - move_obj.write(cr, uid, todo, {'state': 'assigned'}) + to_assign.append(proc.move_id.id) + if len(to_cancel): + move_obj.action_cancel(cr, uid, to_cancel) + if len(to_assign): + move_obj.write(cr, uid, to_assign, {'state': 'assigned'}) self.write(cr, uid, ids, {'state': 'cancel'}) wf_service = netsvc.LocalService("workflow") for id in ids: From 65dbf53f5505fb18321d3412b19b15eb41008c52 Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Thu, 8 Mar 2012 09:58:29 +0100 Subject: [PATCH 014/275] [REF] Add an XXX comment about context bzr revid: ls@numerigraphe.fr-20120308085829-7r1pjipa986xsyz6 --- addons/procurement/procurement.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index 7dca3a8a9e4..83437cc3657 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -408,6 +408,7 @@ class procurement_order(osv.osv): """ return 0 + # XXX action_cancel() should accept a context argument def action_cancel(self, cr, uid, ids): """Cancel Procurements and either cancel or assign the related Stock Moves, depending on the procurement configuration. From d930f23ece879bca7480caee2ec6fb372c2bf48b Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Mon, 12 Mar 2012 15:34:29 +0530 Subject: [PATCH 015/275] [FIX] sale : 6.1RC1 report Sales Analysis bug lp bug: https://launchpad.net/bugs/938866 fixed bzr revid: mdi@tinyerp.com-20120312100429-a718zljp31bs7tv3 --- addons/sale/report/sale_report.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py index 42e090d54e5..23ce41f7d58 100644 --- a/addons/sale/report/sale_report.py +++ b/addons/sale/report/sale_report.py @@ -97,6 +97,7 @@ class sale_report(osv.osv): left join product_template t on (p.product_tmpl_id=t.id) left join product_uom u on (u.id=l.product_uom) left join product_uom u2 on (u2.id=t.uom_id) + where l.product_id is not null group by l.product_id, l.product_uom_qty, From 799c70694c40100919f98c2c4bdaec6455e3d537 Mon Sep 17 00:00:00 2001 From: ana <> Date: Tue, 20 Mar 2012 12:14:57 +0530 Subject: [PATCH 016/275] [FIX] account_asset : Assets Date should be taken form invoice date rather than current date lp bug: https://launchpad.net/bugs/935564 fixed bzr revid: amp@tinyerp.com-20120320064457-o6zc3khmkrh0q4bh --- addons/account_asset/account_asset_invoice.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account_asset/account_asset_invoice.py b/addons/account_asset/account_asset_invoice.py index 700832881c4..4b38834bdc3 100644 --- a/addons/account_asset/account_asset_invoice.py +++ b/addons/account_asset/account_asset_invoice.py @@ -57,6 +57,7 @@ class account_invoice_line(osv.osv): 'partner_id': line.invoice_id.partner_id.id, 'company_id': line.invoice_id.company_id.id, 'currency_id': line.invoice_id.currency_id.id, + 'purchase_date' : line.invoice_id.date_invoice, } changed_vals = asset_obj.onchange_category_id(cr, uid, [], vals['category_id'], context=context) vals.update(changed_vals['value']) From c2e3dca73fcee2215c5f58d4c5d135b3d86b44c2 Mon Sep 17 00:00:00 2001 From: "Dmitrijs Ledkovs (credativ)" Date: Wed, 21 Mar 2012 10:47:40 +0000 Subject: [PATCH 017/275] [FIX] corrected unreconciled domain on Paybles & Receivables window action lp bug: https://launchpad.net/bugs/961051 fixed bzr revid: dmitrijs.ledkovs@credativ.co.uk-20120321104740-6x0ehabi3pbz2i5j --- addons/account/account_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 3d782c2b4c4..8e123bb5c33 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -2042,7 +2042,7 @@ src_model="account.journal"/> Date: Wed, 21 Mar 2012 16:59:28 +0530 Subject: [PATCH 018/275] [FIX] stock : Need to improve stock partial pciking object with _rec_name lp bug: https://launchpad.net/bugs/960982 fixed bzr revid: amp@tinyerp.com-20120321112928-gbc4skdkeuy4oo53 --- addons/stock/wizard/stock_partial_picking.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/stock/wizard/stock_partial_picking.py b/addons/stock/wizard/stock_partial_picking.py index 6f815413497..5ff2f862398 100644 --- a/addons/stock/wizard/stock_partial_picking.py +++ b/addons/stock/wizard/stock_partial_picking.py @@ -57,6 +57,7 @@ class stock_partial_picking_line(osv.TransientModel): class stock_partial_picking(osv.osv_memory): _name = "stock.partial.picking" + _rec_name = 'picking_id' _description = "Partial Picking Processing Wizard" def _hide_tracking(self, cursor, user, ids, name, arg, context=None): From 4bcd1573367234dc1cca003bae3ad03cd3bafb34 Mon Sep 17 00:00:00 2001 From: "Amit Bhavsar (Open ERP)" Date: Thu, 22 Mar 2012 16:04:34 +0530 Subject: [PATCH 019/275] [FIX] purchase : Fixes the context argument problem lp bug: https://launchpad.net/bugs/960308 fixed bzr revid: amb@tinyerp.com-20120322103434-v0l6247f3z54qo2d --- addons/purchase/purchase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 3d909c1085e..80955d0b9e4 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -773,7 +773,7 @@ class purchase_order_line(osv.osv): # - determine product_qty and date_planned based on seller info if not date_order: - date_order = fields.date.context_today(cr,uid,context=context) + date_order = fields.date.context_today(self,cr,uid,context=context) qty = qty or 1.0 supplierinfo = False From 8c23e9f488fa3133c97164fe295ebf3b5204556a Mon Sep 17 00:00:00 2001 From: jir Date: Fri, 23 Mar 2012 16:19:55 +0530 Subject: [PATCH 020/275] [FIX] base_calender : Fixes the infinite created meeting problem lp bug: https://launchpad.net/bugs/961094 fixed bzr revid: jir@jir-desktop-20120323104955-bmnp2j4b9xiuf70w --- addons/base_calendar/base_calendar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index 1545c6c920c..e475a793610 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -1002,8 +1002,8 @@ class calendar_event(osv.osv): event = datas['id'] if datas.get('interval', 0) < 0: raise osv.except_osv(_('Warning!'), _('Interval cannot be negative')) - if datas.get('count', 0) < 0: - raise osv.except_osv(_('Warning!'), _('Count cannot be negative')) + if datas.get('count', 0) <= 0: + raise osv.except_osv(_('Warning!'), _('Count cannot be negative or 0')) if datas['recurrency']: result[event] = self.compute_rule_string(datas) else: From d9b5884bff4c98ab73e23ca079eb081fdb42eb25 Mon Sep 17 00:00:00 2001 From: "Amit Bhavsar (Open ERP)" Date: Tue, 27 Mar 2012 16:49:14 +0530 Subject: [PATCH 021/275] [FIX] stock : Fixes the sorce location problem lp bug: https://launchpad.net/bugs/963750 fixed bzr revid: amb@tinyerp.com-20120327111914-mns594vtmtcr1fu7 --- addons/stock/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index d26ca8f0da3..0e9fcfb3f50 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2355,7 +2355,7 @@ class stock_move(osv.osv): 'prodlot_id': move.prodlot_id.id, } if move.location_id.usage <> 'internal': - default_val.update({'location_id': move.location_dest_id.id}) + default_val.update({'location_id': move.location_id.id}) new_move = self.copy(cr, uid, move.id, default_val) res += [new_move] From 0ef89eb059c246d23c41a4fadb3e8f4c789065b0 Mon Sep 17 00:00:00 2001 From: "marta(pexego)" <> Date: Wed, 28 Mar 2012 09:46:34 +0530 Subject: [PATCH 022/275] [FIX] account : Improved the description size for spanish localization taxes lp bug: https://launchpad.net/bugs/929688 fixed bzr revid: amp@tinyerp.com-20120328041634-04rk39u8fp27r7ry --- addons/account/account.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index c165a7f3b42..0c371bd8211 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1889,7 +1889,7 @@ class account_tax(osv.osv): 'ref_tax_sign': fields.float('Tax Code Sign', help="Usually 1 or -1."), 'include_base_amount': fields.boolean('Included in base amount', help="Indicates if the amount of tax must be included in the base amount for the computation of the next taxes"), 'company_id': fields.many2one('res.company', 'Company', required=True), - 'description': fields.char('Tax Code',size=32), + 'description': fields.char('Tax Code',size=128), 'price_include': fields.boolean('Tax Included in Price', help="Check this if the price you use on the product and invoices includes this tax."), 'type_tax_use': fields.selection([('sale','Sale'),('purchase','Purchase'),('all','All')], 'Tax Application', required=True) @@ -2785,7 +2785,7 @@ class account_tax_template(osv.osv): 'ref_base_sign': fields.float('Base Code Sign', help="Usually 1 or -1."), 'ref_tax_sign': fields.float('Tax Code Sign', help="Usually 1 or -1."), 'include_base_amount': fields.boolean('Include in Base Amount', help="Set if the amount of tax must be included in the base amount before computing the next taxes."), - 'description': fields.char('Internal Name', size=32), + 'description': fields.char('Internal Name', size=128), 'type_tax_use': fields.selection([('sale','Sale'),('purchase','Purchase'),('all','All')], 'Tax Use In', required=True,), 'price_include': fields.boolean('Tax Included in Price', help="Check this if the price you use on the product and invoices includes this tax."), } From 908ac62ab6b9399490c168d12715dfdf9604fa53 Mon Sep 17 00:00:00 2001 From: "Amit (OpenERP)" Date: Wed, 28 Mar 2012 11:19:45 +0530 Subject: [PATCH 023/275] [FIX] account : Fixes the translation problem lp bug: https://launchpad.net/bugs/943980 fixed bzr revid: amp@tinyerp.com-20120328054945-klkxmxsf3b12iuv8 --- addons/account/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index c165a7f3b42..6e17ca30275 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -678,7 +678,7 @@ class account_journal_view(osv.osv): _name = "account.journal.view" _description = "Journal View" _columns = { - 'name': fields.char('Journal View', size=64, required=True), + 'name': fields.char('Journal View', size=64, required=True, translate=True), 'columns_id': fields.one2many('account.journal.column', 'view_id', 'Columns') } _order = "name" From c26d11c6ecd4443837192a1f22034a4239e2fee9 Mon Sep 17 00:00:00 2001 From: "Amit (OpenERP)" Date: Wed, 28 Mar 2012 14:56:48 +0530 Subject: [PATCH 024/275] [FIX] account_asset : Fixes the field type problem lp bug: https://launchpad.net/bugs/935469 fixed bzr revid: amp@tinyerp.com-20120328092648-gx3nfuv0bqmg13bt --- addons/account_asset/account_asset.py | 2 +- addons/account_asset/report/account_asset_report.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py index 97aec1d8487..8b589a7c6df 100644 --- a/addons/account_asset/account_asset.py +++ b/addons/account_asset/account_asset.py @@ -337,7 +337,7 @@ class account_asset_depreciation_line(osv.osv): 'amount': fields.float('Depreciation Amount', required=True), 'remaining_value': fields.float('Amount to Depreciate', required=True), 'depreciated_value': fields.float('Amount Already Depreciated', required=True), - 'depreciation_date': fields.char('Depreciation Date', size=64, select=1), + 'depreciation_date': fields.date('Depreciation Date', select=1), 'move_id': fields.many2one('account.move', 'Depreciation Entry'), 'move_check': fields.function(_get_move_check, method=True, type='boolean', string='Posted', store=True) } diff --git a/addons/account_asset/report/account_asset_report.py b/addons/account_asset/report/account_asset_report.py index a7d9adf00f9..6c183c4c037 100644 --- a/addons/account_asset/report/account_asset_report.py +++ b/addons/account_asset/report/account_asset_report.py @@ -50,7 +50,7 @@ class asset_asset_report(osv.osv): select min(dl.id) as id, dl.name as name, - to_date(dl.depreciation_date, 'YYYY-MM-DD') as depreciation_date, + dl.depreciation_date as depreciation_date, a.purchase_date as purchase_date, (CASE WHEN (select min(d.id) from account_asset_depreciation_line as d left join account_asset_asset as ac ON (ac.id=d.asset_id) @@ -77,7 +77,7 @@ class asset_asset_report(osv.osv): from account_asset_depreciation_line dl left join account_asset_asset a on (dl.asset_id=a.id) group by - dl.amount,dl.asset_id,to_date(dl.depreciation_date, 'YYYY-MM-DD'),dl.name, + dl.amount,dl.asset_id,dl.depreciation_date,dl.name, a.purchase_date, dl.move_check, a.state, a.category_id, a.partner_id, a.company_id, a.purchase_value, a.id, a.salvage_value )""") From 014e243e7fad08f53543d50d851372f1670b08b9 Mon Sep 17 00:00:00 2001 From: "Amit (OpenERP)" Date: Wed, 28 Mar 2012 15:51:45 +0530 Subject: [PATCH 025/275] [FIX] account : Add decimal precision for credit, debit and write-off field on account reconcile wizard lp bug: https://launchpad.net/bugs/944017 fixed bzr revid: amp@tinyerp.com-20120328102145-li145mzcmtphc2pw --- addons/account/wizard/account_reconcile.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/addons/account/wizard/account_reconcile.py b/addons/account/wizard/account_reconcile.py index 729792e2222..a5020570926 100644 --- a/addons/account/wizard/account_reconcile.py +++ b/addons/account/wizard/account_reconcile.py @@ -23,6 +23,7 @@ import time from osv import fields, osv from tools.translate import _ +import decimal_precision as dp class account_move_line_reconcile(osv.osv_memory): """ @@ -32,9 +33,9 @@ class account_move_line_reconcile(osv.osv_memory): _description = 'Account move line reconcile' _columns = { 'trans_nbr': fields.integer('# of Transaction', readonly=True), - 'credit': fields.float('Credit amount', readonly=True), - 'debit': fields.float('Debit amount', readonly=True), - 'writeoff': fields.float('Write-Off amount', readonly=True), + 'credit': fields.float('Credit amount', readonly=True, digits_compute=dp.get_precision('Account')), + 'debit': fields.float('Debit amount', readonly=True, digits_compute=dp.get_precision('Account')), + 'writeoff': fields.float('Write-Off amount', readonly=True, digits_compute=dp.get_precision('Account')), } def default_get(self, cr, uid, fields, context=None): @@ -173,4 +174,4 @@ class account_move_line_reconcile_writeoff(osv.osv_memory): account_move_line_reconcile_writeoff() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 488e7a881736bf95e37dafa05cc8661e0ddbfc12 Mon Sep 17 00:00:00 2001 From: "Amit (OpenERP)" Date: Wed, 28 Mar 2012 18:06:34 +0530 Subject: [PATCH 026/275] [FIX] account_voucher : Usability improvement lp bug: https://launchpad.net/bugs/926041 fixed bzr revid: amp@tinyerp.com-20120328123634-c42tqj487otbh43o --- addons/account_voucher/account_voucher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 54226166508..b884fc86193 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -32,11 +32,11 @@ class res_company(osv.osv): _columns = { 'income_currency_exchange_account_id': fields.many2one( 'account.account', - string="Income Currency Rate", + string="Gain Exchange Rate Account", domain="[('type', '=', 'other')]",), 'expense_currency_exchange_account_id': fields.many2one( 'account.account', - string="Expense Currency Rate", + string="Loss Exchange Rate Account", domain="[('type', '=', 'other')]",), } From d3fb28b0ad8a0e9986e54455304f84aec134c17b Mon Sep 17 00:00:00 2001 From: jir Date: Thu, 29 Mar 2012 12:30:42 +0530 Subject: [PATCH 027/275] [FIX] Fixes the infinity when give a blank value in recurrence termination lp bug: https://launchpad.net/bugs/961094 fixed bzr revid: jir@jir-desktop-20120329070042-tm4lvczvq6frc3yq --- addons/crm/crm_meeting_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/crm_meeting_view.xml b/addons/crm/crm_meeting_view.xml index 527f5814be4..3d2538b67ff 100644 --- a/addons/crm/crm_meeting_view.xml +++ b/addons/crm/crm_meeting_view.xml @@ -171,7 +171,7 @@ - +