From 3a240624d0c25871cae5749fc2d923109528a0a0 Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Mon, 19 Jan 2009 10:42:39 +0530 Subject: [PATCH 1/7] fixed bug: if phantom product does not BOM component, it's should be added in production's move lines on computing production order bzr revid: hmo@tinyerp.com-20090119051239-bplvlcox3ufjtiur --- addons/mrp/mrp.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 2c68fc66275..8632dcd9a6d 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -258,15 +258,17 @@ class mrp_bom(osv.osv): factor = bom.product_rounding result = [] result2 = [] + phantom=False if bom.type=='phantom' and not bom.bom_lines: newbom = self._bom_find(cr, uid, bom.product_id.id, bom.product_uom.id, properties) if newbom: res = self._bom_explode(cr, uid, self.browse(cr, uid, [newbom])[0], factor*bom.product_qty, properties, addthis=True, level=level+10) result = result + res[0] result2 = result2 + res[1] + phantom=True else: - return [],[] - else: + phantom=False + if not phantom: if addthis and not bom.bom_lines: result.append( { From b3e056c43b3f69314ad5e7022627abd70a215995 Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Mon, 19 Jan 2009 11:32:04 +0530 Subject: [PATCH 2/7] get partner country from invoice address bzr revid: hmo@tinyerp.com-20090119060204-p7gw1og6g96g98ok --- addons/l10n_be/wizard/partner_vat_listing.py | 52 +++++++++++--------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/addons/l10n_be/wizard/partner_vat_listing.py b/addons/l10n_be/wizard/partner_vat_listing.py index 971602dd152..cac723612ae 100644 --- a/addons/l10n_be/wizard/partner_vat_listing.py +++ b/addons/l10n_be/wizard/partner_vat_listing.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved # $Id$ # @@ -85,20 +85,19 @@ class wizard_vat(wizard.interface): period="to_date('" + str(obj_year.date_start) + "','yyyy-mm-dd') and to_date('" + str(obj_year.date_stop) +"','yyyy-mm-dd')" street=zip_city=country='' - if not obj_cmpny.partner_id.address: - street=zip_city=country='' - - for ads in obj_cmpny.partner_id.address: - if ads.type=='default': - zip_city = pooler.get_pool(cr.dbname).get('res.partner.address').get_city(cr,uid,ads.id) - if not zip_city: - zip_city = '' - if ads.street: - street=ads.street - if ads.street2: - street +=ads.street2 - if ads.country_id: - country=ads.country_id.code + addr = pooler.get_pool(cr.dbname).get('res.partner').address_get(cr, uid, [obj_cmpny.partner_id.id], ['invoice']) + if addr.get('invoice',False): + ads=pooler.get_pool(cr.dbname).get('res.partner.address').browse(cr,uid,[addr['invoice']])[0] + + zip_city = pooler.get_pool(cr.dbname).get('res.partner.address').get_city(cr,uid,ads.id) + if not zip_city: + zip_city = '' + if ads.street: + street=ads.street + if ads.street2: + street +=ads.street2 + if ads.country_id: + country=ads.country_id.code sender_date=time.strftime('%Y-%m-%d') @@ -111,7 +110,7 @@ class wizard_vat(wizard.interface): data_file +='\n\t\t'+ str(country) +'\n\t\n' data_comp ='\n\n\t'+str(company_vat)+'\n\t'+str(obj_cmpny.name)+'\n\t'+ str(street) +'\n\t'+ str(zip_city) +'\n\t'+ str(country) +'\n' data_period ='\n'+ str(obj_year.name[-4:]) +'' - + error_message=[] for p_id in p_id_list: record=[] # this holds record per partner obj_partner=pooler.get_pool(cr.dbname).get('res.partner').browse(cr,uid,p_id) @@ -121,14 +120,18 @@ class wizard_vat(wizard.interface): continue record.append(obj_partner.vat) - for ads in obj_partner.address: - if ads.type=='default': - if ads.country_id: - record.append(ads.country_id.code) - else: - raise wizard.except_wizard('Data Insufficient!', 'The Partner "'+obj_partner.name + '"'' has no country associated with its default type address!') + addr = pooler.get_pool(cr.dbname).get('res.partner').address_get(cr, uid, [obj_partner.id], ['invoice']) + if addr.get('invoice',False): + ads=pooler.get_pool(cr.dbname).get('res.partner.address').browse(cr,uid,[addr['invoice']])[0] + + if ads.country_id: + record.append(ads.country_id.code) else: - raise wizard.except_wizard('Data Insufficient!', 'The Partner "'+obj_partner.name + '"'' has no default type address!') + error_message.append('Data Insufficient! : '+ 'The Partner "'+obj_partner.name + '"'' has no country associated with its Invoice address!') + + if len(record)<2: + record.append('') + error_message.append('Data Insufficient! : '+ 'The Partner "'+obj_partner.name + '"'' has no Invoice address!') if len(line_info)==1: if line_info[0][0]=='produit': record.append(0.00) @@ -145,6 +148,9 @@ class wizard_vat(wizard.interface): data_clientinfo='' sum_tax=0.00 sum_turnover=0.00 + if len(error_message): + data['form']['msg']='Exception : \n' +'-'*50+'\n'+ '\n'.join(error_message) + return data['form'] for line in datas: if line[3]< data['form']['limit_amount']: continue From 12f23b5bf83b83d5f049b50313d8b76d22ae064a Mon Sep 17 00:00:00 2001 From: Olivier Laurent Date: Mon, 19 Jan 2009 09:59:17 +0100 Subject: [PATCH 3/7] Chanded size of the receipt report bzr revid: olt@tinyerp.com-20090119085917-rykq6h7wwpzc323d --- addons/point_of_sale/report/pos_receipt.rml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/point_of_sale/report/pos_receipt.rml b/addons/point_of_sale/report/pos_receipt.rml index 11945786f5e..27a08140c89 100644 --- a/addons/point_of_sale/report/pos_receipt.rml +++ b/addons/point_of_sale/report/pos_receipt.rml @@ -1,8 +1,8 @@ -