From d4109d63f796f34a729aa9fd96c6c735b82667bd Mon Sep 17 00:00:00 2001 From: Vinay Rana Date: Fri, 26 Sep 2008 15:00:15 +0530 Subject: [PATCH 01/87] modified sxw and rml of hr expense report in hr expense module using pluginn. bzr revid: vinusoft85@gmail.com-20080926093015-f795xtwbaf0mqzf7 --- addons/hr_expense/report/expense.rml | 154 ++++++++++++++------------- 1 file changed, 78 insertions(+), 76 deletions(-) diff --git a/addons/hr_expense/report/expense.rml b/addons/hr_expense/report/expense.rml index 6d2be72d4e7..89e7b539e66 100644 --- a/addons/hr_expense/report/expense.rml +++ b/addons/hr_expense/report/expense.rml @@ -38,7 +38,7 @@ - + @@ -48,43 +48,27 @@ - + - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - + - + + + @@ -124,10 +108,16 @@ [[ repeatIn(objects,'o') ]] + + + HR Expenses [[ o.name or '' ]] + + + @@ -157,10 +147,7 @@ - - - - + Date @@ -169,52 +156,54 @@ Name - Ref. + Ref. - Unit price + Unit Price Qty - Total + Total - - - - [[ repeatIn(o.line_ids,'line') ]] - - - - [[ time.strftime('%d/%m/%Y', time.strptime(line.date_value, '%Y-%m-%d')) or '' ]] - - - [[ line.name or '' ]] [[ line.description or '' ]] - - - [[ line.ref or '' ]] - - - [[ '%.2f' % line.unit_amount or '' ]] - - - [[ '%.2f' % line.unit_quantity or '' ]] - - - [[ '%.2f' % line.total_amount or '' ]] - - - [[ company.currency_id.name ]] - - - - - - - + + + +
+ [[ repeatIn(o.line_ids,'line') ]] + + + + [[ time.strftime('%d/%m/%Y', time.strptime(line.date_value, '%Y-%m-%d')) or '' ]] + + + [[ line.name or '' ]] [[ line.description or '' ]] + + + [[ line.ref or '' ]] + + + [[ '%.2f' % line.unit_amount or '' ]] + + + [[ company.currency_id.name ]] + + + [[ '%.2f' % line.unit_quantity or '' ]] + + + [[ '%.2f' % line.total_amount or '' ]] + + + [[ company.currency_id.name ]] + + + +
+ @@ -222,26 +211,39 @@ - Total: + + + - [[ '%.2f' % o.amount ]] + + + - [[ company.currency_id.name ]] + Total: + + + [[ '%.2f' % o.amount ]] + + + [[ company.currency_id.name ]] + + + [[ o.note or '' ]] [[ setTag('para','xpre') ]] - + Certified honest and conform, (Date and signature) - + - + This document must be dated and signed for reimbursment From 437387dc2370b2053ce587e7e18fccb048ca14a9 Mon Sep 17 00:00:00 2001 From: qdp Date: Fri, 26 Sep 2008 12:10:54 +0200 Subject: [PATCH 03/87] *improvements bzr revid: qdp@tinyerp.com-20080926101054-cmzmh3ylemjqm2rq --- addons/account_budget/__terp__.py | 4 ++-- addons/account_budget/crossovered_budget_view.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account_budget/__terp__.py b/addons/account_budget/__terp__.py index 9231b606400..b7957697226 100644 --- a/addons/account_budget/__terp__.py +++ b/addons/account_budget/__terp__.py @@ -1,13 +1,13 @@ # -*- encoding: utf-8 -*- { - "name" : "Crossovered Budget Management", + "name" : "Budget Management", "version" : "1.0", "author" : "Tiny", "website" : "http://tinyerp.com/module_crossovered_budget.html", "category" : "Generic Modules/Accounting", "description": """This module allow accountants to manage analytic and crossovered budgets. - Once the Master Budgets and the Budgets defined (in Financial Management/Configuration/Budgets/), the Project Managers can set the planned amount on each Analytic Account. + Once the Master Budgets and the Budgets defined (in Financial Management/Budgets/), the Project Managers can set the planned amount on each Analytic Account. The accountant has the possibility to see the total of amount planned for each Budget and Master Budget in order to ensure the total planned is not greater/lower than what he planned for this Budget/Master Budget. Each list of record can also be switched to a graphical view of it. diff --git a/addons/account_budget/crossovered_budget_view.xml b/addons/account_budget/crossovered_budget_view.xml index 178f8dd0696..ed7b1efb5bb 100644 --- a/addons/account_budget/crossovered_budget_view.xml +++ b/addons/account_budget/crossovered_budget_view.xml @@ -76,7 +76,7 @@ form - + - + Account Configure Wizard Define Fiscal Years and Select Charts of Account diff --git a/addons/base_setup/wizard/wizard_base_setup.py b/addons/base_setup/wizard/wizard_base_setup.py index 5e4b0356668..f8de1e6bfa8 100644 --- a/addons/base_setup/wizard/wizard_base_setup.py +++ b/addons/base_setup/wizard/wizard_base_setup.py @@ -264,7 +264,7 @@ class wizard_base_setup(wizard.interface): return { 'view_type': 'form', "view_mode": 'form', - 'res_model': 'ir.module.module.configuration.wizard', + 'res_model': 'ir.actions.configuration.wizard', 'type': 'ir.actions.act_window', 'context':{'menu':True}, 'target':'new', diff --git a/addons/crm_configuration/crm_config.py b/addons/crm_configuration/crm_config.py index c89d49af7ba..fe57488dd6f 100644 --- a/addons/crm_configuration/crm_config.py +++ b/addons/crm_configuration/crm_config.py @@ -106,11 +106,11 @@ class crm_menu_config_wizard(osv.osv_memory): tools.convert_xml_import(cr, 'crm_configuration', tools.file_open(os.path.join('crm_configuration',file_name )), {}, 'init', *args) except Exception, e: raise osv.except_osv('Error !', e) - + return { 'view_type': 'form', "view_mode": 'form', - 'res_model': 'ir.module.module.configuration.wizard', + 'res_model': 'ir.actions.configuration.wizard', 'type': 'ir.actions.act_window', 'target':'new', } @@ -118,11 +118,11 @@ class crm_menu_config_wizard(osv.osv_memory): return { 'view_type': 'form', "view_mode": 'form', - 'res_model': 'ir.module.module.configuration.wizard', + 'res_model': 'ir.actions.configuration.wizard', 'type': 'ir.actions.act_window', 'target':'new', } - + crm_menu_config_wizard() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm_configuration/crm_config_view.xml b/addons/crm_configuration/crm_config_view.xml index 20dc8ed42c5..6185d763024 100644 --- a/addons/crm_configuration/crm_config_view.xml +++ b/addons/crm_configuration/crm_config_view.xml @@ -1,7 +1,7 @@ - + @@ -38,7 +38,7 @@ - + Create Menu for CRM Case Section This Configuration step use to create Menu for Case Sections diff --git a/addons/l10n_be/l10n_be_wizard.xml b/addons/l10n_be/l10n_be_wizard.xml index 296cdfefa65..5ae595ecc01 100644 --- a/addons/l10n_be/l10n_be_wizard.xml +++ b/addons/l10n_be/l10n_be_wizard.xml @@ -24,7 +24,7 @@ type="wizard" id="account_wizard_vat_declaration"/> - + Generate Chart of Accounts from a Chart Template Generate Chart of Accounts from a Chart Template. You will be asked to pass the name of the company, the chart template to follow, the no. of digits to generate the code for your accounts and Bank account, currency to create Journals. Thus,the pure copy of chart Template is generated. This is the same wizard that runs from Financial Managament/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template. diff --git a/addons/profile_accounting/profile_accounting.py b/addons/profile_accounting/profile_accounting.py index 744a66dd796..20a27f04baa 100644 --- a/addons/profile_accounting/profile_accounting.py +++ b/addons/profile_accounting/profile_accounting.py @@ -44,31 +44,31 @@ class profile_accounting_config_install_modules_wizard(osv.osv_memory): return { 'view_type': 'form', "view_mode": 'form', - 'res_model': 'ir.module.module.configuration.wizard', + 'res_model': 'ir.actions.configuration.wizard', 'type': 'ir.actions.act_window', 'target':'new', } - - + + def action_install(self, cr, uid, ids, context=None): - result=self.read(cr,uid,ids) + result=self.read(cr,uid,ids) mod_obj = self.pool.get('ir.module.module') for res in result: for r in res: if r<>'id' and res[r]: ids += mod_obj.search(cr, uid, [('name', '=', r)]) - mod_obj.action_install(cr, uid, ids, context=context) + mod_obj.action_install(cr, uid, ids, context=context) cr.commit() db, pool = pooler.restart_pool(cr.dbname,force_demo=True, update_module=True) return { 'view_type': 'form', "view_mode": 'form', - 'res_model': 'ir.module.module.configuration.wizard', + 'res_model': 'ir.actions.configuration.wizard', 'type': 'ir.actions.act_window', 'target':'new', } - - + + profile_accounting_config_install_modules_wizard() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/profile_accounting/profile_accounting.xml b/addons/profile_accounting/profile_accounting.xml index d98b6d1f0d1..85737dcecf1 100644 --- a/addons/profile_accounting/profile_accounting.xml +++ b/addons/profile_accounting/profile_accounting.xml @@ -10,7 +10,7 @@ - + @@ -35,7 +35,7 @@ new - Accounting Profile : Install Extra modules Install more modules. A few modules are proposed according to the Account Profile you selected. You will be able to install them based on our requirements. diff --git a/addons/profile_association/profile_association.py b/addons/profile_association/profile_association.py index 3ca64f5adbb..c68ac0dc77d 100644 --- a/addons/profile_association/profile_association.py +++ b/addons/profile_association/profile_association.py @@ -43,14 +43,14 @@ class profile_association_config_install_modules_wizard(osv.osv_memory): return { 'view_type': 'form', "view_mode": 'form', - 'res_model': 'ir.module.module.configuration.wizard', + 'res_model': 'ir.actions.configuration.wizard', 'type': 'ir.actions.act_window', 'target':'new', } - - + + def action_install(self, cr, uid, ids, context=None): - result=self.read(cr,uid,ids) + result=self.read(cr,uid,ids) mod_obj = self.pool.get('ir.module.module') for res in result: for r in res: @@ -62,12 +62,12 @@ class profile_association_config_install_modules_wizard(osv.osv_memory): return { 'view_type': 'form', "view_mode": 'form', - 'res_model': 'ir.module.module.configuration.wizard', + 'res_model': 'ir.actions.configuration.wizard', 'type': 'ir.actions.act_window', 'target':'new', } - - + + profile_association_config_install_modules_wizard() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/profile_association/profile_association.xml b/addons/profile_association/profile_association.xml index a1a8467fe51..1f70efe17b6 100644 --- a/addons/profile_association/profile_association.xml +++ b/addons/profile_association/profile_association.xml @@ -34,7 +34,7 @@ new - Association Profile : Install Extra modules Install more modules. A few modules are proposed according to the association profile you selected. You will be able to install them based on our requirements. diff --git a/addons/profile_manufacturing/profile_manufacturing.py b/addons/profile_manufacturing/profile_manufacturing.py index 5ab575acde6..3ea2adbb230 100644 --- a/addons/profile_manufacturing/profile_manufacturing.py +++ b/addons/profile_manufacturing/profile_manufacturing.py @@ -75,12 +75,12 @@ class profile_manufacturing_config_install_modules_wizard(osv.osv_memory): return { 'view_type': 'form', "view_mode": 'form', - 'res_model': 'ir.module.module.configuration.wizard', + 'res_model': 'ir.actions.configuration.wizard', 'type': 'ir.actions.act_window', 'target':'new', } def action_install(self, cr, uid, ids, context=None): - result=self.read(cr,uid,ids) + result=self.read(cr,uid,ids) mod_obj = self.pool.get('ir.module.module') for res in result: for r in res: @@ -92,7 +92,7 @@ class profile_manufacturing_config_install_modules_wizard(osv.osv_memory): return { 'view_type': 'form', "view_mode": 'form', - 'res_model': 'ir.module.module.configuration.wizard', + 'res_model': 'ir.actions.configuration.wizard', 'type': 'ir.actions.act_window', 'target':'new', } diff --git a/addons/profile_manufacturing/profile_manufacturing.xml b/addons/profile_manufacturing/profile_manufacturing.xml index 2d41b6d577a..f4f917afe97 100644 --- a/addons/profile_manufacturing/profile_manufacturing.xml +++ b/addons/profile_manufacturing/profile_manufacturing.xml @@ -11,13 +11,13 @@ - + - + - + - Manufacturing Profile : Install Extra modules Install more modules. A few modules are proposed according to the manufacturing profile you selected. You will be able to install them based on our requirements. diff --git a/addons/profile_service/profile_service.py b/addons/profile_service/profile_service.py index 4dd4d83c24a..88755b28238 100644 --- a/addons/profile_service/profile_service.py +++ b/addons/profile_service/profile_service.py @@ -50,24 +50,24 @@ class profile_service_config_install_modules_wizard(osv.osv_memory): return { 'view_type': 'form', "view_mode": 'form', - 'res_model': 'ir.module.module.configuration.wizard', + 'res_model': 'ir.actions.configuration.wizard', 'type': 'ir.actions.act_window', 'target':'new', } def action_install(self, cr, uid, ids, context=None): - result=self.read(cr,uid,ids) + result=self.read(cr,uid,ids) mod_obj = self.pool.get('ir.module.module') for res in result: for r in res: - if r<>'id' and res[r]: - ids = mod_obj.search(cr, uid, [('name', '=', r)]) - mod_obj.action_install(cr,uid,ids,context=context) + if r<>'id' and res[r]: + ids = mod_obj.search(cr, uid, [('name', '=', r)]) + mod_obj.action_install(cr,uid,ids,context=context) cr.commit() db, pool = pooler.restart_pool(cr.dbname,force_demo=True, update_module=True) return { 'view_type': 'form', "view_mode": 'form', - 'res_model': 'ir.module.module.configuration.wizard', + 'res_model': 'ir.actions.configuration.wizard', 'type': 'ir.actions.act_window', 'target':'new', } diff --git a/addons/profile_service/profile_service.xml b/addons/profile_service/profile_service.xml index 50e90f4c1d1..d2080232f71 100644 --- a/addons/profile_service/profile_service.xml +++ b/addons/profile_service/profile_service.xml @@ -21,7 +21,7 @@ - + - Service Profile : Install Extra modules A few modules are proposed according to the 'service profile' you selected. You will be able to install them or more modules later through the Administration menu. diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 1fd812db08b..3bbc650816b 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -812,7 +812,7 @@ class sale_order_line(osv.osv): 'message': warn_msg } result['product_uom_qty'] = qty - + if uom: uom2 = product_uom_obj.browse(cr, uid, uom) if product_obj.uom_id.category_id.id <> uom2.category_id.id: @@ -839,7 +839,7 @@ class sale_order_line(osv.osv): taxep_id = self.pool.get('res.partner').property_get(cr, uid, partner_id,property_pref=['property_account_tax']).get('property_account_tax',False) if taxep_id: - taxep=self.pool.get('account.tax').browse(cr, uid,taxep_id) + taxep=self.pool.get('account.tax').browse(cr, uid,taxep_id) if not taxep or not taxep.id: result['tax_id'] = [x.id for x in product_obj.taxes_id] else: @@ -884,7 +884,7 @@ class sale_order_line(osv.osv): # Round the quantity up # get unit price - + if not pricelist: warning={ 'title':'No Pricelist !', @@ -904,9 +904,9 @@ class sale_order_line(osv.osv): 'message': "Couldn't find a pricelist line matching this product and quantity.\n" "You have to change either the product, the quantity or the pricelist." - } + } else: - result.update({'price_unit': price}) + result.update({'price_unit': price}) return {'value': result, 'domain': domain,'warning':warning} def product_uom_change(self, cursor, user, ids, pricelist, product, qty=0, @@ -962,7 +962,7 @@ class sale_config_picking_policy(osv.osv_memory): return { 'view_type': 'form', "view_mode": 'form', - 'res_model': 'ir.module.module.configuration.wizard', + 'res_model': 'ir.actions.configuration.wizard', 'type': 'ir.actions.act_window', 'target':'new', } @@ -970,7 +970,7 @@ class sale_config_picking_policy(osv.osv_memory): return { 'view_type': 'form', "view_mode": 'form', - 'res_model': 'ir.module.module.configuration.wizard', + 'res_model': 'ir.actions.configuration.wizard', 'type': 'ir.actions.act_window', 'target':'new', } diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index 3dfeb6d9872..0e672a62112 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -44,7 +44,7 @@ - + sale.order.calendar sale.order @@ -116,20 +116,20 @@ - @@ -479,7 +479,7 @@ - + Select the default picking policy for Sale Order This Configuration step use to set default picking policy when make sale order diff --git a/addons/sale_journal/sale_journal_view.xml b/addons/sale_journal/sale_journal_view.xml index 7647a7b2bfb..17975fe9755 100644 --- a/addons/sale_journal/sale_journal_view.xml +++ b/addons/sale_journal/sale_journal_view.xml @@ -285,7 +285,7 @@ form - + From bf5b2869f135ac7da17c66e779318139f7420e88 Mon Sep 17 00:00:00 2001 From: Harshad Modi Date: Tue, 30 Sep 2008 13:46:12 +0530 Subject: [PATCH 25/87] rename document2 with document in depend list bzr revid: hmo@tinyerp.com-20080930081612-2yuccrs3rtci1afm --- addons/board_document/__terp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/board_document/__terp__.py b/addons/board_document/__terp__.py index b48ee6b2782..665d24c2f10 100644 --- a/addons/board_document/__terp__.py +++ b/addons/board_document/__terp__.py @@ -4,7 +4,7 @@ "version":"1.0", "author":"Tiny", "category":"Board/Document", - "depends":["board","document2", "report_document"], + "depends":["board","document", "report_document"], "demo_xml":["board_document_demo.xml"], "update_xml":["board_document_view.xml"], "description": """ This module implements a dashboard for Document """, From 8b3988b79f73f0a62bd0c349cff5f4eb6c93689d Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Tue, 30 Sep 2008 14:17:43 +0530 Subject: [PATCH 26/87] Invoice:(Rana Vinay):-Solved Reduce size between each line: whennotes are written, there is so much space between the note and the detail of product that comes after check column titles of invoices, it s not using the same style like for sale order check it for: the array of taxes, and details array. General Ledger : Small changes(apa-tiny) bzr revid: patelamit2003@gmail.com-20080930084743-fu43g13gke8z2i3v --- addons/account/report/general_ledger.rml | 342 +++++++---------------- addons/account/report/invoice.rml | 12 +- 2 files changed, 104 insertions(+), 250 deletions(-) diff --git a/addons/account/report/general_ledger.rml b/addons/account/report/general_ledger.rml index da82c739c0d..c7d8228a527 100755 --- a/addons/account/report/general_ledger.rml +++ b/addons/account/report/general_ledger.rml @@ -33,20 +33,18 @@ - + - + - - @@ -54,7 +52,6 @@ - @@ -91,247 +88,110 @@ - [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] - - - Date - - - Partner - - - Ref - - - Mvt - - - Entry Label - - - Debit - - - Crebit - - - Balance - - - - [[ repeatIn(objects, 'a') ]] - [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]] - - - - - - - [[ o.code ]] [[ o.name ]] - - - [[ sum_debit_account(o, data['form']) or '0.0' ]] - - - [[sum_credit_account(o, data['form']) or '0.0' ]] - - - [[sum_solde_account(o, data['form']) or '0.0' ]] - - - - - - - - [[ data['form']['soldeinit'] == True or removeParentNode('tr') ]] - - - - - - Balance Initial - - - - - - - - - - - - [[ o.init_debit or '0.0' ]] - - - [[ o.init_credit or '0.0' ]] - - - [[ (o.init_debit - o.init_credit) or '0.0' ]] - - - - [[ repeatIn(lines(o, data['form']), 'line') ]] - - [[ line['date'] ]] - - - - [[ line['partner'] ]] - - - [[ line['ref'] ]] - - - [[ line['move'] ]] - - - [[ line['name'] ]] - - - [[ line['debit'] and line['debit'] or '0.0' ]] - - - [[ line['credit'] and line['credit'] or '0.0' ]] - - - [[ line['progress'] and line['progress'] or '0.0' ]] - - - - - - - - - [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] - - - Date - - - Partner - - - Ref - - - Mvt - - - Entry Label - - - Debit - - - Crebit - - - Balance - - - Currency - + +
+ + [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] + + Date + Partner + Ref + Mvt + Entry Label + Debit + Crebit + Balance - [[ repeatIn(objects, 'a') ]] - [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]] - - - - - - - [[ o.code ]] [[ o.name ]] - - - [[ sum_debit_account(o, data['form']) or '0.0' ]] - - - [[ sum_credit_account(o, data['form']) or '0.0' ]] - - - [[ sum_solde_account(o, data['form']) or '0.0' ]] - - - [[ sum_currency_amount_account(o, data['form']) or '0.0' ]] - - - - - - [[ data['form']['soldeinit'] == True or removeParentNode('tr') ]] - - - - - - Balance Initial - - - - - - - - - - - - [[ o.init_debit or '0.0' ]] - - - [[ o.init_credit or '0.0' ]] - - - [[ (o.init_debit - o.init_credit) or '0.0' ]] - - - - - + [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]] + + + + + [[ o.code ]] [[ o.name ]] + + [[ sum_debit_account(o, data['form']) or '0.0' ]] + [[sum_credit_account(o, data['form']) or '0.0' ]] + [[sum_solde_account(o, data['form']) or '0.0' ]] + + + [[ data['form']['soldeinit'] == True or removeParentNode('tr') ]] + Balance Initial + + [[ o.init_debit or '0.0' ]] + [[ o.init_credit or '0.0' ]] + [[ (o.init_debit - o.init_credit) or '0.0' ]] + + + - [[ repeatIn(lines(o, data['form']), 'line') ]] - - [[ line['date'] ]] - - - [[ line['partner'] ]] - - - [[ line['ref'] ]] - - - [[ line['move'] ]] - - - [[ line['name'] ]] - - - [[ line['debit'] and line['debit'] or '0.0' ]] - - - [[ line['credit'] and line['credit'] or '0.0' ]] - - - [[ line['progress'] and line['progress'] or '0.0' ]] - - - [[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] ]] - - - + + [[ repeatIn(lines(o, data['form']), 'line') ]] + [[ line['date'] ]] + [[ line['partner'] ]] + [[ line['ref'] ]] + [[ line['move'] ]] + [[ line['name'] ]] + [[ line['debit'] and line['debit'] or '0.0' ]] + [[ line['credit'] and line['credit'] or '0.0' ]] + [[ line['progress'] and line['progress'] or '0.0' ]] - - + +
+ + + + [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] + + Date + Partner + Ref + Mvt + Entry Label + Debit + Crebit + Balance + Currency - - + [[ repeatIn(objects, 'a') ]] + [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]] + + + + + [[ o.code ]] [[ o.name ]] + + [[ sum_debit_account(o, data['form']) or '0.0' ]] + [[sum_credit_account(o, data['form']) or '0.0' ]] + [[sum_solde_account(o, data['form']) or '0.0' ]] + [[ sum_currency_amount_account(o, data['form']) or '0.0' ]] + + + [[ data['form']['soldeinit'] == True or removeParentNode('tr') ]] + Balance Initial + + [[ o.init_debit or '0.0' ]] + [[ o.init_credit or '0.0' ]] + [[ (o.init_debit - o.init_credit) or '0.0' ]] + + + + + + + [[ repeatIn(lines(o, data['form']), 'line') ]] + [[ line['date'] ]] + [[ line['partner'] ]] + [[ line['ref'] ]] + [[ line['move'] ]] + [[ line['name'] ]] + [[ line['debit'] and line['debit'] or '0.0' ]] + [[ line['credit'] and line['credit'] or '0.0' ]] + [[ line['progress'] and line['progress'] or '0.0' ]] + [[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] ]] + +
+
- - - diff --git a/addons/account/report/invoice.rml b/addons/account/report/invoice.rml index 7b82cb44bd9..37b6872dece 100644 --- a/addons/account/report/invoice.rml +++ b/addons/account/report/invoice.rml @@ -350,9 +350,6 @@ [[ format(l.note or removeParentNode('tr')) ]] - - - @@ -466,19 +463,16 @@ - Tax + Tax - Base + Base - Amount + Amount - - - From e261d7c7cbb519587a406797dd2d1f3709238f64 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Tue, 30 Sep 2008 14:49:15 +0530 Subject: [PATCH 27/87] Employee attendance: returns error - Solved bzr revid: patelamit2003@gmail.com-20080930091915-5deweug9eqqn3v5l --- addons/hr_attendance/hr_attendance_report.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_attendance/hr_attendance_report.xml b/addons/hr_attendance/hr_attendance_report.xml index a0d3497c9aa..329ca641377 100644 --- a/addons/hr_attendance/hr_attendance_report.xml +++ b/addons/hr_attendance/hr_attendance_report.xml @@ -1,6 +1,6 @@ - + From 306a8c8285e611dc6cd6d0a819df6e501e050456 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Tue, 30 Sep 2008 16:19:28 +0530 Subject: [PATCH 28/87] modify base_iban module for the searching on iban number also bzr revid: mra@tinyerp.com-20080930104928-z4wqz32zu82pi2r8 --- addons/base_iban/base_iban.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/addons/base_iban/base_iban.py b/addons/base_iban/base_iban.py index dd06ea6e438..598e6af4552 100644 --- a/addons/base_iban/base_iban.py +++ b/addons/base_iban/base_iban.py @@ -48,6 +48,17 @@ class res_partner_bank(osv.osv): res += super(res_partner_bank, self).name_get(cr, uid, to_check_ids, context) return res + def search(self, cr, uid, args, offset=0, limit=None, order=None, + context=None, count=False): + res = super(res_partner_bank,self).search(cr, uid, args, offset, limit, + order, context=context, count=count) + if filter(lambda x:x[0]=='acc_number' ,args): + iban_value = filter(lambda x:x[0]=='acc_number' ,args)[0][2] + args1 = [('iban','ilike',iban_value)] + res += super(res_partner_bank,self).search(cr, uid, args1, offset, limit, + order, context=context, count=count) + return res + res_partner_bank() From 62fe10a237fdd8660e82fd7d6c97481cca4d4e00 Mon Sep 17 00:00:00 2001 From: Amit Mendapara Date: Tue, 30 Sep 2008 16:38:01 +0530 Subject: [PATCH 29/87] * Update process module (document integration). bzr revid: ame@tinyerp.com-20080930110801-rr7cowd5femqpp1j --- addons/process/process.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/addons/process/process.py b/addons/process/process.py index 183f3acf93c..0e92b90be80 100644 --- a/addons/process/process.py +++ b/addons/process/process.py @@ -117,10 +117,6 @@ class process_process(osv.osv): data['gray'] = False data['url'] = node.help_url - # chech whether directory_id from inherited from document2 is available - if 'directory_id' in node and node.directory_id: - data['directory'] = "ftp://localhost:8021" #TODO: implement document_directory.get_url - # get assosiated workflow if data['model']: wkf_ids = self.pool.get('workflow').search(cr, uid, [('osv', '=', data['model'])]) @@ -194,6 +190,10 @@ class process_process(osv.osv): refobj = pool.get(ref_model).browse(cr, uid, [ref_id], context)[0] fields = pool.get(ref_model).fields_get(cr, uid, context=context) + # chech whether directory_id from inherited from document module + if 'directory_id' in refobj and refobj.directory_id: + res['directory'] = self.pool.get('document.directory').get_resource_path(cr, uid, node.directory_id.id, ref_model, ref_id) + resource['name'] = refobj.name_get(context)[0][1] resource['perm'] = pool.get(ref_model).perm_read(cr, uid, [ref_id], context)[0] @@ -208,9 +208,7 @@ class process_process(osv.osv): rel = refobj[n] if rel and isinstance(rel, list) : rel = rel[0] - if isinstance(rel, basestring): - print "XXX: ", rel - try: # XXXXXXXXXXXXXXXXXXX + try: # XXX: rel has been reported as string (check it) _id = (rel or False) and rel.id _model = node['model'] update_relatives(r, _id, _model) From f1084ae218ae3fe7ecc10ce4b69963907a079c10 Mon Sep 17 00:00:00 2001 From: qdp Date: Tue, 30 Sep 2008 13:34:57 +0200 Subject: [PATCH 30/87] *little glitch on search function corrected bzr revid: qdp@tinyerp.com-20080930113457-8tkt7zidsha09zbu --- addons/base_iban/base_iban.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/base_iban/base_iban.py b/addons/base_iban/base_iban.py index 598e6af4552..870d7cb7317 100644 --- a/addons/base_iban/base_iban.py +++ b/addons/base_iban/base_iban.py @@ -54,7 +54,8 @@ class res_partner_bank(osv.osv): order, context=context, count=count) if filter(lambda x:x[0]=='acc_number' ,args): iban_value = filter(lambda x:x[0]=='acc_number' ,args)[0][2] - args1 = [('iban','ilike',iban_value)] + args1 = filter(lambda x:x[0]!='acc_number' ,args) + args1 += [('iban','ilike',iban_value)] res += super(res_partner_bank,self).search(cr, uid, args1, offset, limit, order, context=context, count=count) return res From 16ab1664c1be4f70d505afd4baf0e02a1e89f3a7 Mon Sep 17 00:00:00 2001 From: qdp Date: Tue, 30 Sep 2008 13:37:13 +0200 Subject: [PATCH 31/87] *typo corrected bzr revid: qdp@tinyerp.com-20080930113713-njs5mprnhzq49ki3 --- addons/l10n_be/__terp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_be/__terp__.py b/addons/l10n_be/__terp__.py index bf3ebe7cbb3..12a55fea2e2 100644 --- a/addons/l10n_be/__terp__.py +++ b/addons/l10n_be/__terp__.py @@ -30,7 +30,7 @@ "name" : "Belgium - Plan Comptable Minimum Normalise", "version" : "1.1", "author" : "Tiny", - "category" : "Localisation/Account charts", + "category" : "Localisation/Account Charts", "depends" : ["account", "account_report", "base_vat", "base_iban", "account_chart"], "init_xml" : [], From d980fbbb37476c8679e39334c38417d8243244bc Mon Sep 17 00:00:00 2001 From: qdp Date: Tue, 30 Sep 2008 13:38:05 +0200 Subject: [PATCH 32/87] *small improvmeents bzr revid: qdp@tinyerp.com-20080930113805-yoal4j3cxu6eey9y --- addons/account/account.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index b34cafe00df..e3d257b33fa 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1518,13 +1518,15 @@ account_subscription_line() class account_config_wizard(osv.osv_memory): _name = 'account.config.wizard' + def _get_charts(self, cr, uid, context): module_obj=self.pool.get('ir.module.module') - ids=module_obj.search(cr, uid, [('category_id', '=', 'Account charts'), ('state', '<>', 'installed')]) + ids=module_obj.search(cr, uid, [('category_id', '=', 'Account Charts'), ('state', '<>', 'installed')]) res=[(m.id, m.shortdesc) for m in module_obj.browse(cr, uid, ids)] res.append((-1, 'None')) res.sort(lambda x,y: cmp(x[1],y[1])) return res + _columns = { 'name':fields.char('Name', required=True, size=64, help="Name of the fiscal year as displayed on screens."), 'code':fields.char('Code', required=True, size=64, help="Name of the fiscal year as displayed in reports."), @@ -1538,7 +1540,8 @@ class account_config_wizard(osv.osv_memory): 'name': lambda *a: time.strftime('%Y'), 'date1': lambda *a: time.strftime('%Y-01-01'), 'date2': lambda *a: time.strftime('%Y-12-31'), - 'period':lambda *a:'month' + 'period':lambda *a:'month', + 'charts': lambda *a: -1, } def action_cancel(self,cr,uid,ids,conect=None): return { From bfef2c3c18e62b47284988e70798f20d29cc4cba Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Tue, 30 Sep 2008 17:43:32 +0530 Subject: [PATCH 33/87] small changes in hr_attendance/report/attendance_errors.rml hr_attendance/report/attendance_errors.sxw bzr revid: patelamit2003@gmail.com-20080930121332-28f1fek48ec52k5z --- .../hr_attendance/report/attendance_errors.rml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/addons/hr_attendance/report/attendance_errors.rml b/addons/hr_attendance/report/attendance_errors.rml index aacdde99e06..9d4180507ea 100644 --- a/addons/hr_attendance/report/attendance_errors.rml +++ b/addons/hr_attendance/report/attendance_errors.rml @@ -52,6 +52,7 @@ + @@ -87,11 +88,11 @@ [[ repeatIn(objects,'employee') ]] Attendance Errors - [[ employee.name ]] + [[ employee.name ]] - + Operation @@ -110,11 +111,11 @@ - + [[ repeatIn(lst(employee.id,data['form']['init_date'], data['form']['end_date'], data['form']['max_delay']), 'att') ]] - + [[ att['action'] ]] @@ -136,7 +137,7 @@ - + Total period: @@ -152,7 +153,7 @@ - (*) A positive delay means that the employee worked less than recorded. - (*) A negative delay means that the employee worked more than encoded. + (*) A positive delay means that the employee worked less than recorded. + (*) A negative delay means that the employee worked more than encoded. - + \ No newline at end of file From b331755e53acbf196ffc3b93c7924b951494ab58 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Tue, 30 Sep 2008 18:22:56 +0530 Subject: [PATCH 34/87] revert general ledger bzr revid: patelamit2003@gmail.com-20080930125256-bsxv3j2gzn5o3mw2 --- addons/account/report/general_ledger.rml | 332 ++++++++++++++++------- 1 file changed, 234 insertions(+), 98 deletions(-) diff --git a/addons/account/report/general_ledger.rml b/addons/account/report/general_ledger.rml index c7d8228a527..63ef37e3991 100755 --- a/addons/account/report/general_ledger.rml +++ b/addons/account/report/general_ledger.rml @@ -33,18 +33,20 @@ - + - + + + @@ -52,6 +54,7 @@ + @@ -88,110 +91,243 @@ + [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] + + + Date + + + Partner + + + Ref + + + Mvt + + + Entry Label + + + Debit + + + Crebit + + + Balance + + + + [[ repeatIn(objects, 'a') ]] + [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]] + + + + + + + [[ o.code ]] [[ o.name ]] + + + [[ sum_debit_account(o, data['form']) or '0.0' ]] + + + [[sum_credit_account(o, data['form']) or '0.0' ]] + + + [[sum_solde_account(o, data['form']) or '0.0' ]] + + + + + + + [[ data['form']['soldeinit'] == True or removeParentNode('tr') ]] + + + + + + Balance Initial + + + + + + + + + + + + [[ o.init_debit or '0.0' ]] + + + [[ o.init_credit or '0.0' ]] + + + [[ (o.init_debit - o.init_credit) or '0.0' ]] + + + + [[ repeatIn(lines(o, data['form']), 'line') ]] + + [[ line['date'] ]] + + + + [[ line['partner'] ]] + + + [[ line['ref'] ]] + + + [[ line['move'] ]] + + + [[ line['name'] ]] + + + [[ line['debit'] and line['debit'] or '0.0' ]] + + + [[ line['credit'] and line['credit'] or '0.0' ]] + + + [[ line['progress'] and line['progress'] or '0.0' ]] + + + + + + + + + [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] + + + Date + + + Partner + + + Ref + + + Mvt + + + Entry Label + + + Debit + + + Crebit + + + Balance + + + Currency + - -
- - [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]] - - Date - Partner - Ref - Mvt - Entry Label - Debit - Crebit - Balance + [[ repeatIn(objects, 'a') ]] - [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]] - + [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]] + + + + + + + [[ o.code ]] [[ o.name ]] + + + [[ sum_debit_account(o, data['form']) or '0.0' ]] + + + [[sum_credit_account(o, data['form']) or '0.0' ]] + + + [[sum_solde_account(o, data['form']) or '0.0' ]] + + + + + + [[ data['form']['soldeinit'] == True or removeParentNode('tr') ]] + + + + + + Balance Initial + + + + + + + + + + + + [[ o.init_debit or '0.0' ]] + + + [[ o.init_credit or '0.0' ]] + + + [[ (o.init_debit - o.init_credit) or '0.0' ]] + + + + + + + [[ repeatIn(lines(o, data['form']), 'line') ]] - - - [[ o.code ]] [[ o.name ]] - - [[ sum_debit_account(o, data['form']) or '0.0' ]] - [[sum_credit_account(o, data['form']) or '0.0' ]] - [[sum_solde_account(o, data['form']) or '0.0' ]] - - - [[ data['form']['soldeinit'] == True or removeParentNode('tr') ]] - Balance Initial - - [[ o.init_debit or '0.0' ]] - [[ o.init_credit or '0.0' ]] - [[ (o.init_debit - o.init_credit) or '0.0' ]] - - + [[ line['date'] ]] - - - [[ repeatIn(lines(o, data['form']), 'line') ]] - [[ line['date'] ]] - [[ line['partner'] ]] - [[ line['ref'] ]] - [[ line['move'] ]] - [[ line['name'] ]] - [[ line['debit'] and line['debit'] or '0.0' ]] - [[ line['credit'] and line['credit'] or '0.0' ]] - [[ line['progress'] and line['progress'] or '0.0' ]] - - -
- - - - [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]] - - Date - Partner - Ref - Mvt - Entry Label - Debit - Crebit - Balance - Currency - - [[ repeatIn(objects, 'a') ]] - [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]] - - - - [[ o.code ]] [[ o.name ]] - - [[ sum_debit_account(o, data['form']) or '0.0' ]] - [[sum_credit_account(o, data['form']) or '0.0' ]] - [[sum_solde_account(o, data['form']) or '0.0' ]] - [[ sum_currency_amount_account(o, data['form']) or '0.0' ]] - - - [[ data['form']['soldeinit'] == True or removeParentNode('tr') ]] - Balance Initial - - [[ o.init_debit or '0.0' ]] - [[ o.init_credit or '0.0' ]] - [[ (o.init_debit - o.init_credit) or '0.0' ]] - - - + [[ line['partner'] ]] + + [[ line['ref'] ]] + + + [[ line['move'] ]] + + + [[ line['name'] ]] + + + [[ line['debit'] and line['debit'] or '0.0' ]] + + + [[ line['credit'] and line['credit'] or '0.0' ]] + + + [[ line['progress'] and line['progress'] or '0.0' ]] + + + [[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] ]] + + + - - [[ repeatIn(lines(o, data['form']), 'line') ]] - [[ line['date'] ]] - [[ line['partner'] ]] - [[ line['ref'] ]] - [[ line['move'] ]] - [[ line['name'] ]] - [[ line['debit'] and line['debit'] or '0.0' ]] - [[ line['credit'] and line['credit'] or '0.0' ]] - [[ line['progress'] and line['progress'] or '0.0' ]] - [[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] ]] + + -
- +
+
+ + + From ebd7b8478ccae3117e14478c087ddc3596fc9ae8 Mon Sep 17 00:00:00 2001 From: Harshad Modi Date: Tue, 30 Sep 2008 18:35:48 +0530 Subject: [PATCH 35/87] taken report_document from trunk bzr revid: hmo@tinyerp.com-20080930130548-kem2sy40xmgyxm16 --- addons/document/document.py | 35 ++- addons/report_document/__init__.py | 4 + addons/report_document/__terp__.py | 20 ++ addons/report_document/report_document.py | 155 ++++++++++ .../report_document/report_document_view.xml | 288 ++++++++++++++++++ 5 files changed, 494 insertions(+), 8 deletions(-) create mode 100644 addons/report_document/__init__.py create mode 100644 addons/report_document/__terp__.py create mode 100644 addons/report_document/report_document.py create mode 100644 addons/report_document/report_document_view.xml diff --git a/addons/document/document.py b/addons/document/document.py index 1a391ed4a29..b28b81af7d9 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -194,13 +194,6 @@ class node_class(object): path = self.path[1:] return path -class document_directory_node(osv.osv): - _inherit = 'process.node' - _columns = { - 'directory_id': fields.many2one('document.directory', 'Document directory', ondelete="set null"), - } -document_directory_node() - class document_directory(osv.osv): _name = 'document.directory' _description = 'Document directory' @@ -233,6 +226,25 @@ class document_directory(osv.osv): ('dirname_uniq', 'unique (name,parent_id,ressource_id,ressource_parent_type_id)', 'The directory name must be unique !') ] + def get_resource_path(self,cr,uid,res_model,res_id): + # to be need test + path=[] + def _parent(dir_id): + parent=self.browse(cr,uid,dir_id) + if parent.parent_id: + _parent(parent.parent_id.id) + else: + path.append(parent.name) + return path + model_ids=self.pool.get('ir.model').search(cr,uid,[('model','=',res_model)]) + directory_ids=self.search(cr,uid,[('ressource_type_id','=',model_ids[0]),('ressource_id','=',res_id)]) + if len(directory_ids): + path=parent(directory_ids[0]) + direc=self.browse(cr,uid,directory_ids)[0] + path.append(direc.name) + path.append(self.pool.get(direc.ressource_type_id.model).browse(cr,uid,res_id).name) + return "ftp://localhost:8021/"+cr.dbname+'/'.join(path) + return False def _check_duplication(self, cr, uid,vals): if 'name' in vals: where=" name='%s'"% (vals['name']) @@ -351,6 +363,13 @@ class document_directory(osv.osv): document_directory() +class document_directory_node(osv.osv): + _inherit = 'process.node' + _columns = { + 'directory_id': fields.many2one('document.directory', 'Document directory', ondelete="set null"), + } +document_directory_node() + class document_directory_content(osv.osv): _name = 'document.directory.content' _description = 'Directory Content' @@ -572,4 +591,4 @@ class document_file(osv.osv): except: pass return super(document_file, self).unlink(cr, uid, ids, context) -document_file() +document_file() diff --git a/addons/report_document/__init__.py b/addons/report_document/__init__.py new file mode 100644 index 00000000000..ca50266ac0c --- /dev/null +++ b/addons/report_document/__init__.py @@ -0,0 +1,4 @@ +# -*- encoding: utf-8 -*- +import report_document +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/report_document/__terp__.py b/addons/report_document/__terp__.py new file mode 100644 index 00000000000..f0e19fe4de9 --- /dev/null +++ b/addons/report_document/__terp__.py @@ -0,0 +1,20 @@ +# -*- encoding: utf-8 -*- +{ + "name" : "Document Management - Reporting", + "version" : "1.0", + "author" : "Tiny", + "depends" : ["document"], + "category" : "Generic Modules/Document Management", + "description": """ + Reporting for the Document Management module: + * Files by my + * Files by all users + """, + "init_xml" : [], + "demo_xml" : [], + "update_xml" : ["report_document_view.xml"], + "active": False, + "installable": True + } +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/report_document/report_document.py b/addons/report_document/report_document.py new file mode 100644 index 00000000000..1743f6921c7 --- /dev/null +++ b/addons/report_document/report_document.py @@ -0,0 +1,155 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Copyright (c) 2004-2006 TINY SPRL. (http://tiny.be) All Rights Reserved. +# +# $Id: sale.py 1005 2005-07-25 08:41:42Z nicoe $ +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# 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 2 +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +from osv import fields,osv +import time + + +class report_document_user(osv.osv): + _name = "report.document.user" + _description = "Files details by Users" + _auto = False + _columns = { + 'name': fields.date('Month', readonly=True), + 'month': fields.char('Month', size=24,readonly=True), + 'user_id':fields.integer('Owner', readonly=True), + 'user':fields.char('User',size=64,readonly=True), + 'file_title': fields.char('File Name',size=64,readonly=True), + 'directory': fields.char('Directory',size=64,readonly=True), + 'create_date': fields.datetime('Date Created', readonly=True), + 'change_date': fields.datetime('Modified Date', readonly=True), + 'file_size': fields.integer('File Size', readonly=True), + 'nbr':fields.integer('# of Files', readonly=True), + 'type':fields.char('Directory Type',size=64,readonly=True), + 'partner':fields.char('Partner',size=64,readonly=True), + } + def init(self, cr): + cr.execute(""" + create or replace view report_document_user as ( + select + min(f.id) as id, + f.user_id as user_id, + u.name as user, + count(*) as nbr, + to_char(f.create_date,'YYYY-MM')||'-'||'01' as name, + d.name as directory, + f.create_date as create_date, + f.file_size as file_size, + min(f.title) as file_title, + min(d.type) as type, + min(EXTRACT(MONTH FROM f.create_date)||'-'||substring(to_char(f.create_date,'YY-Month-DD') from 4 for 9)) as month, + f.write_date as change_date + from ir_attachment f + left join document_directory d on (f.parent_id=d.id and d.name<>'') + inner join res_users u on (f.user_id=u.id) + group by d.name,f.parent_id,d.type,f.create_date,f.user_id,f.file_size,u.name,d.type,f.write_date + ) + """) +report_document_user() + +class report_files_partenr(osv.osv): + _name = "report.files.partenr" + _description = "Files details by Partners" + _auto = False + _columns = { + 'name': fields.date('Month', readonly=True), + 'file_title': fields.char('File Name',size=64,readonly=True), + 'directory': fields.char('Directory',size=64,readonly=True), + 'create_date': fields.datetime('Date Created', readonly=True), + 'change_date': fields.datetime('Modified Date', readonly=True), + 'file_size': fields.integer('File Size', readonly=True), + 'nbr':fields.integer('# of Files', readonly=True), + 'type':fields.char('Directory Type',size=64,readonly=True), + 'partner':fields.char('Partner',size=64,readonly=True), + } + def init(self, cr): + cr.execute(""" + create or replace view report_files_partenr as ( + select min(f.id) as id,count(*) as nbr,min(to_char(f.create_date,'YYYY-MM')||'-'||'01') as name,min(f.title) as file_title,p.name as partner from ir_attachment f inner join res_partner p on (f.partner_id=p.id) group by p.name + ) + """) +report_files_partenr() + +class report_document_file(osv.osv): + _name = "report.document.file" + _description = "Files details by Directory" + _auto = False + _columns = { + 'file_size': fields.integer('File Size', readonly=True), + 'nbr':fields.integer('# of Files', readonly=True), + 'month': fields.char('Month', size=24,readonly=True), + } + _order = "month" + def init(self, cr): + cr.execute(""" + create or replace view report_document_file as ( + select min(f.id) as id,count(*) as nbr, + min(EXTRACT(MONTH FROM f.create_date)||'-'||substring(to_char(f.create_date,'YY-Month-DD') from 4 for 9)) as month, + sum(f.file_size) as file_size + from ir_attachment f + group by EXTRACT(MONTH FROM f.create_date) + ) + """) + +report_document_file() + +class report_document_wall(osv.osv): + _name = "report.document.wall" + _description = "Users that did not inserted documents since one month" + _auto = False + _columns = { + 'name': fields.date('Month', readonly=True), + 'user_id':fields.many2one('res.users', 'Owner',readonly=True), + 'user':fields.char('User',size=64,readonly=True), + 'month': fields.char('Month', size=24,readonly=True), + 'file_name':fields.char('Last Posted File Name',size=64,readonly=True), + 'last':fields.datetime('Last Posted Time', readonly=True), + } + + def init(self, cr): + cr.execute(""" + create or replace view report_document_wall as ( + select max(f.id) as id, + min(title) as file_name, + to_char(min(f.create_date),'YYYY-MM-DD HH24:MI:SS') as last, + f.user_id as user_id,f.user_id as user, + substring(to_char(f.create_date,'YY-Month-DD') from 4 for 9) as month + from ir_attachment f + where create_date in ( + select max(create_date) + from ir_attachment i + inner join res_users u on (i.user_id=u.id) + group by i.user_id) group by f.user_id,f.create_date + having (to_date(substring(CURRENT_DATE for 10),'YYYY-MM-DD') - to_date(substring(f.create_date for 10),'YYYY-MM-DD')) > 30 + ) + """) +report_document_wall() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/report_document/report_document_view.xml b/addons/report_document/report_document_view.xml new file mode 100644 index 00000000000..c0a67d101e4 --- /dev/null +++ b/addons/report_document/report_document_view.xml @@ -0,0 +1,288 @@ + + + + + + report.document.user.form + report.document.user + form + +
+ + + + + + + + +
+ + + + report.document.user.tree + report.document.user + tree + + + + + + + + + + + + + + + My files (This months) + report.document.user + form + tree + [('user_id','=',uid),('name','=',time.strftime('%Y-%m-01'))] + + + + + + + + + My files (All months) + report.document.user + form + tree,graph + [('user_id','=',uid)] + + + + + + + All Users files (This month) + report.document.user + form + tree,graph + [('name','=',time.strftime('%Y-%m-01'))] + + + + + + All Users files (All months) + report.document.user + form + tree + + + + + + + report.document.wall.form + report.document.wall + form + +
+ + + + + + +
+ + + + report.document.wall.tree + report.document.wall + tree + + + + + + + + + + + + Wall of Shame + report.document.wall + form + tree,form + + + + + + + + report.document.resource.graph + report.document.user + graph + + + + + + + + + + + + + + + + + + + + + + + Files by Resource Type + report.document.user + + form + tree + + + + + + report.document.user.graph + report.document.file + graph + + + + + + + + + + report.document.user.tree + report.document.file + tree + + + + + + + + + File Size by Month + report.document.file + + form + tree + + + + + + + report.file.month.graph + report.document.user + graph + + + + + + + + + + + + + report.file.month.tree + report.document.user + tree + + + + + + + + + + Files by Month + report.document.user + + form + tree + + + + + + + report.document.user.graph + report.document.user + graph + + + + + + + + + + Files By Users + report.document.user + + form + tree + + + + + + + view.files.partenr.graph + report.files.partenr + graph + + + + + + + + + + + view.files.partner.tree + report.files.partenr + tree + + + + + + + + + + Files Per Month + report.files.partenr + + form + tree + + + +
+
From 8c3108a8296ec581c734049d41772cad24e18f77 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 30 Sep 2008 15:07:26 +0200 Subject: [PATCH 36/87] bugfix with po file import bzr revid: christophe@tinyerp.com-20080930130726-j4n4gmlgz8wv92fv --- bin/tools/translate.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/tools/translate.py b/bin/tools/translate.py index 28c8667b569..c0bc083f13d 100644 --- a/bin/tools/translate.py +++ b/bin/tools/translate.py @@ -79,6 +79,7 @@ class TinyPoFile(object): def __iter__(self): self.buffer.seek(0) self.lines = self.buffer.readlines() + self.lines.append('') # ensure that the file ends with at least an empty line self.first = True self.tnrs= [] return self From b2ff30334c9b164fc0d63d2d90d6862f1b81d3b3 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 30 Sep 2008 15:17:41 +0200 Subject: [PATCH 37/87] remove unused group bzr revid: christophe@tinyerp.com-20080930131741-xnw8lwaxsqty9kvz --- bin/addons/base/security/base_security.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bin/addons/base/security/base_security.xml b/bin/addons/base/security/base_security.xml index c72f31418f3..b311a0bac95 100644 --- a/bin/addons/base/security/base_security.xml +++ b/bin/addons/base/security/base_security.xml @@ -18,10 +18,6 @@ Employee - - Account Manager - - Useability / Extended View From c5524c600cf8bc62bfc87cd7765551a5731e7463 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 30 Sep 2008 15:17:54 +0200 Subject: [PATCH 38/87] better error message bzr revid: christophe@tinyerp.com-20080930131754-92b1go3t22yk7zmn --- bin/addons/base/ir/ir_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/addons/base/ir/ir_model.py b/bin/addons/base/ir/ir_model.py index 1bb1fea3f27..0a9f71b3510 100644 --- a/bin/addons/base/ir/ir_model.py +++ b/bin/addons/base/ir/ir_model.py @@ -369,7 +369,7 @@ class ir_model_data(osv.osv): def _get_id(self,cr, uid, module, xml_id): ids = self.search(cr, uid, [('module','=',module),('name','=', xml_id)]) - assert len(ids)==1, '%d reference(s) to %s. You should have one and only one !' % (len(ids),xml_id) + assert len(ids)==1, '%d reference(s) to %s.%s. You should have one and only one !' % (len(ids), module, xml_id) return ids[0] _get_id = tools.cache()(_get_id) From 4c1d7c6ab695e940d98353876b47a59e5079ea86 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Tue, 30 Sep 2008 19:04:22 +0530 Subject: [PATCH 39/87] tax report prob solved.(Amit Patel) account_analytic_profit prob solved...(Vinay Rana) bzr revid: patelamit2003@gmail.com-20080930133422-2szols5ztikx82o7 --- addons/account/wizard/wizard_vat.py | 102 +++-- .../report/account_analytic_profit.rml | 355 ++++++++---------- 2 files changed, 208 insertions(+), 249 deletions(-) mode change 100644 => 100755 addons/account/wizard/wizard_vat.py diff --git a/addons/account/wizard/wizard_vat.py b/addons/account/wizard/wizard_vat.py old mode 100644 new mode 100755 index 2d72b0e445f..62a22e00af4 --- a/addons/account/wizard/wizard_vat.py +++ b/addons/account/wizard/wizard_vat.py @@ -1,9 +1,6 @@ -# -*- encoding: utf-8 -*- ############################################################################## # -# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved. -# -# $Id$ +# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved. # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential @@ -34,68 +31,65 @@ import pooler dates_form = '''
- - - - - + + + + + + ''' dates_fields = { - 'company_id': {'string': 'Company', 'type': 'many2one', - 'relation': 'res.company', 'required': True}, - 'period_id': {'string':'Period', 'type':'many2one', - 'relation': 'account.period', 'required':True}, - 'based_on':{'string':'Base on', 'type':'selection', 'selection':[ - ('invoices','Invoices'), - ('payments','Payments'), - ], 'required':True, 'default': lambda *a: 'invoices'}, + 'company_id': {'string': 'Company', 'type': 'many2one', + 'relation': 'res.company', 'required': True}, + 'based_on':{'string':'Base on', 'type':'selection', 'selection':[ + ('invoices','Invoices'), + ('payments','Payments'), + ], 'required':True, 'default': lambda *a: 'invoices'}, + 'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'}, + } class wizard_report(wizard.interface): - def _get_defaults(self, cr, uid, data, context): - pool = pooler.get_pool(cr.dbname) - period_obj = pool.get('account.period') - data['form']['period_id'] = period_obj.find(cr, uid)[0] + def _get_defaults(self, cr, uid, data, context): + pool = pooler.get_pool(cr.dbname) + period_obj = pool.get('account.period') - user = pool.get('res.users').browse(cr, uid, uid, context=context) - if user.company_id: - company_id = user.company_id.id - else: - company_id = pool.get('res.company').search(cr, uid, - [('parent_id', '=', False)])[0] - data['form']['company_id'] = company_id + user = pool.get('res.users').browse(cr, uid, uid, context=context) + if user.company_id: + company_id = user.company_id.id + else: + company_id = pool.get('res.company').search(cr, uid, + [('parent_id', '=', False)])[0] + data['form']['company_id'] = company_id - return data['form'] + return data['form'] - states = { - 'init': { - 'actions': [_get_defaults], - 'result': { - 'type': 'form', - 'arch': dates_form, - 'fields': dates_fields, - 'state': [ - ('end', 'Cancel'), - ('report', 'Print VAT Decl.') - ] - } - }, - 'report': { - 'actions': [], - 'result': { - 'type': 'print', - 'report': 'account.vat.declaration', - 'state':'end' - } - } - } + states = { + 'init': { + 'actions': [_get_defaults], + 'result': { + 'type': 'form', + 'arch': dates_form, + 'fields': dates_fields, + 'state': [ + ('end', 'Cancel'), + ('report', 'Print VAT Decl.') + ] + } + }, + 'report': { + 'actions': [], + 'result': { + 'type': 'print', + 'report': 'account.vat.declaration', + 'state':'end' + } + } + } wizard_report('account.vat.declaration') - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/hr_timesheet_invoice/report/account_analytic_profit.rml b/addons/hr_timesheet_invoice/report/account_analytic_profit.rml index 0fc27c8c1a1..897bb26da55 100644 --- a/addons/hr_timesheet_invoice/report/account_analytic_profit.rml +++ b/addons/hr_timesheet_invoice/report/account_analytic_profit.rml @@ -10,11 +10,11 @@
- + - + @@ -28,7 +28,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -52,37 +52,35 @@ - - + - - + + + + + + + - + + + + + + + - - - - - + - - - - - - - - @@ -92,7 +90,6 @@ - @@ -113,15 +110,18 @@ - + + + + - + - + @@ -129,240 +129,205 @@ Invoice rate by user - + - + - + - + - Period from startdate + Period from startdate - Period to enddate + Period to enddate - Currency + Currency - + - [[ data['form']['date_from'] ]] + [[ data['form']['date_from'] ]] - [[ data['form']['date_to'] ]] + [[ data['form']['date_to'] ]] - [[ company.currency_id.name ]] + [[ company.currency_id.name ]] - + - + - + - Employee + Employee or Journal Name - + Units + + + Theorical + + + Income + + + Cost + + + Profit + + + Eff. + + + + + + + + + + Totals: + + + [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] + + + - Units + [[ reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - Theorical + [[ reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - Income + [[ reduce(lambda x, y: x+y['profit'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - Cost - - - Profit - - - Eff. + [[ round(reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)/reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)* -100, 2)]] % - - - +
- [[ repeatIn(user_ids(lines(data['form'])), 'e') ]] - + [[ repeatIn(user_ids(lines(data['form'])), 'e') ]] + - [[ e.name ]] + [[ e.name ]] + + + [[ repeatIn(journal_ids(data['form'], e.id), 'j') ]] + + + [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], [j.id], [e.id]), 0) ]] + + + [[ reduce(lambda x, y: x+y['amount_th'], line(data['form'], [j.id], [e.id]), 0) ]] + + + [[ reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) ]] + + + [[ reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) ]] + + + [[ reduce(lambda x, y: x+y['profit'], line(data['form'], [j.id], [e.id]), 0) ]] + + + [[ '%d' % (reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) / reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) * 100.0,)]] % + + - [[ repeatIn(journal_ids(data['form'], e.id), 'j') ]] [[ j.name ]] - - - - - - - - - [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], [j.id], [e.id]), 0) ]] - - - [[ reduce(lambda x, y: x+y['amount_th'], line(data['form'], [j.id], [e.id]), 0) ]] - - - [[ reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) ]] - - - [[ reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) ]] - - - [[ reduce(lambda x, y: x+y['profit'], line(data['form'], [j.id], [e.id]), 0) ]] - - - [[ '%d' % (reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) / reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) * 100.0,)]] % - - - - - [[ repeatIn(line(data['form'], [j.id], [e.id]), 'l') ]] - [[ l['name'] ]] - - - [[ l['unit_amount'] ]] - - - [[ l['amount_th'] ]] - - - [[ l['amount'] ]] - - - [[ l['cost'] ]] - - - [[ l['profit'] ]] - - - [[ l['eff'] ]] % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + + + + + + + + + + + + + + + + + + + + + -
- - - - Totals - - - - - - - - - - - [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - - - - - - - - [[ reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - - - [[ reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - - - [[ reduce(lambda x, y: x+y['profit'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - - - [[ round(reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)/reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)* -100, 2)]] % - - - - - - - - - - - - -
+ [[ repeatIn(line(data['form'], [j.id],[e.id]), 'l') ]] + + + + [[ l['name'] ]] + + + [[ l['unit_amount'] ]] + + + [[ l['amount_th'] ]] + + + [[ l['amount'] ]] + + + [[ l['cost'] ]] + + + [[ l['profit'] ]] + + + [[ l['eff'] ]] % + + + + + +
+ + +
- + \ No newline at end of file From ad2129bfcbd4bf03c034ddcec6359ec8a44d8b1d Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Tue, 30 Sep 2008 19:11:18 +0530 Subject: [PATCH 40/87] HR Expense (Vinay Rana's task) bzr revid: patelamit2003@gmail.com-20080930134118-drly4bsvdqer9xtv --- addons/hr_expense/report/expense.rml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_expense/report/expense.rml b/addons/hr_expense/report/expense.rml index e39874f84f3..7ab564bf011 100644 --- a/addons/hr_expense/report/expense.rml +++ b/addons/hr_expense/report/expense.rml @@ -159,13 +159,13 @@ Ref. - Unit Price + Unit Price Qty - Total + Total Price From a976b3f99b56ab38b3f63c29f7c411fe07248a4b Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 30 Sep 2008 16:23:33 +0200 Subject: [PATCH 41/87] fix view bzr revid: christophe@tinyerp.com-20080930142333-u9aycq47tee4zaa8 --- addons/report_intrastat/report_intrastat_view.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/report_intrastat/report_intrastat_view.xml b/addons/report_intrastat/report_intrastat_view.xml index 50349d32d87..9432091beca 100644 --- a/addons/report_intrastat/report_intrastat_view.xml +++ b/addons/report_intrastat/report_intrastat_view.xml @@ -96,7 +96,8 @@ [('name','=',time.strftime('%Y-%m-01'))] - + + Intrastat @@ -106,6 +107,7 @@ tree - + + From c66e4e63bb7b73f4975c9a04652f9269ac16c336 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 30 Sep 2008 16:23:50 +0200 Subject: [PATCH 42/87] fix hr security bzr revid: christophe@tinyerp.com-20080930142350-o225bunnk5f80s65 --- addons/hr/__terp__.py | 4 ++-- addons/hr/security/ir.model.access.csv | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/hr/__terp__.py b/addons/hr/__terp__.py index fb8873e5fc7..02d7f2d6f43 100644 --- a/addons/hr/__terp__.py +++ b/addons/hr/__terp__.py @@ -47,8 +47,8 @@ "hr_department_demo.xml", ], "update_xml" : [ -# "security/hr_security.xml", -# "security/ir.model.access.csv", + "security/hr_security.xml", + "security/ir.model.access.csv", "hr_view.xml", "hr_wizard.xml", "hr_department_view.xml", diff --git a/addons/hr/security/ir.model.access.csv b/addons/hr/security/ir.model.access.csv index 507de13f8da..743cbce21c2 100644 --- a/addons/hr/security/ir.model.access.csv +++ b/addons/hr/security/ir.model.access.csv @@ -3,8 +3,6 @@ access_hr_timesheet_group,hr.timesheet.group,model_hr_timesheet_group,hr.group_h access_hr_employee_category,hr.employee.category,model_hr_employee_category,hr.group_hr_user,1,0,0,0 access_hr_employee,hr.employee,model_hr_employee,hr.group_hr_user,1,1,1,1 access_hr_timesheet,hr.timesheet,model_hr_timesheet,hr.group_hr_user,1,1,1,1 -access_hr_action_reason,hr.action.reason,model_hr_action_reason,hr.group_hr_user,1,1,1,1 -access_hr_attendance,hr.attendance,model_hr_attendance,hr.group_hr_user,1,1,1,1 access_hr_department,hr.department,model_hr_department,hr.group_hr_user,1,0,0,0 access_hr_timesheet_group_manager,hr.timesheet.group.manager,model_hr_timesheet_group,hr.group_hr_manager,1,1,1,1 access_hr_employee_category_manager,hr.employee.category.manager,model_hr_employee_category,hr.group_hr_manager,1,1,1,1 From 8c66ca9e28f977bca637d2e1d797cae82f14eecb Mon Sep 17 00:00:00 2001 From: qdp Date: Wed, 1 Oct 2008 15:57:13 +0200 Subject: [PATCH 43/87] *bugfixed the _rec_name of payment_order bzr revid: qdp@tinyerp.com-20081001135713-9ucvphqs78r81qj1 --- addons/account_payment/payment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_payment/payment.py b/addons/account_payment/payment.py index 22ca132453c..76f1fdb6319 100644 --- a/addons/account_payment/payment.py +++ b/addons/account_payment/payment.py @@ -82,7 +82,7 @@ payment_mode() class payment_order(osv.osv): _name = 'payment.order' _description = 'Payment Order' - _rec_name = 'date' + _rec_name = 'reference' def get_wizard(self,type): logger = netsvc.Logger() From 4bbe2cfc1fc20bd0590ac35c6f4591a191d7b95d Mon Sep 17 00:00:00 2001 From: qdp Date: Wed, 1 Oct 2008 16:00:03 +0200 Subject: [PATCH 44/87] *added an integrity check of the iban account number *added an automatic formatting of the iban account number in order to comply with schema *added a function the compute the account bank number from the iban account number accordingly to the country rule *added comments *overall improvements bzr revid: qdp@tinyerp.com-20081001140003-pgvbxcr52jpwxnj6 --- addons/base_iban/base_iban.py | 87 ++++++++++++++++++++++++++++++++--- 1 file changed, 80 insertions(+), 7 deletions(-) diff --git a/addons/base_iban/base_iban.py b/addons/base_iban/base_iban.py index 870d7cb7317..d7ccef61ad2 100644 --- a/addons/base_iban/base_iban.py +++ b/addons/base_iban/base_iban.py @@ -31,11 +31,52 @@ import netsvc from osv import fields, osv +def _format_iban(string): + ''' + This function removes all characters from given 'string' that isn't a alpha numeric and converts it to lower case. + ''' + res = "" + for char in string: + if char.isalnum(): + res += char.lower() + return res + class res_partner_bank(osv.osv): _inherit = "res.partner.bank" - _columns = { - 'iban': fields.char('IBAN', size=34, readonly=True, help="International Bank Account Number"), - } + + def create(self, cr, uid, vals, context={}): + #overwrite to format the iban number correctly + if vals.has_key('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'): + vals['iban'] = _format_iban(vals['iban']) + return super(res_partner_bank, self).write(cr, uid, ids, vals, context) + + def check_iban(self, cr, uid, ids): + ''' + Check the IBAN number + ''' + for bank_acc in self.browse(cr, uid, ids): + if not bank_acc.iban: + continue + iban =_format_iban(bank_acc.iban) + #the four first digits have to be shifted to the end + iban = iban[4:] + iban[:4] + #letters have to be transformed into numbers (a = 10, b = 11, ...) + iban2 = "" + for char in iban: + if char.isalpha(): + iban2 += str(ord(char)-87) + else: + iban2 += char + #iban is correct if modulo 97 == 1 + if not int(iban2) % 97 == 1: + return False + return True def name_get(self, cr, uid, ids, context=None): res = [] @@ -48,18 +89,50 @@ class res_partner_bank(osv.osv): res += super(res_partner_bank, self).name_get(cr, uid, to_check_ids, context) return res - def search(self, cr, uid, args, offset=0, limit=None, order=None, - context=None, count=False): - res = super(res_partner_bank,self).search(cr, uid, args, offset, limit, - order, context=context, count=count) + def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): + #overwrite the search method in order to search not only on bank type == basic account number but also on type == iban + res = super(res_partner_bank,self).search(cr, uid, args, offset, limit, order, context=context, count=count) if filter(lambda x:x[0]=='acc_number' ,args): + #get the value of the search iban_value = filter(lambda x:x[0]=='acc_number' ,args)[0][2] + #get the other arguments of the search args1 = filter(lambda x:x[0]!='acc_number' ,args) + #add the new criterion args1 += [('iban','ilike',iban_value)] + #append the results to the older search res += super(res_partner_bank,self).search(cr, uid, args1, offset, limit, order, context=context, count=count) return res + def get_bban_from_iban(self, cr, uid, ids, context=None): + ''' + This function returns the bank account number computed from the iban account number, thanks to the mapping_list dictionary that contains the rules associated to its country. + ''' + res = {} + mapping_list = { + #TODO add rules for others countries + 'be': lambda x: x[4:], + 'fr': lambda x: x[14:], + 'ch': lambda x: x[9:], + 'gb': lambda x: x[14:], + } + for record in self.browse(cr, uid, ids, context): + if not record.iban: + res[record.id] = False + continue + res[record.id] = False + for code, function in mapping_list.items(): + if record.iban.lower().startswith(code): + res[record.id] = function(record.iban) + break + return res + + _columns = { + 'iban': fields.char('IBAN', size=34, readonly=True, help="International Bank Account Number"), + } + + _constraints = [(check_iban, "The IBAN number doesn't seem to be correct.", ["iban"])] + res_partner_bank() From 5598a8380756c4fdcd47c53ace6fe4d7b4bfe76c Mon Sep 17 00:00:00 2001 From: qdp Date: Wed, 1 Oct 2008 17:15:29 +0200 Subject: [PATCH 45/87] *glicth corrected on wizard names bzr revid: qdp@tinyerp.com-20081001151529-nllwqi8fni274wzw --- addons/l10n_be/l10n_be_wizard.xml | 12 ++++++------ addons/l10n_be/wizard/account_vat_declaration.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/l10n_be/l10n_be_wizard.xml b/addons/l10n_be/l10n_be_wizard.xml index 5ae595ecc01..69dd19cb782 100644 --- a/addons/l10n_be/l10n_be_wizard.xml +++ b/addons/l10n_be/l10n_be_wizard.xml @@ -6,21 +6,21 @@ model="res.partner" name="list.vat.detail" menu="False" - id="base.partner_wizard_vat"/> + id="partner_wizard_vat"/> + id="partner_wizard_vat_menu"/> + id="wizard_xml_vat_declaration"/> diff --git a/addons/l10n_be/wizard/account_vat_declaration.py b/addons/l10n_be/wizard/account_vat_declaration.py index cd673b3e482..f71121adf57 100644 --- a/addons/l10n_be/wizard/account_vat_declaration.py +++ b/addons/l10n_be/wizard/account_vat_declaration.py @@ -98,4 +98,4 @@ class wizard_vat_declaration(wizard.interface): } } -wizard_vat_declaration('wizard.account.vat.declaration') +wizard_vat_declaration('wizard.account.xml.vat.declaration') From 524228e3f8c84b8727dcba1a9b3ef0fc4a98bbf6 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 2 Oct 2008 08:38:12 +0200 Subject: [PATCH 46/87] fix po file bzr revid: christophe@tinyerp.com-20081002063812-fg9ovw4l5ihkge5g --- addons/mrp/i18n/fr_FR.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/i18n/fr_FR.po b/addons/mrp/i18n/fr_FR.po index d031b2ae17c..3e96a958e75 100644 --- a/addons/mrp/i18n/fr_FR.po +++ b/addons/mrp/i18n/fr_FR.po @@ -1205,7 +1205,7 @@ msgstr "Index numériques" #. module: mrp #: field:mrp.routing,location_id:0 msgid "Production Location" -msgstr "Emplacement de production\\"" +msgstr "Emplacement de production" #. module: mrp #: selection:stock.warehouse.orderpoint,logic:0 From 48704ddb2c64b193e9c930c329224acc36adcd15 Mon Sep 17 00:00:00 2001 From: qdp Date: Thu, 2 Oct 2008 15:16:03 +0200 Subject: [PATCH 47/87] *added demo data for base_contact module bzr revid: qdp@tinyerp.com-20081002131603-9rfo6930115i6ab7 --- addons/base_contact/__terp__.py | 5 +- addons/base_contact/base_contact_demo.xml | 326 ++++++++++++++++++++++ 2 files changed, 329 insertions(+), 2 deletions(-) create mode 100644 addons/base_contact/base_contact_demo.xml diff --git a/addons/base_contact/__terp__.py b/addons/base_contact/__terp__.py index 3b1e3af9e69..a267a7631c0 100644 --- a/addons/base_contact/__terp__.py +++ b/addons/base_contact/__terp__.py @@ -13,15 +13,16 @@ *contacts working at several adresses (possibly for different partners), *contacts with possibly different functions for each of its job's addresses - It also add a new menuitem located in + It also add new menuitems located in Partners \ Contacts + Partners \ Functions Pay attention that this module converts the existing addresses into "addresses + contacts". It means that some fields of the addresses will be missing (like the contact name), since these are supposed to be defined in an other object. """, "depends" : ["base"], "init_xml" : [], - "demo_xml" : [], + "demo_xml" : ["base_contact_demo.xml"], "update_xml" : [ "security/ir.model.access.csv", 'base_contact_view.xml' diff --git a/addons/base_contact/base_contact_demo.xml b/addons/base_contact/base_contact_demo.xml new file mode 100644 index 00000000000..6efa01a7267 --- /dev/null +++ b/addons/base_contact/base_contact_demo.xml @@ -0,0 +1,326 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -1 + + + + + + + + + + + + 5 + + + + + + + 5 + + + + + + + 1 + + + From 8c1994a571aab2f55be8d7100c30bc2bcada58fc Mon Sep 17 00:00:00 2001 From: qdp Date: Thu, 2 Oct 2008 15:37:03 +0200 Subject: [PATCH 48/87] *typos corrected *added a wizard that check whenever a registration is confirmed that there is enough available places and the warn the user if no, giving him the choice to continue or cancell the registration's confirmation. bzr revid: qdp@tinyerp.com-20081002133703-vu7l6lqld6xkj094 --- addons/event/event.py | 13 +--- addons/event/event_view.xml | 4 +- addons/event/event_wizard.xml | 79 +++++++++---------- addons/event/wizard/__init__.py | 1 + addons/event/wizard/confirm_registration.py | 86 +++++++++++++++++++++ 5 files changed, 127 insertions(+), 56 deletions(-) create mode 100644 addons/event/wizard/confirm_registration.py diff --git a/addons/event/event.py b/addons/event/event.py index adfe5b04386..2450441349a 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -134,8 +134,8 @@ class event(osv.osv): 'date_begin': fields.datetime('Beginning date', required=True), 'date_end': fields.datetime('Ending date', required=True), 'state': fields.selection([('draft','Draft'),('confirm','Confirmed'),('done','Done'),('cancel','Canceled')], 'Status', readonly=True, required=True), - 'mail_auto_registr':fields.boolean('Mail Auto Register',help='A mail is send when the registration is confirmed'), - 'mail_auto_confirm':fields.boolean('Mail Auto Confirm',help='A mail is send when the event is confimed'), + 'mail_auto_registr':fields.boolean('Mail Auto Register',help='A mail is sent when the registration is confirmed'), + 'mail_auto_confirm':fields.boolean('Mail Auto Confirm',help='A mail is sent when the event is confimed'), 'mail_registr':fields.text('Mail Register',help='Template for the mail'), 'mail_confirm':fields.text('Mail Confirm',help='Template for the mail'), 'budget_id':fields.many2one('account.budget.post','Budget'), @@ -163,13 +163,6 @@ class event_registration(osv.osv): obj.create(cr, uid, data, context) return True - def button_reg_open(self, cr, uid, ids, *args): - self.write(cr, uid, ids, {'state':'open',}) - cases = self.browse(cr, uid, ids) - self._history(cr, uid, cases, 'Open', history=True) - self.mail_user(cr,uid,ids) - return True - def button_reg_close(self, cr, uid, ids, *args): self.write(cr, uid, ids, {'state':'done',}) cases = self.browse(cr, uid, ids) @@ -223,7 +216,7 @@ class event_registration(osv.osv): "badge_name":fields.char('Badge Name',size=128), "badge_partner":fields.char('Badge Partner',size=128), "invoice_label":fields.char("Label Invoice",size=128,required=True), - "tobe_invoiced":fields.boolean("To be Invoice"), + "tobe_invoiced":fields.boolean("To be Invoiced"), "invoice_id":fields.many2one("account.invoice","Invoice"), } _defaults = { diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index 081462b2675..f4f02d34b66 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -198,7 +198,7 @@
- + @@ -220,7 +220,7 @@