From 259054160791c25f44a4ea88b444557a3fea6850 Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Fri, 18 Jan 2013 12:33:09 +0100 Subject: [PATCH] [IMP] Document the description fields on Products, and assume that invoices must get either the Purchase Description or the Sale Description. lp bug: https://launchpad.net/bugs/1101146 fixed bzr revid: ls@numerigraphe.fr-20130118113309-vpq65omrvges1th8 --- addons/account/account_invoice.py | 7 +++++-- addons/product/product.py | 11 ++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index c9cf90789cb..cb91943b66e 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1454,8 +1454,13 @@ class account_invoice_line(osv.osv): if type in ('out_invoice', 'out_refund'): taxes = res.taxes_id and res.taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False) + if res.description_sale: + result['name'] += '\n'+res.description_sale else: taxes = res.supplier_taxes_id and res.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False) + if res.description_purchase: + result['name'] += '\n'+res.description_purchase + tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes) if type in ('in_invoice', 'in_refund'): @@ -1465,8 +1470,6 @@ class account_invoice_line(osv.osv): result['name'] = res.partner_ref result['uos_id'] = uom_id or res.uom_id.id - if res.description: - result['name'] += '\n'+res.description domain = {'uos_id':[('category_id','=',res.uom_id.category_id.id)]} diff --git a/addons/product/product.py b/addons/product/product.py index 1cacb58df23..fad975d3cb3 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -296,9 +296,14 @@ class product_template(osv.osv): _columns = { 'name': fields.char('Name', size=128, required=True, translate=True, select=True), 'product_manager': fields.many2one('res.users','Product Manager'), - 'description': fields.text('Description',translate=True), - 'description_purchase': fields.text('Purchase Description',translate=True), - 'description_sale': fields.text('Sale Description',translate=True), + 'description': fields.text('Description',translate=True, + help="A precise description of the Product, used only for internal information purposes."), + 'description_purchase': fields.text('Purchase Description',translate=True, + help="A description of the Product that you want to communicate to your customers. " + "This description will be copied to every Sale Order, Delivery Order and Customer Invoice/Refund"), + 'description_sale': fields.text('Sale Description',translate=True, + help="A description of the Product that you want to communicate to your suppliers. " + "This description will be copied to every Purchase Order, Reception and Supplier Invoice/Refund."), 'type': fields.selection([('consu', 'Consumable'),('service','Service')], 'Product Type', required=True, help="Consumable are product where you don't manage stock, a service is a non-material product provided by a company or an individual."), 'produce_delay': fields.float('Manufacturing Lead Time', help="Average delay in days to produce this product. In the case of multi-level BOM, the manufacturing lead times of the components will be added."), 'rental': fields.boolean('Can be Rent'),