From ccbbd1a6ff946c0024511ca4f5c95e7ecdd460a3 Mon Sep 17 00:00:00 2001 From: "Bharat (OpenERP)" Date: Tue, 20 Sep 2011 16:22:55 +0530 Subject: [PATCH 1/4] [FIX] pos : product sale description does not appear in invoices coming from pos lp bug: https://launchpad.net/bugs/854303 fixed bzr revid: bde@tinyerp.com-20110920105255-xnd4tdtl59xnetql --- addons/account/invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 3747ef978a8..a4474f288bb 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -1361,7 +1361,7 @@ class account_invoice_line(osv.osv): domain = {} result['uos_id'] = res.uom_id.id or uom or False - result['note'] = res.description + result['note'] = res.description_sale if result['uos_id']: res2 = res.uom_id.category_id.id if res2: From 76191badff3c1624147c257bca68197dce716563 Mon Sep 17 00:00:00 2001 From: "Bharat (OpenERP)" Date: Wed, 21 Sep 2011 10:41:59 +0530 Subject: [PATCH 2/4] [FIX] fix the description problem in invoice report and in notes of customer invoice in point_of_sale bzr revid: bde@tinyerp.com-20110921051159-ahmg85y9113jembo --- addons/account/invoice.py | 2 +- addons/point_of_sale/point_of_sale.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index a4474f288bb..3747ef978a8 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -1361,7 +1361,7 @@ class account_invoice_line(osv.osv): domain = {} result['uos_id'] = res.uom_id.id or uom or False - result['note'] = res.description_sale + result['note'] = res.description if result['uos_id']: res2 = res.uom_id.category_id.id if res2: diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 04610463203..eed582e82f8 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -675,12 +675,17 @@ class pos_order(osv.osv): 'quantity': line.qty, } inv_name = product_obj.name_get(cr, uid, [line.product_id.id], context=context)[0][1] - + sale_description = product_obj.browse(cr, uid, [line.product_id.id], context=context)[0].description_sale + description = product_obj.browse(cr, uid, [line.product_id.id], context=context)[0].description inv_line.update(inv_line_ref.product_id_change(cr, uid, [], line.product_id.id, line.product_id.uom_id.id, line.qty, partner_id = order.partner_id.id, fposition_id=order.partner_id.property_account_position.id)['value']) + if sale_description: + inv_line['note'] = sale_description + else: + inv_line['note'] = description inv_line['price_unit'] = line.price_unit inv_line['discount'] = line.discount inv_line['name'] = inv_name @@ -1179,7 +1184,7 @@ class pos_order_line(osv.osv): if 'product_id' in values and not values['product_id']: return False return super(pos_order_line, self).write(cr, user, ids, values, context=context) - + def copy_data(self, cr, uid, id, default=None, context=None): if not default: default = {} From c3752d57d7071581155c31c6c456ab7e0488d64e Mon Sep 17 00:00:00 2001 From: "Bharat (OpenERP)" Date: Wed, 21 Sep 2011 11:10:08 +0530 Subject: [PATCH 3/4] [IMP] optimized the code point_of_sale.py bzr revid: bde@tinyerp.com-20110921054008-xay8jkfwjdodw4h1 --- addons/point_of_sale/point_of_sale.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index eed582e82f8..0fb1ce4fba1 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -675,17 +675,14 @@ class pos_order(osv.osv): 'quantity': line.qty, } inv_name = product_obj.name_get(cr, uid, [line.product_id.id], context=context)[0][1] - sale_description = product_obj.browse(cr, uid, [line.product_id.id], context=context)[0].description_sale - description = product_obj.browse(cr, uid, [line.product_id.id], context=context)[0].description inv_line.update(inv_line_ref.product_id_change(cr, uid, [], line.product_id.id, line.product_id.uom_id.id, line.qty, partner_id = order.partner_id.id, fposition_id=order.partner_id.property_account_position.id)['value']) + sale_description = line.product_id.description_sale if sale_description: inv_line['note'] = sale_description - else: - inv_line['note'] = description inv_line['price_unit'] = line.price_unit inv_line['discount'] = line.discount inv_line['name'] = inv_name From 2a373c64c648792f7aa048e162994443c3f7ae7d Mon Sep 17 00:00:00 2001 From: "Bharat (OpenERP)" Date: Wed, 21 Sep 2011 11:35:52 +0530 Subject: [PATCH 4/4] [IMP] fetched sale description directly from the product_id bzr revid: bde@tinyerp.com-20110921060552-zltdpunvj4fmk5ws --- addons/point_of_sale/point_of_sale.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 0fb1ce4fba1..c90e325c48e 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -680,9 +680,8 @@ class pos_order(osv.osv): line.product_id.uom_id.id, line.qty, partner_id = order.partner_id.id, fposition_id=order.partner_id.property_account_position.id)['value']) - sale_description = line.product_id.description_sale - if sale_description: - inv_line['note'] = sale_description + if line.product_id.description_sale: + inv_line['note'] = line.product_id.description_sale inv_line['price_unit'] = line.price_unit inv_line['discount'] = line.discount inv_line['name'] = inv_name