From 06992123fb20b4185a61205d04d9e6da2d647823 Mon Sep 17 00:00:00 2001 From: Sebastien LANGE Date: Tue, 27 Jan 2009 23:12:05 +0100 Subject: [PATCH 01/19] Modify account in view mode : 401 409 411 419 421 437 4456 4457 512 645 646 Modify account with children in reconcile True : 40 41 421 437 4455 4456 4457 4458 58 bzr revid: sebatien.lange@syleam.fr-20090127221205-g7wszauodlypy5f3 --- addons/l10n_fr/pcg.xml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/addons/l10n_fr/pcg.xml b/addons/l10n_fr/pcg.xml index 242c7b9d585..545937b8390 100644 --- a/addons/l10n_fr/pcg.xml +++ b/addons/l10n_fr/pcg.xml @@ -3403,6 +3403,7 @@ view + @@ -3417,7 +3418,7 @@ Fournisseurs 401 - payable + view @@ -3530,7 +3531,7 @@ Fournisseurs débiteurs 409 - payable + view @@ -3561,7 +3562,7 @@ Fournisseurs - Autres avoirs 4097 other - + @@ -3604,6 +3605,7 @@ + @@ -3619,7 +3621,7 @@ Clients 411 - receivable + view @@ -3701,7 +3703,7 @@ Clients créditeurs 419 - receivable + view @@ -3760,7 +3762,7 @@ Personnel - Rémunérations dues 421 - other + view @@ -3909,7 +3911,7 @@ Autres organismes sociaux 437 - other + view @@ -4168,7 +4170,7 @@ Taxes sur le chiffre d'affaires déductibles 4456 - other + view @@ -4239,7 +4241,7 @@ Taxes sur le chiffre d'affaires collectées par l'entreprise 4457 - other + view @@ -5268,7 +5270,7 @@ Banques 512 - other + view Créer 1 compte par compte bancaire @@ -5472,6 +5474,7 @@ + @@ -6940,7 +6943,7 @@ Charges de Sécurité sociale et de prévoyance 645 - other + view @@ -6994,7 +6997,7 @@ Cotisations sociales personnelles de l'exploitant 646 - other + view From a24529399d0701587d3ef28af5abf3938f08a7f0 Mon Sep 17 00:00:00 2001 From: "mra (Open ERP)" Date: Fri, 30 Jan 2009 16:07:24 +0530 Subject: [PATCH 02/19] add fiscal position for the wizards(create invoice) for pos,sale,sale_crm bzr revid: mra@tinyerp.com-20090130103724-1tkww39e0mwg0mwg --- addons/account_tax_include/invoice_tax_incl.py | 8 ++++---- addons/point_of_sale/pos.py | 6 +++--- addons/sale/wizard/make_invoice_advance.py | 4 ++-- addons/sale_crm/wizard/makesale.py | 10 +++++----- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/addons/account_tax_include/invoice_tax_incl.py b/addons/account_tax_include/invoice_tax_incl.py index 62f88205bf1..7d66a87fc0f 100644 --- a/addons/account_tax_include/invoice_tax_incl.py +++ b/addons/account_tax_include/invoice_tax_incl.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$ # @@ -140,12 +140,12 @@ class account_invoice_line(osv.osv): else: return super(account_invoice_line, self).product_id_change_unit_price_inv(cr, uid, tax_id, price_unit, qty, address_invoice_id, product, partner_id, context=context) - def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition=False, price_unit=False, address_invoice_id=False, price_type='tax_excluded', context=None): - # note: will call product_id_change_unit_price_inv with context... + def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, price_type='tax_excluded', context=None): + # note: will call product_id_change_unit_price_inv with context... if context is None: context = {} context.update({'price_type': price_type}) - return super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition, price_unit, address_invoice_id, context=context) + return super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, context=context) account_invoice_line() class account_invoice_tax(osv.osv): diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py index 248f7de96a9..a3331935463 100644 --- a/addons/point_of_sale/pos.py +++ b/addons/point_of_sale/pos.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$ # @@ -55,7 +55,7 @@ class pos_order(osv.osv): def onchange_partner_pricelist(self, cr, uid, ids, part, context={}): if not part: return {} - pricelist = self.pool.get('res.partner').browse(cr, uid, part).property_product_pricelist.id + pricelist = self.pool.get('res.partner').browse(cr, uid, part).property_product_pricelist.id return {'value':{'pricelist_id': pricelist}} def _amount_total(self, cr, uid, ids, field_name, arg, context): @@ -521,7 +521,7 @@ class pos_order(osv.osv): 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)['value']) + line.qty, partner_id = order.partner_id.id, fposition_id=order.partner_id.property_account_position.id)['value']) inv_line['price_unit'] = line.price_unit inv_line['discount'] = line.discount diff --git a/addons/sale/wizard/make_invoice_advance.py b/addons/sale/wizard/make_invoice_advance.py index b7f0cc1939c..b2328ed3342 100644 --- a/addons/sale/wizard/make_invoice_advance.py +++ b/addons/sale/wizard/make_invoice_advance.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$ # @@ -61,7 +61,7 @@ def _createInvoices(self, cr, uid, data, context={}): raise osv.except_osv( _('Error'), _("You cannot make an advance on a sale order that is defined as 'Automatic Invoice after delivery'.")) - val = obj_lines.product_id_change(cr, uid, [], data['form']['product_id'],uom = False, partner_id = sale.partner_id.id) + val = obj_lines.product_id_change(cr, uid, [], data['form']['product_id'],uom = False, partner_id = sale.partner_id.id, fposition_id=sale.fiscal_position.id) line_id =obj_lines.create(cr, uid, { 'name': val['value']['name'], 'account_id':val['value']['account_id'], diff --git a/addons/sale_crm/wizard/makesale.py b/addons/sale_crm/wizard/makesale.py index 8a80c2d27f8..1c7a708cfb8 100644 --- a/addons/sale_crm/wizard/makesale.py +++ b/addons/sale_crm/wizard/makesale.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$ # @@ -72,21 +72,22 @@ class make_sale(wizard.interface): ['invoice', 'delivery', 'contact']) default_pricelist = partner_obj.browse(cr, uid, data['form']['partner_id'], context).property_product_pricelist.id - + fpos_data = partner_obj.browse(cr, uid, data['form']['partner_id'],context).property_account_position new_ids = [] for case in case_obj.browse(cr, uid, data['ids']): if case.partner_id and case.partner_id.id: partner_id = case.partner_id.id + fpos = case.partner_id.property_account_position and case.partner_id.property_account_position.id or False partner_addr = partner_obj.address_get(cr, uid, [case.partner_id.id], ['invoice', 'delivery', 'contact']) pricelist = partner_obj.browse(cr, uid, case.partner_id.id, context).property_product_pricelist.id else: partner_id = data['form']['partner_id'] + fpos = fpos_data and fpos_data.id or False partner_addr = default_partner_addr pricelist = default_pricelist - vals = { 'origin': 'CRM:%s' % str(case.id), 'picking_policy': data['form']['picking_policy'], @@ -102,10 +103,9 @@ class make_sale(wizard.interface): if data['form']['analytic_account']: vals['project_id'] = data['form']['analytic_account'] new_id = sale_obj.create(cr, uid, vals) - for product_id in data['form']['products'][0][2]: value = sale_line_obj.product_id_change(cr, uid, [], pricelist, - product_id, qty=1, partner_id=partner_id)['value'] + product_id, qty=1, partner_id=partner_id, fiscal_position=fpos)['value'] value['product_id'] = product_id value['order_id'] = new_id sale_line_obj.create(cr, uid, value) From 89e54730754c19166892b7bda300ac5e16f775aa Mon Sep 17 00:00:00 2001 From: "Sbh (Open ERP)" Date: Fri, 30 Jan 2009 18:11:32 +0530 Subject: [PATCH 03/19] Add the functionality to change the fontcolor in reports bzr revid: sbh@tinyerp.com-20090130124132-ovb71qn6je371kio --- .../wizard/tiny_sxw2rml/normalized_odt2rml.xsl | 12 ++++++++++++ .../wizard/tiny_sxw2rml/normalized_oo2rml.xsl | 11 +++++++++++ 2 files changed, 23 insertions(+) diff --git a/addons/base_report_designer/wizard/tiny_sxw2rml/normalized_odt2rml.xsl b/addons/base_report_designer/wizard/tiny_sxw2rml/normalized_odt2rml.xsl index b935de03a3b..09d81860896 100644 --- a/addons/base_report_designer/wizard/tiny_sxw2rml/normalized_odt2rml.xsl +++ b/addons/base_report_designer/wizard/tiny_sxw2rml/normalized_odt2rml.xsl @@ -498,6 +498,7 @@ + @@ -670,6 +671,17 @@ + + + + + + + + + + + - + PA From d75143727d8d4a31ad58cafc70a9cfb7e1797f61 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 3 Feb 2009 11:50:03 +0100 Subject: [PATCH 16/19] [FIX] Check if the iban key is present and has a value in the dictionary lp bug: https://launchpad.net/bugs/323238 fixed bzr revid: stephane@tinyerp.com-20090203105003-4ix3ct06qj93xeux --- addons/base_iban/base_iban.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/base_iban/base_iban.py b/addons/base_iban/base_iban.py index aebaa940a9a..2d91e1d5b4c 100644 --- a/addons/base_iban/base_iban.py +++ b/addons/base_iban/base_iban.py @@ -38,13 +38,13 @@ class res_partner_bank(osv.osv): def create(self, cr, uid, vals, context={}): #overwrite to format the iban number correctly - if vals.has_key('iban'): + if 'iban' in vals and vals['iban']: vals['iban'] = _format_iban(vals['iban']) return super(res_partner_bank, self).create(cr, uid, vals, context) def write(self, cr, uid, ids, vals, context={}): #overwrite to format the iban number correctly - if vals.has_key('iban'): + if 'iban' in vals and vals['iban']: vals['iban'] = _format_iban(vals['iban']) return super(res_partner_bank, self).write(cr, uid, ids, vals, context) From e25ef1a054dbca340e6746940b2cd83e6eb3265e Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 3 Feb 2009 13:43:27 +0100 Subject: [PATCH 17/19] [FIX] Remove the wrong demo data in the demo file lp bug: https://launchpad.net/bugs/324412 fixed bzr revid: stephane@tinyerp.com-20090203124327-wl5e8onkyhw6za3v --- addons/hr_expense/__terp__.py | 2 +- addons/hr_expense/hr.expense.expense.csv | 1 - addons/hr_expense/hr_expense_demo.xml | 6 ------ 3 files changed, 1 insertion(+), 8 deletions(-) delete mode 100644 addons/hr_expense/hr_expense_demo.xml diff --git a/addons/hr_expense/__terp__.py b/addons/hr_expense/__terp__.py index 8c08af34e70..12fcbed1ac4 100644 --- a/addons/hr_expense/__terp__.py +++ b/addons/hr_expense/__terp__.py @@ -51,7 +51,7 @@ 'hr_expense_report.xml', 'process/hr_expense_process.xml' ], - 'demo_xml': ['hr_expense_demo.xml', 'hr.expense.expense.csv'], + 'demo_xml': ['hr.expense.expense.csv'], 'installable': True, 'active': False, 'certificate': '62479841789', diff --git a/addons/hr_expense/hr.expense.expense.csv b/addons/hr_expense/hr.expense.expense.csv index 56cc2cd0056..9cf0cf7d2aa 100644 --- a/addons/hr_expense/hr.expense.expense.csv +++ b/addons/hr_expense/hr.expense.expense.csv @@ -1,4 +1,3 @@ name,ref,employee_id,line_ids/date_value,line_ids/name,line_ids/analytic_account,line_ids/unit_quantity,line_ids/ref,line_ids/unit_amount September Expenses,09/06,Fabien Pinckaers,2006-09-05,Travel by Car - Customer Seagate 2 - Double,Thymbra,130.0,,0.22 -,,,2006-09-05,Travel by Car - Trainging,Trainings,100.0,,0.22 ,,,2006-09-05,Basic PC - Server for Seagate,Seagate P2,1.0,S1234435,300.0 diff --git a/addons/hr_expense/hr_expense_demo.xml b/addons/hr_expense/hr_expense_demo.xml deleted file mode 100644 index 1168fd29679..00000000000 --- a/addons/hr_expense/hr_expense_demo.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - From e4bc01cdc80d9b60864c0430d24d7dacb66acc27 Mon Sep 17 00:00:00 2001 From: qdp Date: Tue, 3 Feb 2009 15:03:11 +0100 Subject: [PATCH 18/19] [FIX] bgufixed the 2 wizards of l10n_be -vat_subjected wasn't take in considearation in vat_linting -wrong value was filled for tag in vat_declaration + [IMP] improved the vat_declaration wizard in oorder to: -work for quarter based accountings -have a generic solution for zip_id that is added in cci_partner bzr revid: qdp@tinyerp.com-20090203140311-74erq47phor2l5q3 --- addons/l10n_be/__init__.py | 1 + addons/l10n_be/company.py | 43 +++++++++++++++++++ .../l10n_be/wizard/account_vat_declaration.py | 34 +++++++++------ addons/l10n_be/wizard/partner_vat_listing.py | 3 +- 4 files changed, 65 insertions(+), 16 deletions(-) create mode 100644 addons/l10n_be/company.py diff --git a/addons/l10n_be/__init__.py b/addons/l10n_be/__init__.py index f5dd0969f16..c652b702c26 100644 --- a/addons/l10n_be/__init__.py +++ b/addons/l10n_be/__init__.py @@ -20,6 +20,7 @@ # ############################################################################## +import company import wizard # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_be/company.py b/addons/l10n_be/company.py new file mode 100644 index 00000000000..3538f6e0dfd --- /dev/null +++ b/addons/l10n_be/company.py @@ -0,0 +1,43 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import osv + +class res_company(osv.osv): + _inherit = "res.company" + _description = 'res.company' + + + def _get_default_ad(self, addresses): + city = post_code = address = "" + for ads in addresses: + if ads.type == 'default': + city = ads.city + post_code = ads.zip + if ads.street: + address = ads.street + if ads.street2: + address += " " + ads.street2 + return city, post_code, address +res_company() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_be/wizard/account_vat_declaration.py b/addons/l10n_be/wizard/account_vat_declaration.py index 1dfd85aa52f..a6123d7c5c7 100644 --- a/addons/l10n_be/wizard/account_vat_declaration.py +++ b/addons/l10n_be/wizard/account_vat_declaration.py @@ -25,6 +25,8 @@ import datetime import pooler import base64 +from tools.translate import _ + form_fyear = """
@@ -48,6 +50,7 @@ fields = { 'readonly': True,}, } + class wizard_vat_declaration(wizard.interface): def _create_xml(self, cr, uid, data, context): @@ -58,7 +61,7 @@ class wizard_vat_declaration(wizard.interface): user_cmpny = obj_company.name vat_no=obj_company.partner_id.vat if not vat_no: - raise wizard.except_wizard('Data Insufficient','No VAT Number Associated with Main Company!') + raise wizard.except_wizard(_('Data Insufficient'),_('No VAT Number Associated with Main Company!')) tax_ids = pool_obj.get('account.tax.code').search(cr,uid,[]) ctx = context.copy() @@ -69,30 +72,33 @@ class wizard_vat_declaration(wizard.interface): if not obj_company.partner_id.address: address=post_code=city='' - for ads in obj_company.partner_id.address: - if ads.type=='default': - if ads.zip_id: - city=ads.zip_id.city - post_code=ads.zip_id.name - if ads.street: - address=ads.street - if ads.street2: - address +=ads.street2 + city, post_code, address = pooler.get_pool(cr.dbname).get('res.company')._get_default_ad(obj_company.partner_id.address) obj_fyear = pool_obj.get('account.fiscalyear') year_id = obj_fyear.find(cr, uid) current_year = obj_fyear.browse(cr,uid,year_id).name - month=time.strftime('%m') period_code = pool_obj.get('account.period').browse(cr, uid, data['form']['period']).code + send_ref = user_cmpny if period_code: send_ref = send_ref + period_code data_of_file='\n' - data_of_file +='\n\t\n\t\t'+str(vat_no)+'\n\t\t'+str(obj_company.name)+'\n\t\t
'+str(address)+'
' - data_of_file +='\n\t\t'+str(post_code)+'\n\t\t'+str(city)+'\n\t\t'+send_ref+'\n\t
' - data_of_file +='\n\t\n\t\t1\n\t\t'+str(vat_no)+'\n\t\t\n\t\t\t'+str(month)+'\n\t\t\t'+str(current_year[-4:])+'\n\t\t\n\t\t' + data_of_file +='\n\t\n\t\t'+str(vat_no)+'\n\t\t'+str(obj_company.name)+'\n\t\t
'+address+'
' + data_of_file +='\n\t\t'+post_code+'\n\t\t'+city+'\n\t\t'+send_ref+'\n\t
' + data_of_file +='\n\t\n\t\t1\n\t\t'+str(vat_no)+'\n\t\t\n\t\t\t' + + starting_month = pool_obj.get('account.period').browse(cr, uid, data['form']['period']).date_start[5:7] + ending_month = pool_obj.get('account.period').browse(cr, uid, data['form']['period']).date_stop[5:7] + if starting_month != ending_month: + #starting month and ending month of selected period are not the same + #it means that the accounting isn't based on periods of 1 month but on quarters + quarter = str(((int(starting_month) - 1) / 3) + 1) + data_of_file += ''+quarter+'\n\t\t\t' + else: + data_of_file += ''+starting_month+'\n\t\t\t' + data_of_file += ''+str(current_year[-4:])+'\n\t\t\n\t\t' data_of_file +='\n\t\t\n\t\t\t' for item in tax_info: diff --git a/addons/l10n_be/wizard/partner_vat_listing.py b/addons/l10n_be/wizard/partner_vat_listing.py index cac723612ae..e259d194608 100644 --- a/addons/l10n_be/wizard/partner_vat_listing.py +++ b/addons/l10n_be/wizard/partner_vat_listing.py @@ -76,8 +76,7 @@ class wizard_vat(wizard.interface): # obj_company=pooler.get_pool(cr.dbname).get('res.company').browse(cr,uid,1) # vat_company=obj_company.partner_id.vat -#TODO: can be improved if we replace this test => add a new field on res_partner for cases when a partner has a number and is not subjected to the VAT... have to see if this situation could happen - p_id_list=pooler.get_pool(cr.dbname).get('res.partner').search(cr,uid,[('vat','!=',False)]) + p_id_list=pooler.get_pool(cr.dbname).get('res.partner').search(cr,uid,[('vat_subjected','!=',False)]) if not p_id_list: raise wizard.except_wizard('Data Insufficient!','No partner has a VAT Number asociated with him.') From 1de14e18c5ae77fdab317aa0490f3def88ef5ae2 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 3 Feb 2009 15:08:30 +0100 Subject: [PATCH 19/19] [FIX] Decode to utf-8 [IMP] Don't compute twice the xml stream lp bug: https://launchpad.net/bugs/324759 fixed bzr revid: stephane@tinyerp.com-20090203140830-ij2s919zywxs9fvi --- addons/base_module_record/base_module_record.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/base_module_record/base_module_record.py b/addons/base_module_record/base_module_record.py index fa9c8a6b51f..9cfa5058031 100644 --- a/addons/base_module_record/base_module_record.py +++ b/addons/base_module_record/base_module_record.py @@ -182,7 +182,7 @@ class base_module_record(osv.osv): val = str(val) val = val and ('"""%s"""' % val.replace('\\', '\\\\').replace('"', '\"')) or 'False' - field.setAttribute(u"eval", val) + field.setAttribute(u"eval", val.decode('utf-8')) record.appendChild(field) return record_list, noupdate @@ -324,8 +324,8 @@ class base_module_record(osv.osv): data.appendChild(res) elif rec[0]=='assert': pass - res = doc.toprettyxml(indent="\t") - return doc.toprettyxml(indent="\t").encode('utf8') + + return doc.toprettyxml(indent="\t").encode('utf-8') base_module_record() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: