From 38cd476be6a1b7a06439e98dc6eb286c803ab25d Mon Sep 17 00:00:00 2001 From: husen daudi Date: Tue, 21 Jul 2009 10:56:20 +0530 Subject: [PATCH 1/9] [FIX] module base_module_record Fixed when object has _rec_name lp bug: https://launchpad.net/bugs/401184 fixed bzr revid: hda@hda-20090721052620-kho3ivnru3f8x27g --- addons/base_module_record/base_module_record.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/base_module_record/base_module_record.py b/addons/base_module_record/base_module_record.py index 719a136e5f7..b77027bbda2 100644 --- a/addons/base_module_record/base_module_record.py +++ b/addons/base_module_record/base_module_record.py @@ -128,8 +128,9 @@ class base_module_record(osv.osv): noupdate = noupdate or update if not id: field.setAttribute("model", fields[key]['relation']) - name = self.pool.get(fields[key]['relation']).browse(cr, uid, val).name - field.setAttribute("search", "[('name','=','"+name+"')]") + fld_nm = self.pool.get(fields[key]['relation'])._rec_name + name = self.pool.get(fields[key]['relation']).read(cr, uid, val,[fld_nm])[fld_nm] or False + field.setAttribute("search", str([(str(fld_nm) ,'=', name)])) else: field.setAttribute("ref", id) record.appendChild(field) From 5ed6e2ad61d05cbf2fa1c45fa361d380e1b7acd6 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 21 Jul 2009 20:22:16 +0530 Subject: [PATCH 2/9] [IMP] Account : Move line form view from MOVE shows date for better user readability lp bug: https://launchpad.net/bugs/398805 fixed bzr revid: jvo@tinyerp.com-20090721145216-cd4vk4nch6by1tsf --- addons/account/account_view.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index ebb0c4ff0cd..60ca4626033 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -845,7 +845,8 @@ - + + From eb84f043b11d939aab3f8761e1d29184ede7aecd Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 22 Jul 2009 12:14:55 +0530 Subject: [PATCH 3/9] [FIX] Stock : default value calculation corrected for stock move bzr revid: jvo@tinyerp.com-20090722064455-n5tv2m4r7xk7imqf --- 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 2cdb9a22f13..4b372b78459 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -955,7 +955,12 @@ class stock_move(osv.osv): ['prodlot_id'])] def _default_location_destination(self, cr, uid, context={}): if context.get('move_line', []): - return context['move_line'][0][2] and context['move_line'][0][2]['location_dest_id'] or False + if context['move_line'][0]: + if isinstance(context['move_line'][0],(tuple,list)): + return context['move_line'][0][2] and context['move_line'][0][2]['location_dest_id'] or False + else: + move_list = self.pool.get('stock.move').read(cr, uid, context['move_line'][0],['location_dest_id']) + return move_list and move_list['location_dest_id'][0] or False if context.get('address_out_id', False): return self.pool.get('res.partner.address').browse(cr, uid, context['address_out_id'], context).partner_id.property_stock_customer.id return False From f8867b5024ba9a297c45edd74ede4c5ca77e1932 Mon Sep 17 00:00:00 2001 From: YSA <> Date: Wed, 22 Jul 2009 18:46:10 +0530 Subject: [PATCH 4/9] Improver error message lp bug: https://launchpad.net/bugs/377614 fixed bzr revid: hda@hda-20090722131610-knyx1hajh4orf9bu --- .../openerp-mailgate/openerp-mailgate.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py b/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py index 0380770caee..11462169b06 100644 --- a/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py +++ b/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py @@ -109,7 +109,14 @@ class email_parser(object): import netsvc netsvc.Logger().notifyChannel('mailgate', netsvc.LOG_ERROR, "%s" % e) - id = self.rpc('crm.case', 'create', data) + try: + id = self.rpc('crm.case', 'create', data) + + + except Exception,e: + if getattr(e,'faultCode','') and 'AccessError' in e.faultCode: + e = '\n\nThe Specified user does not have an access to the CRM case.' + print e attachments = message['attachment'] for attach in attachments or []: @@ -316,7 +323,11 @@ if __name__ == '__main__': msg_txt = email.message_from_file(sys.stdin) - parser.parse(msg_txt) - + try : + parser.parse(msg_txt) + except Exception,e: + if getattr(e,'faultCode','') and 'Connection unexpectedly closed' in e.faultCode: + print e + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 0df74472b33cb104b72338bbcf766cbfc589b18d Mon Sep 17 00:00:00 2001 From: "SME(tiny/Axelor)" <> Date: Wed, 22 Jul 2009 19:45:39 +0530 Subject: [PATCH 5/9] [FIX] Product : Pricelist report corrected for suitable columns bzr revid: jvo@tinyerp.com-20090722141539-grhb3v7wa6f4mi1h --- addons/product/report/product_pricelist.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/product/report/product_pricelist.py b/addons/product/report/product_pricelist.py index 69b95d1ac8f..3e232f7413c 100644 --- a/addons/product/report/product_pricelist.py +++ b/addons/product/report/product_pricelist.py @@ -45,7 +45,7 @@ class product_pricelist(report_sxw.rml_parse): qtys = 1 for i in range(1,6): - if form['qty'+str(i)] >= 0 and form['qty'+str(i)] not in vals.values(): + if form['qty'+str(i)] > 0 and form['qty'+str(i)] not in vals.values(): vals['qty'+str(qtys)] = form['qty'+str(i)] qtys += 1 lst.append(vals) @@ -54,7 +54,7 @@ class product_pricelist(report_sxw.rml_parse): def _set_quantity(self,form): for i in range(1,6): q = 'qty%d'%i - if form[q] >=0 and form[q] not in self.quantity: + if form[q] >0 and form[q] not in self.quantity: self.quantity.append(form[q]) # else: # self.quantity.append(0) From 96f68bec03a177c1e3daa9b3b776f3c0ca55e0f1 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 22 Jul 2009 20:30:03 +0530 Subject: [PATCH 6/9] [FIX] point_of_sale : Pikcing display partner made from POS order. lp bug: https://launchpad.net/bugs/399485 fixed bzr revid: jvo@tinyerp.com-20090722150003-eus93t1r5ze7bhmi --- addons/point_of_sale/pos.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py index 68daab9c078..af4627ed250 100644 --- a/addons/point_of_sale/pos.py +++ b/addons/point_of_sale/pos.py @@ -304,11 +304,14 @@ class pos_order(osv.osv): def create_picking(self, cr, uid, ids, context={}): """Create a picking for each order and validate it.""" picking_obj = self.pool.get('stock.picking') - + partner_obj = self.pool.get('res.partner') + address_id = False orders = self.browse(cr, uid, ids, context) for order in orders: if not order.last_out_picking: new = True + if order.partner_id.id: + address_id = partner_obj.address_get(cr, uid, [order.partner_id.id], ['delivery'])['delivery'] picking_id = picking_obj.create(cr, uid, { 'origin': order.name, 'type': 'out', @@ -318,7 +321,8 @@ class pos_order(osv.osv): 'invoice_state': 'none', 'auto_picking': True, 'pos_order': order.id, - }) + 'address_id' : address_id + },context) self.write(cr, uid, [order.id], {'last_out_picking': picking_id}) else: picking_id = order.last_out_picking.id From 00bc84ae187e67014aa34f197984deb042c50f91 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 22 Jul 2009 20:49:41 +0530 Subject: [PATCH 7/9] [FIX] Stock : context for address field on picking corrected lp bug: https://launchpad.net/bugs/387006 fixed bzr revid: jvo@tinyerp.com-20090722151941-a7mok5y0pj422wsd --- addons/stock/stock_view.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index c1a58bb23bd..17a0de03be6 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -343,7 +343,7 @@ - + @@ -422,7 +422,7 @@ - + @@ -436,7 +436,7 @@ - + @@ -458,7 +458,7 @@ form
- + @@ -521,7 +521,7 @@ - + @@ -542,7 +542,7 @@ - + - + @@ -1242,7 +1242,7 @@ - + Date: Thu, 23 Jul 2009 14:48:43 +0530 Subject: [PATCH 8/9] [FIX] Document : Logging enabled for abstracted_fs lp bug: https://launchpad.net/bugs/383940 fixed bzr revid: jvo@tinyerp.com-20090723091843-pm0bu7rx95yc8jv7 --- addons/document/ftpserver/abstracted_fs.py | 25 ++++++++++++---------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/addons/document/ftpserver/abstracted_fs.py b/addons/document/ftpserver/abstracted_fs.py index b3dec8f2b5e..47f3a2f1b14 100644 --- a/addons/document/ftpserver/abstracted_fs.py +++ b/addons/document/ftpserver/abstracted_fs.py @@ -126,17 +126,20 @@ class abstracted_fs: for db_name in result: db, cr = None, None try: - db = pooler.get_db_only(db_name) - cr = db.cursor() - cr.execute("SELECT 1 FROM pg_class WHERE relkind = 'r' AND relname = 'ir_module_module'") - if not cr.fetchone(): - continue - - cr.execute("select id from ir_module_module where name like 'document%' and state='installed' ") - res = cr.fetchone() - if res and len(res): - self.db_name_list.append(db_name) - cr.commit() + try: + db = pooler.get_db_only(db_name) + cr = db.cursor() + cr.execute("SELECT 1 FROM pg_class WHERE relkind = 'r' AND relname = 'ir_module_module'") + if not cr.fetchone(): + continue + + cr.execute("select id from ir_module_module where name like 'document%' and state='installed' ") + res = cr.fetchone() + if res and len(res): + self.db_name_list.append(db_name) + cr.commit() + except Exception, e: + log(e) finally: if cr is not None: cr.close() From be639e3e7e9b191c564ba623cb0005f6d85908f2 Mon Sep 17 00:00:00 2001 From: "uco(OpenERP)" <> Date: Fri, 24 Jul 2009 11:47:35 +0530 Subject: [PATCH 9/9] [FIX] account_analytic_analysis : Months sorted lp bug: https://launchpad.net/bugs/376804 fixed bzr revid: jvo@tinyerp.com-20090724061735-4nhx20lsrf151efn --- addons/account/invoice.py | 2 +- addons/account_analytic_analysis/account_analytic_analysis.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 2bbd2e92207..e5bbdc6f52c 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -880,7 +880,7 @@ class account_invoice(osv.osv): lines = [(0, 0, l1), (0, 0, l2)] move = {'ref': invoice.number, 'line_id': lines, 'journal_id': pay_journal_id, 'period_id': period_id, 'date': date} - move_id = self.pool.get('account.move').create(cr, uid, move) + move_id = self.pool.get('account.move').create(cr, uid, move, context=context) line_ids = [] total = 0.0 diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py index 4350f0a42b8..deccf3c7a68 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis.py +++ b/addons/account_analytic_analysis/account_analytic_analysis.py @@ -584,7 +584,7 @@ class account_analytic_account_summary_month(osv.osv): _description = "Hours summary by month" _auto = False _rec_name = 'month' - _order = 'month' +# _order = 'month' def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {}