From e473be80543be954a457e3e5c5c7502f3e188707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Najla=C3=A2=20EL=20KHAYAT?= Date: Fri, 23 Jan 2009 11:57:19 +0100 Subject: [PATCH 1/6] picking should use the lang of the company not the lang of the partner bzr revid: nel@tinyerp.com-20090123105719-h225tpi03vqs4xut --- addons/stock/report/picking.rml | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/stock/report/picking.rml b/addons/stock/report/picking.rml index 5f23bd8078d..e63d3aedcf9 100644 --- a/addons/stock/report/picking.rml +++ b/addons/stock/report/picking.rml @@ -119,7 +119,6 @@ [[ repeatIn(objects,'picking') ]] - [[ setLang((picking.address_id and picking.address_id.partner_id and picking.address_id.partner_id.lang)) ]] From d5b3b1a24791e1c3b73a4885e4e1c9f7a31b6c00 Mon Sep 17 00:00:00 2001 From: "Apa (Open ERP)" Date: Fri, 23 Jan 2009 16:45:20 +0530 Subject: [PATCH 2/6] Set FormatLang function in : account/report/wizard_account_journal.rml account/report/wizard_central_journal.rml account/report/wizard_general_journal.rml bzr revid: apa@tinyerp.com-20090123111520-058rmjrgpmdfvy96 --- addons/account/report/wizard_account_journal.rml | 14 +++++++------- addons/account/report/wizard_central_journal.rml | 12 ++++++------ addons/account/report/wizard_general_journal.rml | 16 ++++++++-------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/addons/account/report/wizard_account_journal.rml b/addons/account/report/wizard_account_journal.rml index def6acbecb8..0cc66191f53 100644 --- a/addons/account/report/wizard_account_journal.rml +++ b/addons/account/report/wizard_account_journal.rml @@ -24,7 +24,7 @@ - [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]] + [[ formatLang(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),date_time = True) ]] Page @@ -145,7 +145,7 @@ - [[line[0].period_id.name ]] + [[ line[0].period_id.name ]] [[line[0].journal_id.code ]] @@ -153,16 +153,16 @@ - [[ '%.2f' % sum_debit(line[0].period_id.id, line[0].journal_id.id) or '0.00' ]] + [[ formatLang(sum_debit(line[0].period_id.id, line[0].journal_id.id)) ]] - [[ '%.2f' % sum_credit(line[0].period_id.id, line[0].journal_id.id) or '0.00' ]] + [[ formatLang(sum_credit(line[0].period_id.id, line[0].journal_id.id)) ]] [[repeatIn(line,'l')]] - [[ l.date ]] + [[ formatLang(l.date,date=True) ]] [[ l.ref ]] @@ -177,10 +177,10 @@ [[ l.name ]] - [[ l.debit and '%.2f' % l.debit or '0.00' ]] + [[ formatLang(l.debit) ]] - [[ l.credit and '%.2f' % l.credit or '0.00' ]] + [[ formatLang(l.credit) ]] diff --git a/addons/account/report/wizard_central_journal.rml b/addons/account/report/wizard_central_journal.rml index 4c0b037971a..7cefd80fbe2 100644 --- a/addons/account/report/wizard_central_journal.rml +++ b/addons/account/report/wizard_central_journal.rml @@ -16,7 +16,7 @@ - [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]] + [[ formatLang(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),date_time = True) ]] Page @@ -169,7 +169,7 @@ [[ line[0]['journal'].name ]] - [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]] + [[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'),date_time = True) ]] @@ -208,10 +208,10 @@ - [[ '%.2f' % sum_debit(line[0]['period'].id, line[0]['journal'].id) ]] + [[ formatLang(sum_debit(line[0]['period'].id, line[0]['journal'].id)) ]] - [[ '%.2f' % sum_credit(line[0]['period'].id, line[0]['journal'].id) ]] + [[ formatLang(sum_credit(line[0]['period'].id, line[0]['journal'].id)) ]] @@ -230,10 +230,10 @@ [[ l['name'] ]] - [[ formatLang(l['debit']) and '%.2f' % l['debit'] or '0.00' ]] + [[ formatLang(l['debit']) ]] - [[ formatLang(l['credit']) and '%.2f' % l['credit'] or '0.00' ]] + [[ formatLang(l['credit']) ]] diff --git a/addons/account/report/wizard_general_journal.rml b/addons/account/report/wizard_general_journal.rml index e61aa9b2267..aba1ad9c98c 100644 --- a/addons/account/report/wizard_general_journal.rml +++ b/addons/account/report/wizard_general_journal.rml @@ -16,7 +16,7 @@ - [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]] + [[ formatLang(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),date_time = True) ]] Page @@ -130,7 +130,7 @@ Printing Date : - [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]] + [[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'),date_time = True) ]] @@ -178,10 +178,10 @@ - [[ '%.2f' % sum_debit(data['form']['period_id'][0][2],data['form']['journal_id'][0][2]) ]] + [[ formatLang(sum_debit(data['form']['period_id'][0][2],data['form']['journal_id'][0][2])) ]] - [[ '%.2f' % sum_credit(data['form']['period_id'][0][2],data['form']['journal_id'][0][2]) ]] + [[ formatLang(sum_credit(data['form']['period_id'][0][2],data['form']['journal_id'][0][2])) ]] @@ -208,10 +208,10 @@ - [[ '%.2f' % sum_debit_period( line[0]['pid'],data['form']['journal_id'][0][2]) ]] + [[ formatLang(sum_debit_period( line[0]['pid'],data['form']['journal_id'][0][2])) ]] - [[ '%.2f' % sum_credit_period(line[0]['pid'],data['form']['journal_id'][0][2]) ]] + [[ formatLang(sum_credit_period(line[0]['pid'],data['form']['journal_id'][0][2])) ]] @@ -229,10 +229,10 @@ [[ line[0]['period_name'] ]] - [[ l['debit'] and ('%.2f' % l['debit']) or '' ]] + [[ formatLang(l['debit'])]] - [[ l['credit'] and ('%.2f' % l['credit']) or '' ]] + [[ formatLang(l['credit']) ]] From de0c4b0970ca9629452f72d0a0c362a64af875fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Najla=C3=A2=20EL=20KHAYAT?= Date: Fri, 23 Jan 2009 12:27:11 +0100 Subject: [PATCH 3/6] format dates and amounts of production order bzr revid: nel@tinyerp.com-20090123112711-bszfekkxp8v7o5zb --- addons/mrp/report/order.rml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/mrp/report/order.rml b/addons/mrp/report/order.rml index f920a71337b..fdac9cf9087 100644 --- a/addons/mrp/report/order.rml +++ b/addons/mrp/report/order.rml @@ -206,7 +206,7 @@ [[ '['+ o.product_id.code +']' ]] [[ o.product_id.name ]] - [['%.2f' % o.product_qty or '0.00' ]] + [[ formatLang(o.product_qty) ]] [[o.priority or '']] @@ -239,10 +239,10 @@ - [[ time.strftime('%d/%m/%Y') ]] + [[ formatLang( time.strftime('%d/%m/%Y'),date=True) ]] - [[ time.strftime('%d/%m/%Y', time.strptime(o.date_planned, '%Y-%m-%d %H:%M:%S')) ]] + [[ formatLang(o.date_planned, date=True) ]] [[ o.sale_ref or ' ' ]] @@ -292,10 +292,10 @@ [[ line2.workcenter_id.name ]] - [[ line2.cycle or '0.00' ]] + [[ formatLang(line2.cycle) ]] - [[ line2.hour or '0.00' ]] + [[ formatLang(line2.hour) ]] @@ -327,7 +327,7 @@ [[ '['+line.product_id.code +']' ]][[ line.product_id.name ]] - [[ '%.2f' % line.product_qty ]] [[line.product_uom.name]] + [[ formatLang(line.product_qty) ]] [[line.product_uom.name]] [[ line.location_id.name ]] @@ -348,4 +348,4 @@ - \ No newline at end of file + From bd0148a496ff90eaeb798ed41e5230eb04003814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Najla=C3=A2=20EL=20KHAYAT?= Date: Fri, 23 Jan 2009 12:43:39 +0100 Subject: [PATCH 4/6] change format date printing on production order bzr revid: nel@tinyerp.com-20090123114339-7w62eq7a547tfvm5 --- addons/mrp/report/order.rml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/report/order.rml b/addons/mrp/report/order.rml index fdac9cf9087..0209da707ac 100644 --- a/addons/mrp/report/order.rml +++ b/addons/mrp/report/order.rml @@ -239,7 +239,7 @@ - [[ formatLang( time.strftime('%d/%m/%Y'),date=True) ]] + [[ formatLang(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),date_time = True) ]] [[ formatLang(o.date_planned, date=True) ]] From 8e3e534bef9f38f0b55857621db3e5b2536fb3e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Najla=C3=A2=20EL=20KHAYAT?= Date: Fri, 23 Jan 2009 14:07:36 +0100 Subject: [PATCH 5/6] add exception on SO when no partner bzr revid: nel@tinyerp.com-20090123130736-mmbwyibbn2lo9o7j --- addons/sale/sale.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 4e3d384a057..11908284f05 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -851,6 +851,8 @@ class sale_order_line(osv.osv): def product_id_change(self, cr, uid, ids, pricelist, product, qty=0, uom=False, qty_uos=0, uos=False, name='', partner_id=False, lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False): + if not pricelist: + raise osv.except_osv(_('No Pricelist !'), _('You have to select a pricelist in the sale form !\nPlease set one partner before choosing a product.')) warning={} product_uom_obj = self.pool.get('product.uom') partner_obj = self.pool.get('res.partner') From 2cb8df7e40fde7e1d6e835d275068c6ed8519b33 Mon Sep 17 00:00:00 2001 From: "dsh(Open ERP)" <> Date: Fri, 23 Jan 2009 19:15:30 +0530 Subject: [PATCH 6/6] bug fix bzr revid: dsh-20090123134530-ky0y8cyj36nwxqoj --- addons/purchase/purchase.py | 2 ++ addons/sale/sale.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 355267229f6..e57e2833c8d 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -452,6 +452,8 @@ class purchase_order_line(osv.osv): partner_id, date_order=False, fiscal_position=False): if not pricelist: raise osv.except_osv(_('No Pricelist !'), _('You have to select a pricelist in the purchase form !\nPlease set one before choosing a product.')) + if not partner_id: + raise osv.except_osv(_('No Partner!'), _('You have to select a partner in the purchase form !\nPlease set one partner before choosing a product.')) if not product: return {'value': {'price_unit': 0.0, 'name':'','notes':'', 'product_uom' : False}, 'domain':{'product_uom':[]}} prod= self.pool.get('product.product').browse(cr, uid,product) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 11908284f05..c58c81efa57 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -851,8 +851,8 @@ class sale_order_line(osv.osv): def product_id_change(self, cr, uid, ids, pricelist, product, qty=0, uom=False, qty_uos=0, uos=False, name='', partner_id=False, lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False): - if not pricelist: - raise osv.except_osv(_('No Pricelist !'), _('You have to select a pricelist in the sale form !\nPlease set one partner before choosing a product.')) + if not partner_id: + raise osv.except_osv(_('No Partner !'), _('You have to select a partner in the sale form !\nPlease set one partner before choosing a product.')) warning={} product_uom_obj = self.pool.get('product.uom') partner_obj = self.pool.get('res.partner')