diff --git a/addons/account/account.py b/addons/account/account.py index fbbbfd64537..bf072507aa0 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -595,12 +595,15 @@ class account_account(osv.osv): res.append((record['id'], name)) return res - def copy(self, cr, uid, id, default={}, context=None, done_list=[], local=False): + def copy(self, cr, uid, id, default=None, context=None, done_list=None, local=False): + if default is None: + default = {} + else: + default = default.copy() + if done_list is None: + done_list = [] account = self.browse(cr, uid, id, context=context) new_child_ids = [] - if not default: - default = {} - default = default.copy() default.update(code=_("%s (copy)") % (account['code'] or '')) if not local: done_list = [] @@ -777,11 +780,14 @@ class account_journal(osv.osv): (_check_currency, 'Configuration error!\nThe currency chosen should be shared by the default accounts too.', ['currency','default_debit_account_id','default_credit_account_id']), ] - def copy(self, cr, uid, id, default={}, context=None, done_list=[], local=False): - journal = self.browse(cr, uid, id, context=context) - if not default: + def copy(self, cr, uid, id, default=None, context=None, done_list=None, local=False): + if default is None: default = {} - default = default.copy() + else: + default = default.copy() + if done_list is None: + done_list = [] + journal = self.browse(cr, uid, id, context=context) default.update( code=_("%s (copy)") % (journal['code'] or ''), name=_("%s (copy)") % (journal['name'] or ''), @@ -1178,7 +1184,7 @@ class account_fiscalyear(osv.osv): 'end_journal_period_id':fields.many2one('account.journal.period','End of Year Entries Journal', readonly=True), } - def copy(self, cr, uid, id, default={}, context=None): + def copy(self, cr, uid, id, default=None, context=None): default.update({ 'period_ids': [], 'end_journal_period_id': False @@ -1437,9 +1443,15 @@ class account_move(osv.osv): result = super(account_move, self).create(cr, uid, vals, context) return result - def copy(self, cr, uid, id, default={}, context=None): + def copy(self, cr, uid, id, default=None, context=None): + if context is None: + default = {} + else: + default = default.copy() if context is None: context = {} + else: + context = context.copy() default.update({ 'state':'draft', 'name':'/', @@ -2269,7 +2281,10 @@ class account_model(osv.osv): _defaults = { 'legend': lambda self, cr, uid, context:_('You can specify year, month and date in the name of the model using the following labels:\n\n%(year)s: To Specify Year \n%(month)s: To Specify Month \n%(date)s: Current Date\n\ne.g. My model on %(date)s'), } - def generate(self, cr, uid, ids, datas={}, context=None): + + def generate(self, cr, uid, ids, data=None, context=None): + if data is None: + data = {} move_ids = [] entry = {} account_move_obj = self.pool.get('account.move') @@ -2280,8 +2295,8 @@ class account_model(osv.osv): if context is None: context = {} - if datas.get('date', False): - context.update({'date': datas['date']}) + if data.get('date', False): + context.update({'date': data['date']}) move_date = context.get('date', time.strftime('%Y-%m-%d')) move_date = datetime.strptime(move_date,"%Y-%m-%d") @@ -2467,10 +2482,10 @@ class account_subscription_line(osv.osv): all_moves = [] obj_model = self.pool.get('account.model') for line in self.browse(cr, uid, ids, context=context): - datas = { + data = { 'date': line.date, } - move_ids = obj_model.generate(cr, uid, [line.subscription_id.model_id.id], datas, context) + move_ids = obj_model.generate(cr, uid, [line.subscription_id.model_id.id], data, context) tocheck[line.subscription_id.id] = True self.write(cr, uid, [line.id], {'move_id':move_ids[0]}) all_moves.extend(move_ids) @@ -3236,7 +3251,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): property_obj.create(cr, uid, vals, context=context) return True - def _install_template(self, cr, uid, template_id, company_id, code_digits=None, obj_wizard=None, acc_ref={}, taxes_ref={}, tax_code_ref={}, context=None): + def _install_template(self, cr, uid, template_id, company_id, code_digits=None, obj_wizard=None, acc_ref=None, taxes_ref=None, tax_code_ref=None, context=None): ''' This function recursively loads the template objects and create the real objects from them. @@ -3254,6 +3269,12 @@ class wizard_multi_charts_accounts(osv.osv_memory): * a last identical containing the mapping of tax code templates and tax codes :rtype: tuple(dict, dict, dict) ''' + if acc_ref is None: + acc_ref = {} + if taxes_ref is None: + taxes_ref = {} + if tax_code_ref is None: + tax_code_ref = {} template = self.pool.get('account.chart.template').browse(cr, uid, template_id, context=context) if template.parent_id: tmp1, tmp2, tmp3 = self._install_template(cr, uid, template.parent_id.id, company_id, code_digits=code_digits, acc_ref=acc_ref, taxes_ref=taxes_ref, tax_code_ref=tax_code_ref, context=context) @@ -3266,7 +3287,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): tax_code_ref.update(tmp3) return acc_ref, taxes_ref, tax_code_ref - def _load_template(self, cr, uid, template_id, company_id, code_digits=None, obj_wizard=None, account_ref={}, taxes_ref={}, tax_code_ref={}, context=None): + def _load_template(self, cr, uid, template_id, company_id, code_digits=None, obj_wizard=None, account_ref=None, taxes_ref=None, tax_code_ref=None, context=None): ''' This function generates all the objects from the templates @@ -3284,6 +3305,12 @@ class wizard_multi_charts_accounts(osv.osv_memory): * a last identical containing the mapping of tax code templates and tax codes :rtype: tuple(dict, dict, dict) ''' + if account_ref is None: + account_ref = {} + if taxes_ref is None: + taxes_ref = {} + if tax_code_ref is None: + tax_code_ref = {} template = self.pool.get('account.chart.template').browse(cr, uid, template_id, context=context) obj_tax_code_template = self.pool.get('account.tax.code.template') obj_acc_tax = self.pool.get('account.tax') diff --git a/addons/account/account_bank.py b/addons/account/account_bank.py index e44d2acd163..2323f8aaa8a 100644 --- a/addons/account/account_bank.py +++ b/addons/account/account_bank.py @@ -29,12 +29,12 @@ class bank(osv.osv): 'currency_id': fields.related('journal_id', 'currency', type="many2one", relation='res.currency', readonly=True, string="Currency", help="Currency of the related account journal."), } - def create(self, cr, uid, data, context={}): + def create(self, cr, uid, data, context=None): result = super(bank, self).create(cr, uid, data, context=context) self.post_write(cr, uid, [result], context=context) return result - def write(self, cr, uid, ids, data, context={}): + def write(self, cr, uid, ids, data, context=None): result = super(bank, self).write(cr, uid, ids, data, context=context) self.post_write(cr, uid, ids, context=context) return result @@ -53,7 +53,7 @@ class bank(osv.osv): data['currency_name'] = data['currency_id'] and currency_name[data['currency_id'][0]] or '' return super(bank, self)._prepare_name_get(cr, uid, bank_dicts, context=context) - def post_write(self, cr, uid, ids, context={}): + def post_write(self, cr, uid, ids, context=None): if isinstance(ids, (int, long)): ids = [ids] diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index bb1ace992ca..b111cf2b771 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -1105,7 +1105,7 @@ class account_move_line(osv.osv): 'has been confirmed.') % res[2]) return res - def _remove_move_reconcile(self, cr, uid, move_ids=[], context=None): + def _remove_move_reconcile(self, cr, uid, move_ids=None, context=None): # Function remove move rencocile ids related with moves obj_move_line = self.pool.get('account.move.line') obj_move_rec = self.pool.get('account.move.reconcile') diff --git a/addons/account/project/wizard/account_analytic_chart.py b/addons/account/project/wizard/account_analytic_chart.py index a10e938e293..92367e27da5 100644 --- a/addons/account/project/wizard/account_analytic_chart.py +++ b/addons/account/project/wizard/account_analytic_chart.py @@ -47,4 +47,4 @@ class account_analytic_chart(osv.osv_memory): return result account_analytic_chart() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/project/wizard/account_analytic_inverted_balance_report.py b/addons/account/project/wizard/account_analytic_inverted_balance_report.py index 2c9690fee50..95365716a22 100644 --- a/addons/account/project/wizard/account_analytic_inverted_balance_report.py +++ b/addons/account/project/wizard/account_analytic_inverted_balance_report.py @@ -52,4 +52,4 @@ class account_analytic_inverted_balance(osv.osv_memory): } account_analytic_inverted_balance() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/project/wizard/project_account_analytic_line.py b/addons/account/project/wizard/project_account_analytic_line.py index e49fbe911cb..54979d79b8a 100644 --- a/addons/account/project/wizard/project_account_analytic_line.py +++ b/addons/account/project/wizard/project_account_analytic_line.py @@ -55,4 +55,4 @@ class project_account_analytic_line(osv.osv_memory): project_account_analytic_line() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py index c3117e60379..fdda9cb11ce 100644 --- a/addons/account/report/account_balance.py +++ b/addons/account/report/account_balance.py @@ -68,7 +68,7 @@ class account_balance(report_sxw.rml_parse, common_report_header): return self.pool.get('account.account').browse(self.cr, self.uid, data['form']['id']).company_id.name return super(account_balance ,self)._get_account(data) - def lines(self, form, ids=[], done=None):#, level=1): + def lines(self, form, ids=None, done=None): def _process_child(accounts, disp_acc, parent): account_rec = [acct for acct in accounts if acct['id']==parent][0] currency_obj = self.pool.get('res.currency') diff --git a/addons/account/report/account_central_journal.py b/addons/account/report/account_central_journal.py index d3113b63133..a42712f40d7 100644 --- a/addons/account/report/account_central_journal.py +++ b/addons/account/report/account_central_journal.py @@ -105,4 +105,4 @@ class journal_print(report_sxw.rml_parse, common_report_header): report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/account_central_journal.rml', parser=journal_print, header='internal') -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/account_general_journal.py b/addons/account/report/account_general_journal.py index 9eb81157dba..0ffa08b31ef 100644 --- a/addons/account/report/account_general_journal.py +++ b/addons/account/report/account_general_journal.py @@ -158,4 +158,4 @@ class journal_print(report_sxw.rml_parse, common_report_header): report_sxw.report_sxw('report.account.general.journal', 'account.journal.period', 'addons/account/report/general_journal.rml', parser=journal_print, header='internal') -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/account_report.py b/addons/account/report/account_report.py index 59745355c5e..56e324bc361 100644 --- a/addons/account/report/account_report.py +++ b/addons/account/report/account_report.py @@ -284,4 +284,4 @@ class report_account_sales(osv.osv): )""") report_account_sales() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/account_tax_report.py b/addons/account/report/account_tax_report.py index 2a0c5987b47..cef1cf54af0 100644 --- a/addons/account/report/account_tax_report.py +++ b/addons/account/report/account_tax_report.py @@ -160,7 +160,7 @@ class tax_report(report_sxw.rml_parse, common_report_header): i+=1 return res - def _get_codes(self, based_on, company_id, parent=False, level=0, period_list=[], context=None): + def _get_codes(self, based_on, company_id, parent=False, level=0, period_list=None, context=None): obj_tc = self.pool.get('account.tax.code') ids = obj_tc.search(self.cr, self.uid, [('parent_id','=',parent),('company_id','=',company_id)], order='sequence', context=context) @@ -171,7 +171,11 @@ class tax_report(report_sxw.rml_parse, common_report_header): res += self._get_codes(based_on, company_id, code.id, level+1, context=context) return res - def _add_codes(self, based_on, account_list=[], period_list=[], context=None): + def _add_codes(self, based_on, account_list=None, period_list=None, context=None): + if account_list is None: + account_list = [] + if period_list is None: + period_list = [] res = [] obj_tc = self.pool.get('account.tax.code') for account in account_list: diff --git a/addons/account/res_currency.py b/addons/account/res_currency.py index 8e02836274a..ce781a1e11a 100644 --- a/addons/account/res_currency.py +++ b/addons/account/res_currency.py @@ -45,4 +45,3 @@ class res_currency_account(osv.osv): res_currency_account() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/account/wizard/account_invoice_state.py b/addons/account/wizard/account_invoice_state.py index 55eab584040..7c7f6882b75 100644 --- a/addons/account/wizard/account_invoice_state.py +++ b/addons/account/wizard/account_invoice_state.py @@ -71,4 +71,4 @@ class account_invoice_cancel(osv.osv_memory): account_invoice_cancel() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_journal_select.py b/addons/account/wizard/account_journal_select.py index 98099925e29..b91c195f6b3 100644 --- a/addons/account/wizard/account_journal_select.py +++ b/addons/account/wizard/account_journal_select.py @@ -47,4 +47,4 @@ class account_journal_select(osv.osv_memory): account_journal_select() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_move_bank_reconcile.py b/addons/account/wizard/account_move_bank_reconcile.py index 4679089b7cc..2b29bf6b30d 100644 --- a/addons/account/wizard/account_move_bank_reconcile.py +++ b/addons/account/wizard/account_move_bank_reconcile.py @@ -61,4 +61,4 @@ the bank account\nin the journal definition for reconciliation.')) account_move_bank_reconcile() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_move_journal.py b/addons/account/wizard/account_move_journal.py index da6a142972b..246532d38d7 100644 --- a/addons/account/wizard/account_move_journal.py +++ b/addons/account/wizard/account_move_journal.py @@ -38,7 +38,7 @@ class account_move_journal(osv.osv_memory): _defaults = { 'target_move': 'all' } - def _get_period(self, cr, uid, context={}): + def _get_period(self, cr, uid, context=None): """ Return default account period value """ diff --git a/addons/account/wizard/account_move_line_reconcile_select.py b/addons/account/wizard/account_move_line_reconcile_select.py index 8e57c57884d..e23212c514c 100644 --- a/addons/account/wizard/account_move_line_reconcile_select.py +++ b/addons/account/wizard/account_move_line_reconcile_select.py @@ -52,4 +52,4 @@ class account_move_line_reconcile_select(osv.osv_memory): account_move_line_reconcile_select() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_move_line_select.py b/addons/account/wizard/account_move_line_select.py index 4a2f40ec708..a99750a36fe 100644 --- a/addons/account/wizard/account_move_line_select.py +++ b/addons/account/wizard/account_move_line_select.py @@ -69,4 +69,4 @@ class account_move_line_select(osv.osv_memory): account_move_line_select() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_move_line_unreconcile_select.py b/addons/account/wizard/account_move_line_unreconcile_select.py index ad59493503d..26421eb4c0c 100644 --- a/addons/account/wizard/account_move_line_unreconcile_select.py +++ b/addons/account/wizard/account_move_line_unreconcile_select.py @@ -41,4 +41,4 @@ class account_move_line_unreconcile_select(osv.osv_memory): account_move_line_unreconcile_select() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_reconcile.py b/addons/account/wizard/account_reconcile.py index f3d25b1c8db..6f6c8f07844 100644 --- a/addons/account/wizard/account_reconcile.py +++ b/addons/account/wizard/account_reconcile.py @@ -160,4 +160,4 @@ class account_move_line_reconcile_writeoff(osv.osv_memory): account_move_line_reconcile_writeoff() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_state_open.py b/addons/account/wizard/account_state_open.py index f75aff365fe..32795f0f5b7 100644 --- a/addons/account/wizard/account_state_open.py +++ b/addons/account/wizard/account_state_open.py @@ -41,4 +41,4 @@ class account_state_open(osv.osv_memory): account_state_open() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_subscription_generate.py b/addons/account/wizard/account_subscription_generate.py index dc5209ebea0..0dae5aa90a8 100644 --- a/addons/account/wizard/account_subscription_generate.py +++ b/addons/account/wizard/account_subscription_generate.py @@ -50,4 +50,4 @@ class account_subscription_generate(osv.osv_memory): account_subscription_generate() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_unreconcile.py b/addons/account/wizard/account_unreconcile.py index 0e6c38f9d7c..5494875cf26 100644 --- a/addons/account/wizard/account_unreconcile.py +++ b/addons/account/wizard/account_unreconcile.py @@ -50,4 +50,4 @@ class account_unreconcile_reconcile(osv.osv_memory): account_unreconcile_reconcile() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_analytic_plans/report/crossovered_analytic.py b/addons/account_analytic_plans/report/crossovered_analytic.py index 3e8eec81c55..5b22f5e266c 100644 --- a/addons/account_analytic_plans/report/crossovered_analytic.py +++ b/addons/account_analytic_plans/report/crossovered_analytic.py @@ -34,7 +34,7 @@ class crossovered_analytic(report_sxw.rml_parse): }) self.base_amount = 0.00 - def find_children(self,ref_ids): + def find_children(self, ref_ids): to_return_ids = [] final_list = [] parent_list = [] @@ -53,7 +53,7 @@ class crossovered_analytic(report_sxw.rml_parse): final_list.extend(set_list) return final_list #to_return_ids[0] - def set_account(self,cats): + def set_account(self, cats): lst = [] category = self.pool.get('account.analytic.account').read(self.cr, self.uid, cats) for cat in category: @@ -62,7 +62,7 @@ class crossovered_analytic(report_sxw.rml_parse): lst.extend(self.set_account(cat['child_ids'])) return lst - def _ref_lines(self,form): + def _ref_lines(self, form): result = [] res = {} acc_pool = self.pool.get('account.analytic.account') @@ -112,7 +112,9 @@ class crossovered_analytic(report_sxw.rml_parse): result.append(res) return result - def _lines(self, form, ids={}): + def _lines(self, form, ids=None): + if ids is None: + ids = {} if not ids: ids = self.ids diff --git a/addons/account_anglo_saxon/__init__.py b/addons/account_anglo_saxon/__init__.py index 07b514d0327..440f8e87df7 100644 --- a/addons/account_anglo_saxon/__init__.py +++ b/addons/account_anglo_saxon/__init__.py @@ -23,4 +23,4 @@ import stock import purchase import invoice -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py index e6861d0db67..4c6f9b7a637 100644 --- a/addons/account_asset/account_asset.py +++ b/addons/account_asset/account_asset.py @@ -75,7 +75,7 @@ class account_asset_asset(osv.osv): _name = 'account.asset.asset' _description = 'Asset' - def _get_period(self, cr, uid, context={}): + def _get_period(self, cr, uid, context=None): periods = self.pool.get('account.period').find(cr, uid) if periods: return periods[0] @@ -176,7 +176,9 @@ class account_asset_asset(osv.osv): year = depreciation_date.year return True - def validate(self, cr, uid, ids, context={}): + def validate(self, cr, uid, ids, context=None): + if context is None: + context = {} return self.write(cr, uid, ids, { 'state':'open' }, context) @@ -304,7 +306,7 @@ class account_asset_asset(osv.osv): default.update({'depreciation_line_ids': [], 'state': 'draft'}) return super(account_asset_asset, self).copy(cr, uid, id, default, context=context) - def _compute_entries(self, cr, uid, ids, period_id, context={}): + def _compute_entries(self, cr, uid, ids, period_id, context=None): result = [] period_obj = self.pool.get('account.period') depreciation_obj = self.pool.get('account.asset.depreciation.line') diff --git a/addons/account_budget/report/analytic_account_budget_report.py b/addons/account_budget/report/analytic_account_budget_report.py index aa5d39f8d49..e29af98b6a3 100644 --- a/addons/account_budget/report/analytic_account_budget_report.py +++ b/addons/account_budget/report/analytic_account_budget_report.py @@ -35,7 +35,9 @@ class analytic_account_budget_report(report_sxw.rml_parse): }) self.context = context - def funct(self, object, form, ids={}, done=None, level=1): + def funct(self, object, form, ids=None, done=None, level=1): + if ids is None: + ids = {} if not ids: ids = self.ids if not done: @@ -153,7 +155,7 @@ class analytic_account_budget_report(report_sxw.rml_parse): tot['perc'] = float(tot['prac'] / tot['theo']) * 100 return result - def funct_total(self,form): + def funct_total(self, form): result = [] res = {} res = { @@ -167,4 +169,4 @@ class analytic_account_budget_report(report_sxw.rml_parse): report_sxw.report_sxw('report.account.analytic.account.budget', 'account.analytic.account', 'addons/account_budget/report/analytic_account_budget_report.rml',parser=analytic_account_budget_report,header='internal') -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_budget/report/budget_report.py b/addons/account_budget/report/budget_report.py index 7681f9268d9..c7d4ba58f68 100644 --- a/addons/account_budget/report/budget_report.py +++ b/addons/account_budget/report/budget_report.py @@ -34,7 +34,9 @@ class budget_report(report_sxw.rml_parse): }) self.context = context - def funct(self, object, form, ids={}, done=None, level=1): + def funct(self, object, form, ids=None, done=None, level=1): + if ids is None: + ids = {} if not ids: ids = self.ids if not done: diff --git a/addons/account_budget/report/crossovered_budget_report.py b/addons/account_budget/report/crossovered_budget_report.py index b70b7da34bb..9f2f59fe715 100644 --- a/addons/account_budget/report/crossovered_budget_report.py +++ b/addons/account_budget/report/crossovered_budget_report.py @@ -37,7 +37,9 @@ class budget_report(report_sxw.rml_parse): }) self.context = context - def funct(self, object, form, ids={}, done=None, level=1): + def funct(self, object, form, ids=None, done=None, level=1): + if ids is None: + ids = {} if not ids: ids = self.ids if not done: diff --git a/addons/account_budget/wizard/account_budget_analytic.py b/addons/account_budget/wizard/account_budget_analytic.py index 3e3b4b0fa9d..6397ee87c76 100644 --- a/addons/account_budget/wizard/account_budget_analytic.py +++ b/addons/account_budget/wizard/account_budget_analytic.py @@ -52,4 +52,4 @@ class account_budget_analytic(osv.osv_memory): account_budget_analytic() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_budget/wizard/account_budget_crossovered_report.py b/addons/account_budget/wizard/account_budget_crossovered_report.py index ff6b6492a5a..e120bc47caa 100644 --- a/addons/account_budget/wizard/account_budget_crossovered_report.py +++ b/addons/account_budget/wizard/account_budget_crossovered_report.py @@ -53,4 +53,4 @@ class account_budget_crossvered_report(osv.osv_memory): account_budget_crossvered_report() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_budget/wizard/account_budget_report.py b/addons/account_budget/wizard/account_budget_report.py index fdae4c94adf..6ef22c649e9 100644 --- a/addons/account_budget/wizard/account_budget_report.py +++ b/addons/account_budget/wizard/account_budget_report.py @@ -54,4 +54,4 @@ class account_budget_report(osv.osv_memory): account_budget_report() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_followup/__init__.py b/addons/account_followup/__init__.py index 4bfe3186298..ffa88c40a32 100644 --- a/addons/account_followup/__init__.py +++ b/addons/account_followup/__init__.py @@ -23,4 +23,4 @@ import account_followup import wizard import report -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_followup/wizard/__init__.py b/addons/account_followup/wizard/__init__.py index aea714d2a86..ad072c5b7d8 100644 --- a/addons/account_followup/wizard/__init__.py +++ b/addons/account_followup/wizard/__init__.py @@ -21,4 +21,4 @@ import account_followup_print -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_followup/wizard/account_followup_print.py b/addons/account_followup/wizard/account_followup_print.py index 1e84681b1ea..5791bacbed0 100644 --- a/addons/account_followup/wizard/account_followup_print.py +++ b/addons/account_followup/wizard/account_followup_print.py @@ -209,7 +209,7 @@ class account_followup_print_all(osv.osv_memory): to_update[str(id)]= {'level': fups[followup_line_id][1], 'partner_id': stat_line_id} return {'partner_ids': partner_list, 'to_update': to_update} - def do_mail(self ,cr, uid, ids, context=None): + def do_mail(self, cr, uid, ids, context=None): mod_obj = self.pool.get('ir.model.data') move_obj = self.pool.get('account.move.line') user_obj = self.pool.get('res.users') diff --git a/addons/account_payment/__init__.py b/addons/account_payment/__init__.py index 6188de6a9da..82a05aa73e9 100644 --- a/addons/account_payment/__init__.py +++ b/addons/account_payment/__init__.py @@ -29,4 +29,4 @@ import account_move_line import account_invoice import report -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_payment/account_invoice.py b/addons/account_payment/account_invoice.py index fd787863c7d..7138540fa3b 100644 --- a/addons/account_payment/account_invoice.py +++ b/addons/account_payment/account_invoice.py @@ -50,4 +50,4 @@ class Invoice(osv.osv): Invoice() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_payment/account_move_line.py b/addons/account_payment/account_move_line.py index cbbeb949b3c..047b472e53b 100644 --- a/addons/account_payment/account_move_line.py +++ b/addons/account_payment/account_move_line.py @@ -26,7 +26,7 @@ from tools.translate import _ class account_move_line(osv.osv): _inherit = "account.move.line" - def amount_to_pay(self, cr, uid, ids, name, arg={}, context=None): + def amount_to_pay(self, cr, uid, ids, name, arg=None, context=None): """ Return the amount still to pay regarding all the payemnt orders (excepting cancelled orders)""" if not ids: @@ -117,4 +117,4 @@ class account_move_line(osv.osv): account_move_line() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_payment/account_payment.py b/addons/account_payment/account_payment.py index 1d4c46df029..fceff99b3f2 100644 --- a/addons/account_payment/account_payment.py +++ b/addons/account_payment/account_payment.py @@ -139,7 +139,9 @@ class payment_order(osv.osv): wf_service.trg_validate(uid, 'payment.order', ids[0], 'done', cr) return True - def copy(self, cr, uid, id, default={}, context=None): + def copy(self, cr, uid, id, default=None, context=None): + if default is None: + default = {} default.update({ 'state': 'draft', 'line_ids': [], diff --git a/addons/account_payment/report/__init__.py b/addons/account_payment/report/__init__.py index e9d7f4013ac..c73a5f33001 100644 --- a/addons/account_payment/report/__init__.py +++ b/addons/account_payment/report/__init__.py @@ -20,4 +20,4 @@ ############################################################################## import payment_order -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_payment/report/payment_order.py b/addons/account_payment/report/payment_order.py index 0b2a8061906..6872bbe3516 100644 --- a/addons/account_payment/report/payment_order.py +++ b/addons/account_payment/report/payment_order.py @@ -77,7 +77,7 @@ class payment_order(report_sxw.rml_parse): user = pool.get('res.users').browse(self.cr, self.uid, self.uid) return user.company_id and user.company_id.currency_id and user.company_id.currency_id.symbol or False - def _get_account_name(self,bank_id): + def _get_account_name(self, bank_id): if bank_id: pool = pooler.get_pool(self.cr.dbname) value_name = pool.get('res.partner.bank').name_get(self.cr, self.uid, [bank_id]) @@ -87,4 +87,4 @@ class payment_order(report_sxw.rml_parse): report_sxw.report_sxw('report.payment.order', 'payment.order', 'addons/account_payment/report/payment_order.rml', parser=payment_order, header="external") -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_payment/wizard/__init__.py b/addons/account_payment/wizard/__init__.py index 1c5aefacc78..35b907cd337 100644 --- a/addons/account_payment/wizard/__init__.py +++ b/addons/account_payment/wizard/__init__.py @@ -23,4 +23,4 @@ import account_payment_order import account_payment_populate_statement import account_payment_pay -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_payment/wizard/account_payment_pay.py b/addons/account_payment/wizard/account_payment_pay.py index 6bcb04fa490..3c16618f3d2 100644 --- a/addons/account_payment/wizard/account_payment_pay.py +++ b/addons/account_payment/wizard/account_payment_pay.py @@ -56,4 +56,4 @@ class account_payment_make_payment(osv.osv_memory): account_payment_make_payment() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_payment/wizard/account_payment_populate_statement.py b/addons/account_payment/wizard/account_payment_populate_statement.py index 6f2d9d02dbc..ecfd4988329 100644 --- a/addons/account_payment/wizard/account_payment_populate_statement.py +++ b/addons/account_payment/wizard/account_payment_populate_statement.py @@ -120,4 +120,4 @@ class account_payment_populate_statement(osv.osv_memory): account_payment_populate_statement() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_sequence/__init__.py b/addons/account_sequence/__init__.py index b6707106d4b..e85a910f037 100644 --- a/addons/account_sequence/__init__.py +++ b/addons/account_sequence/__init__.py @@ -22,4 +22,4 @@ import account_sequence import account_sequence_installer -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_voucher/__init__.py b/addons/account_voucher/__init__.py index 9796f81d5e5..2b1478d9fa0 100644 --- a/addons/account_voucher/__init__.py +++ b/addons/account_voucher/__init__.py @@ -24,4 +24,4 @@ import invoice import report import wizard -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 30358f701ef..75de84c0277 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -849,7 +849,7 @@ class account_voucher(osv.osv): res['account_id'] = account_id return {'value':res} - def _sel_context(self, cr, uid, voucher_id,context=None): + def _sel_context(self, cr, uid, voucher_id, context=None): """ Select the context to use accordingly if it needs to be multicurrency or not. @@ -1275,7 +1275,9 @@ class account_voucher(osv.osv): self.reconcile_send_note(cr, uid, [voucher.id], context=context) return True - def copy(self, cr, uid, id, default={}, context=None): + def copy(self, cr, uid, id, default=None, context=None): + if default is None: + default = {} default.update({ 'state': 'draft', 'number': False, diff --git a/addons/account_voucher/report/__init__.py b/addons/account_voucher/report/__init__.py index caeb155adbe..862843352a8 100644 --- a/addons/account_voucher/report/__init__.py +++ b/addons/account_voucher/report/__init__.py @@ -23,4 +23,4 @@ import account_voucher import account_voucher_print import account_voucher_sales_receipt -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/anonymization/anonymization.py b/addons/anonymization/anonymization.py index 43d198b27e2..8834645c460 100644 --- a/addons/anonymization/anonymization.py +++ b/addons/anonymization/anonymization.py @@ -363,7 +363,7 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory): }) raise osv.except_osv(error_type, error_msg) - def anonymize_database(self,cr, uid, ids, context=None): + def anonymize_database(self, cr, uid, ids, context=None): """Sets the 'anonymized' state to defined fields""" # create a new history record: @@ -498,7 +498,7 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory): 'target':'new', } - def reverse_anonymize_database(self,cr, uid, ids, context=None): + def reverse_anonymize_database(self, cr, uid, ids, context=None): """Set the 'clear' state to defined fields""" ir_model_fields_anonymization_model = self.pool.get('ir.model.fields.anonymization') diff --git a/addons/audittrail/audittrail.py b/addons/audittrail/audittrail.py index 332808d8a18..9232a696da8 100644 --- a/addons/audittrail/audittrail.py +++ b/addons/audittrail/audittrail.py @@ -202,7 +202,7 @@ class audittrail_objects_proxy(object_proxy): res = value return res - def create_log_line(self, cr, uid, log_id, model, lines=[]): + def create_log_line(self, cr, uid, log_id, model, lines=None): """ Creates lines for changed fields with its old and new values @@ -211,6 +211,8 @@ class audittrail_objects_proxy(object_proxy): @param model: Object which values are being changed @param lines: List of values for line is to be created """ + if lines is None: + lines = [] pool = pooler.get_pool(cr.dbname) obj_pool = pool.get(model.model) model_pool = pool.get('ir.model') @@ -349,9 +351,9 @@ class audittrail_objects_proxy(object_proxy): data[(model.id, resource_id)] = {'text':values_text, 'value': values} return data - def prepare_audittrail_log_line(self, cr, uid, pool, model, resource_id, method, old_values, new_values, field_list=[]): + def prepare_audittrail_log_line(self, cr, uid, pool, model, resource_id, method, old_values, new_values, field_list=None): """ - This function compares the old data (i.e before the method was executed) and the new data + This function compares the old data (i.e before the method was executed) and the new data (after the method was executed) and returns a structure with all the needed information to log those differences. @@ -375,9 +377,11 @@ class audittrail_objects_proxy(object_proxy): (model.id, resource_id): [] } - The reason why the structure returned is build as above is because when modifying an existing + The reason why the structure returned is build as above is because when modifying an existing record, we may have to log a change done in a x2many field of that object """ + if field_list is None: + field_list = [] key = (model.id, resource_id) lines = { key: [] @@ -416,7 +420,7 @@ class audittrail_objects_proxy(object_proxy): lines[key].append(data) return lines - def process_data(self, cr, uid, pool, res_ids, model, method, old_values={}, new_values={}, field_list=[]): + def process_data(self, cr, uid, pool, res_ids, model, method, old_values=None, new_values=None, field_list=None): """ This function processes and iterates recursively to log the difference between the old data (i.e before the method was executed) and the new data and creates audittrail log @@ -435,6 +439,8 @@ class audittrail_objects_proxy(object_proxy): on specific fields only. :return: True """ + if field_list is None: + field_list = [] # loop on all the given ids for res_id in res_ids: # compare old and new values and get audittrail log lines accordingly diff --git a/addons/base_crypt/crypt.py b/addons/base_crypt/crypt.py index b27dad22363..81a60a5dd5f 100644 --- a/addons/base_crypt/crypt.py +++ b/addons/base_crypt/crypt.py @@ -47,7 +47,9 @@ import logging magic_md5 = '$1$' _logger = logging.getLogger(__name__) -def gen_salt( length=8, symbols=ascii_letters + digits ): +def gen_salt( length=8, symbols=None): + if symbols is None: + symbols = ascii_letters + digits seed() return ''.join( sample( symbols, length ) ) diff --git a/addons/base_module_doc_rst/report/ir_module_reference_print_graph.py b/addons/base_module_doc_rst/report/ir_module_reference_print_graph.py index 62848383000..e70b2da63b1 100644 --- a/addons/base_module_doc_rst/report/ir_module_reference_print_graph.py +++ b/addons/base_module_doc_rst/report/ir_module_reference_print_graph.py @@ -79,4 +79,4 @@ report_sxw.report_sxw('report.ir.module.reference.graph', 'ir.module.module', 'addons/base_module_doc_rst/report/ir_module_reference_graph.rml', parser=ir_module_reference_print_graph, header=False) -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_module_record/wizard/base_module_record_objects.py b/addons/base_module_record/wizard/base_module_record_objects.py index 22383bc37d6..de2c6861c44 100644 --- a/addons/base_module_record/wizard/base_module_record_objects.py +++ b/addons/base_module_record/wizard/base_module_record_objects.py @@ -127,7 +127,7 @@ class base_module_record_objects(osv.osv_memory): _name = 'base.module.record.objects' _description = "Base Module Record Objects" - def inter_call(self,cr,uid,data,context=None): + def inter_call(self, cr, uid, data, context=None): res=base_module_save._create_module(self, cr, uid, data, context) mod_obj = self.pool.get('ir.model.data') model_data_ids = mod_obj.search(cr, uid,[('model', '=', 'ir.ui.view'), ('name', '=', 'module_create_form_view')], context=context) diff --git a/addons/base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py b/addons/base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py index a37d46b78a2..436650eb2cd 100644 --- a/addons/base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py +++ b/addons/base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py @@ -42,11 +42,11 @@ import copy class DomApiGeneral: """General DOM API utilities.""" - def __init__(self,content_string="",file=""): + def __init__(self, content_string="", file=""): self.content_string = content_string self.re_digits = re.compile(r"(.*?\d)(pt|cm|mm|inch|in)") - def _unitTuple(self,string): + def _unitTuple(self, string): """Split values and units to a tuple.""" temp = self.re_digits.findall(string) if not temp: @@ -54,13 +54,15 @@ class DomApiGeneral: else: return (temp[0]) - def stringPercentToFloat(self,string): + def stringPercentToFloat(self, string): temp = string.replace("""%""","") return float(temp)/100 - def findChildrenByName(self,parent,name,attr_dict={}): + def findChildrenByName(self, parent, name, attr_dict=None): """Helper functions. Does not work recursively. Optional: also test for certain attribute/value pairs.""" + if attr_dict is None: + attr_dict = {} children = [] for c in parent.childNodes: if c.nodeType == c.ELEMENT_NODE and c.nodeName == name: @@ -70,7 +72,7 @@ class DomApiGeneral: else: return self._selectForAttributes(nodelist=children,attr_dict=attr_dict) - def _selectForAttributes(self,nodelist,attr_dict): + def _selectForAttributes(self, nodelist, attr_dict): "Helper function.""" selected_nodes = [] for n in nodelist: @@ -83,7 +85,7 @@ class DomApiGeneral: selected_nodes.append(n) return selected_nodes - def _stringToTuple(self,s): + def _stringToTuple(self, s): """Helper function.""" try: temp = string.split(s,",") @@ -91,13 +93,13 @@ class DomApiGeneral: except: return None - def _tupleToString(self,t): + def _tupleToString(self, t): try: return self.openOfficeStringUtf8("%s,%s" % (t[0],t[1])) except: return None - def _lengthToFloat(self,value): + def _lengthToFloat(self, value): v = value if not self.re_digits.search(v): return v @@ -113,7 +115,7 @@ class DomApiGeneral: except: return v - def openOfficeStringUtf8(self,string): + def openOfficeStringUtf8(self, string): if type(string) == unicode: return string.encode("utf-8") tempstring = unicode(string,"cp1252").encode("utf-8") @@ -121,7 +123,7 @@ class DomApiGeneral: class DomApi(DomApiGeneral): """This class provides a DOM-API for XML-Files from an SXW-Archive.""" - def __init__(self,xml_content,xml_styles): + def __init__(self, xml_content, xml_styles): DomApiGeneral.__init__(self) self.content_dom = xml.dom.minidom.parseString(xml_content) self.styles_dom = xml.dom.minidom.parseString(xml_styles) @@ -145,7 +147,7 @@ class DomApi(DomApiGeneral): for s in self.style_dict.keys(): self.style_properties_dict[s] = self.getStylePropertiesDict(s) - def updateWithPercents(self,dict,updatedict): + def updateWithPercents(self, dict, updatedict): """Sometimes you find values like "115%" in the style hierarchy.""" if not updatedict: # no style hierarchies for this style? => @@ -244,7 +246,7 @@ class DomApi(DomApiGeneral): def toxml(self): return self.content_dom.toxml(encoding="utf-8") - def getStylePropertiesDict(self,style_name): + def getStylePropertiesDict(self, style_name): res = {} if self.style_dict[style_name].hasAttribute("style:parent-style-name"): @@ -265,7 +267,7 @@ class PyOpenOffice(object): self.save_pict = save_pict self.images = {} - def oo_read(self,fname): + def oo_read(self, fname): z = zipfile.ZipFile(fname,"r") content = z.read('content.xml') style = z.read('styles.xml') @@ -281,7 +283,7 @@ class PyOpenOffice(object): z.close() return content,style - def oo_replace(self,content): + def oo_replace(self, content): regex = [ (r"]*/>", ""), (r"(.*?)]*/>", "$2"), @@ -290,7 +292,7 @@ class PyOpenOffice(object): content = re.sub(key, val, content) return content - def unpackNormalize(self,sourcefile): + def unpackNormalize(self, sourcefile): c,s = self.oo_read(sourcefile) c = self.oo_replace(c) dom = DomApi(c,s) diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/About.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/About.py index 401cf88b418..43b452b82e2 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/About.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/About.py @@ -52,7 +52,7 @@ if __name__<>'package': from lib.gui import * class About(unohelper.Base, XJobExecutor): - def __init__(self,ctx): + def __init__(self, ctx): self.ctx = ctx self.module = "openerp_report" self.version = "0.1" diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/AddAttachment.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/AddAttachment.py index a9a18cd9bfa..ba69174ffc6 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/AddAttachment.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/AddAttachment.py @@ -64,7 +64,7 @@ class AddAttachment(unohelper.Base, XJobExecutor ): 'PDF' : 'pdf', 'OpenOffice': 'sxw', } - def __init__(self,ctx): + def __init__(self, ctx): self.ctx = ctx self.module = "openerp_report" self.version = "0.1" @@ -132,7 +132,7 @@ class AddAttachment(unohelper.Base, XJobExecutor ): self.win.addButton('btnCancel', -2 - 27 , -5 , 30 , 15, 'Cancel' ,actionListenerProc = self.btnCancel_clicked ) self.win.doModalDialog("lstResourceType", self.Kind.keys()[0]) - def btnSearch_clicked( self, oActionEvent ): + def btnSearch_clicked(self, oActionEvent): modelSelectedItem = self.win.getListBoxSelectedItem("lstmodel") if modelSelectedItem == "": return @@ -151,7 +151,7 @@ class AddAttachment(unohelper.Base, XJobExecutor ): for result in self.aSearchResult: self.lstResource.addItem(result[1],result[0]) - def _send_attachment( self, name, data, res_model, res_id ): + def _send_attachment(self, name, data, res_model, res_id): desktop = getDesktop() oDoc2 = desktop.getCurrentComponent() docinfo = oDoc2.getDocumentInfo() @@ -166,7 +166,7 @@ class AddAttachment(unohelper.Base, XJobExecutor ): return self.sock.execute( database, uid, self.password, 'ir.attachment', 'create', params ) - def send_attachment( self, model, resource_id ): + def send_attachment(self, model, resource_id): desktop = getDesktop() oDoc2 = desktop.getCurrentComponent() docinfo = oDoc2.getDocumentInfo() @@ -187,7 +187,7 @@ class AddAttachment(unohelper.Base, XJobExecutor ): data = read_data_from_file( get_absolute_file_path( url ) ) return self._send_attachment( os.path.basename( url ), data, model, resource_id ) - def btnOkWithoutInformation_clicked( self, oActionEvent ): + def btnOkWithoutInformation_clicked(self, oActionEvent): desktop = getDesktop() oDoc2 = desktop.getCurrentComponent() docinfo = oDoc2.getDocumentInfo() @@ -199,7 +199,7 @@ class AddAttachment(unohelper.Base, XJobExecutor ): res = self.send_attachment( docinfo.getUserFieldValue(3), docinfo.getUserFieldValue(2) ) self.win.endExecute() - def btnOkWithInformation_clicked(self,oActionEvent): + def btnOkWithInformation_clicked(self, oActionEvent): if self.win.getListBoxSelectedItem("lstResourceType") == "": ErrorDialog( "You have to select a resource type.", "", "Selection Error." ) return @@ -221,7 +221,7 @@ class AddAttachment(unohelper.Base, XJobExecutor ): res = self.send_attachment( self.dModel[self.win.getListBoxSelectedItem('lstmodel')], resourceid ) self.win.endExecute() - def btnCancel_clicked( self, oActionEvent ): + def btnCancel_clicked(self, oActionEvent): self.win.endExecute() def doc2pdf(self, strFile): @@ -262,7 +262,7 @@ class AddAttachment(unohelper.Base, XJobExecutor ): # Can be None if len(strFilterSubName) <= 0 return filename - def _MakePropertyValue(self, cName = "", uValue = u"" ): + def _MakePropertyValue(self, cName="", uValue=u""): oPropertyValue = createUnoStruct( "com.sun.star.beans.PropertyValue" ) if cName: oPropertyValue.Name = cName diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Change.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Change.py index 75bfd65e1b6..b85a9d9bb06 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Change.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Change.py @@ -59,7 +59,7 @@ if __name__<>"package": database="test" class Change( unohelper.Base, XJobExecutor ): - def __init__(self,ctx): + def __init__(self, ctx): self.ctx = ctx self.module = "openerp_report" self.version = "0.1" @@ -107,7 +107,7 @@ class Change( unohelper.Base, XJobExecutor ): self.lstProtocol.addItem(i,self.lstProtocol.getItemCount() ) self.win.doModalDialog( "lstProtocol", protocol) - def btnNext_clicked(self,oActionEvent): + def btnNext_clicked(self, oActionEvent): global url aVal='' #aVal= Fetature used diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertBracesToField.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertBracesToField.py index bb80c3ecd61..c1fa8b22a85 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertBracesToField.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertBracesToField.py @@ -3,31 +3,31 @@ # Portions of this file are under the following copyright and license: # # -# Copyright (c) 2003-2004 Danny Brewer -# d29583@groovegarden.com -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library 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 -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See: http://www.gnu.org/licenses/lgpl.html +# Copyright (c) 2003-2004 Danny Brewer +# d29583@groovegarden.com +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library 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 +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See: http://www.gnu.org/licenses/lgpl.html +# # -# # and other portions are under the following copyright and license: # # # OpenERP, Open Source Management Solution>.. -# Copyright (C) 2004-2010 OpenERP SA (). +# Copyright (C) 2004-2010 OpenERP SA (). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -63,7 +63,7 @@ if __name__<>"package": class ConvertBracesToField( unohelper.Base, XJobExecutor ): - def __init__(self,ctx): + def __init__(self, ctx): self.ctx = ctx self.module = "openerp_report" @@ -198,7 +198,7 @@ class ConvertBracesToField( unohelper.Base, XJobExecutor ): info = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback)) self.logobj.log_write('ConvertBraceToField', LOG_ERROR, info) - def getRes(self,sock,sObject,sVar): + def getRes(self, sock, sObject, sVar): desktop=getDesktop() doc =desktop.getCurrentComponent() docinfo=doc.getDocumentInfo() @@ -215,7 +215,9 @@ class ConvertBracesToField( unohelper.Base, XJobExecutor ): sObject = self.getRes(sock,res[myval]['relation'], sVar[sVar.find("/")+1:]) return sObject - def getBraces(self,aReportSyntex=[]): + def getBraces(self, aReportSyntex=None): + if aReportSyntex is None: + aReportSyntex = [] desktop=getDesktop() doc = desktop.getCurrentComponent() aSearchString=[] diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py index 892061c56b4..ffa88a8cd06 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py @@ -57,7 +57,7 @@ if __name__<>"package": uid = 3 class ConvertFieldsToBraces( unohelper.Base, XJobExecutor ): - def __init__(self,ctx): + def __init__(self, ctx): self.ctx = ctx self.module = "openerp_report" self.version = "0.1" diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ExportToRML.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ExportToRML.py index 644763595df..d92b2aec14f 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ExportToRML.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ExportToRML.py @@ -67,7 +67,7 @@ if __name__<>"package": class ExportToRML( unohelper.Base, XJobExecutor ): - def __init__(self,ctx): + def __init__(self, ctx): self.ctx = ctx self.module = "openerp_report" self.version = "0.1" diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Expression.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Expression.py index 6c0d04d4bf3..9e3b175b67b 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Expression.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Expression.py @@ -57,7 +57,7 @@ if __name__<>"package": uid = 3 class Expression(unohelper.Base, XJobExecutor ): - def __init__(self,sExpression="",sName="", bFromModify=False): + def __init__(self, sExpression="", sName="", bFromModify=False): LoginTest() if not loginstatus and __name__=="package": exit(1) @@ -75,7 +75,7 @@ class Expression(unohelper.Base, XJobExecutor ): self.win.doModalDialog("",None) - def btnOk_clicked( self, oActionEvent ): + def btnOk_clicked(self, oActionEvent): desktop=getDesktop() doc = desktop.getCurrentComponent() text = doc.Text @@ -105,7 +105,7 @@ class Expression(unohelper.Base, XJobExecutor ): else: ErrorDialog("Please fill appropriate data in Name field or in Expression field.") - def btnCancel_clicked( self, oActionEvent ): + def btnCancel_clicked(self, oActionEvent): self.win.endExecute() if __name__<>"package" and __name__=="__main__": diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Fields.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Fields.py index 513be2e0e64..3e39b528b6b 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Fields.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Fields.py @@ -64,7 +64,7 @@ if __name__<>"package": class Fields(unohelper.Base, XJobExecutor ): - def __init__(self,sVariable="",sFields="",sDisplayName="",bFromModify=False): + def __init__(self, sVariable="", sFields="", sDisplayName="", bFromModify=False): LoginTest() if not loginstatus and __name__=="package": exit(1) @@ -177,7 +177,7 @@ class Fields(unohelper.Base, XJobExecutor ): ErrorDialog("Please insert user define field Field-1 or Field-4","Just go to File->Properties->User Define \nField-1 E.g. http://localhost:8069 \nOR \nField-4 E.g. account.invoice") self.win.endExecute() - def lstbox_selected(self,oItemEvent): + def lstbox_selected(self, oItemEvent): try: desktop=getDesktop() @@ -200,7 +200,7 @@ class Fields(unohelper.Base, XJobExecutor ): if self.bModify: self.win.setEditText("txtUName",self.sGDisplayName) - def getRes(self,sock ,sObject,sVar): + def getRes(self, sock, sObject, sVar): desktop=getDesktop() doc =desktop.getCurrentComponent() docinfo=doc.getDocumentInfo() @@ -219,7 +219,7 @@ class Fields(unohelper.Base, XJobExecutor ): else: return sObject - def cmbVariable_selected(self,oItemEvent): + def cmbVariable_selected(self, oItemEvent): if self.count > 0 : try: desktop=getDesktop() @@ -246,7 +246,7 @@ class Fields(unohelper.Base, XJobExecutor ): info = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback)) self.logobj.log_write('Fields', LOG_ERROR, info) - def btnOk_clicked( self, oActionEvent ): + def btnOk_clicked(self, oActionEvent): desktop=getDesktop() doc = desktop.getCurrentComponent() cursor = doc.getCurrentController().getViewCursor() @@ -281,7 +281,7 @@ class Fields(unohelper.Base, XJobExecutor ): else: ErrorDialog("Please fill appropriate data in Name field \nor select particular value from the list of fields.") - def btnCancel_clicked( self, oActionEvent ): + def btnCancel_clicked(self, oActionEvent): self.win.endExecute() if __name__<>"package" and __name__=="__main__": diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py index ebe2650575d..bc7d439c76d 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py @@ -65,7 +65,7 @@ if __name__<>'package': uid = 3 class ModifyExistingReport(unohelper.Base, XJobExecutor): - def __init__(self,ctx): + def __init__(self, ctx): self.ctx = ctx self.module = "openerp_report" self.version = "0.1" @@ -177,10 +177,10 @@ class ModifyExistingReport(unohelper.Base, XJobExecutor): self.win.endExecute() - def btnCancel_clicked( self, oActionEvent ): + def btnCancel_clicked(self, oActionEvent): self.win.endExecute() - def btnDelete_clicked( self, oActionEvent ): + def btnDelete_clicked(self, oActionEvent): desktop=getDesktop() doc = desktop.getCurrentComponent() docinfo=doc.getDocumentInfo() diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py index 6022e44df7a..138c68b690e 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py @@ -66,7 +66,7 @@ if __name__<>"package": # # class NewReport(unohelper.Base, XJobExecutor): - def __init__(self,ctx): + def __init__(self, ctx): self.ctx = ctx self.module = "openerp_report" self.version = "0.1" @@ -99,7 +99,7 @@ class NewReport(unohelper.Base, XJobExecutor): self.win.addButton('btnCancel',-2 - 70 - 5 ,-5, 35,15,'Cancel' ,actionListenerProc = self.btnCancel_clicked ) self.win.doModalDialog("",None) - def btnOk_clicked(self,oActionEvent): + def btnOk_clicked(self, oActionEvent): desktop=getDesktop() doc = desktop.getCurrentComponent() docinfo=doc.getDocumentInfo() @@ -107,7 +107,7 @@ class NewReport(unohelper.Base, XJobExecutor): self.logobj.log_write('Module Name',LOG_INFO, ':Module use in creating a report %s using database %s' % (self.aModuleName[self.lstModule.getSelectedItemPos()], database)) self.win.endExecute() - def btnCancel_clicked( self, oActionEvent ): + def btnCancel_clicked(self, oActionEvent): self.win.endExecute() if __name__<>"package" and __name__=="__main__": diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Repeatln.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Repeatln.py index ca2d9bf2d36..16735d40f4e 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Repeatln.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Repeatln.py @@ -64,7 +64,7 @@ if __name__<>"package": #class RepeatIn: class RepeatIn( unohelper.Base, XJobExecutor ): - def __init__(self,sObject="",sVariable="",sFields="",sDisplayName="",bFromModify=False): + def __init__(self, sObject="", sVariable="", sFields="", sDisplayName="", bFromModify=False): # Interface Design LoginTest() self.logobj=Logger() @@ -204,7 +204,7 @@ class RepeatIn( unohelper.Base, XJobExecutor ): ErrorDialog("Please Select Appropriate module" ,"Create new report from: \nOpenERP -> Open a New Report") self.win.endExecute() - def lstbox_selected(self,oItemEvent): + def lstbox_selected(self, oItemEvent): sItem=self.win.getListBoxSelectedItem("lstFields") sMain=self.aListRepeatIn[self.win.getListBoxSelectedItemPos("lstFields")] @@ -215,7 +215,7 @@ class RepeatIn( unohelper.Base, XJobExecutor ): self.win.setEditText("txtName",sMain[sMain.rfind("/")+1:]) self.win.setEditText("txtUName","|-."+sItem[sItem.rfind("/")+1:]+".-|") - def cmbVariable_selected(self,oItemEvent): + def cmbVariable_selected(self, oItemEvent): if self.count > 0 : @@ -290,7 +290,7 @@ class RepeatIn( unohelper.Base, XJobExecutor ): else: ErrorDialog("Please fill appropriate data in Object Field or Name field \nor select particular value from the list of fields.") - def btnCancel_clicked( self, oActionEvent ): + def btnCancel_clicked(self, oActionEvent): self.win.endExecute() if __name__<>"package" and __name__=="__main__": diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/SendToServer.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/SendToServer.py index d32f7aa6c20..4568620dc8c 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/SendToServer.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/SendToServer.py @@ -72,7 +72,7 @@ class SendtoServer(unohelper.Base, XJobExecutor): 'HTML' : 'html' } - def __init__(self,ctx): + def __init__(self, ctx): self.ctx = ctx self.module = "openerp_report" self.version = "0.1" @@ -136,10 +136,10 @@ class SendtoServer(unohelper.Base, XJobExecutor): self.win.doModalDialog("lstResourceType", self.Kind.keys()[0]) - def lstbox_selected(self,oItemEvent): + def lstbox_selected(self, oItemEvent): pass - def btnCancel_clicked( self, oActionEvent ): + def btnCancel_clicked(self, oActionEvent): self.win.endExecute() def btnOk_clicked(self, oActionEvent): @@ -221,7 +221,7 @@ class SendtoServer(unohelper.Base, XJobExecutor): id=self.sock.execute(database, uid, self.password, 'ir.actions.report.xml' ,'create', params) return id - def getInverseFieldsRecord(self,nVal): + def getInverseFieldsRecord(self, nVal): desktop=getDesktop() doc = desktop.getCurrentComponent() count=0 diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py index ba9817ca20a..c399634bfe5 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py @@ -59,7 +59,7 @@ if __name__<>"package": database="test" class ServerParameter( unohelper.Base, XJobExecutor ): - def __init__(self, aVal= None, sURL=""): + def __init__(self, aVal=None, sURL=""): self.module = "openerp_report" self.version = "0.1" desktop=getDesktop() @@ -116,8 +116,7 @@ class ServerParameter( unohelper.Base, XJobExecutor ): #self.win.doModalDialog("lstDatabase",docinfo.getUserFieldValue(2)) - def btnOk_clicked(self,oActionEvent): - + def btnOk_clicked(self, oActionEvent): sLogin=self.win.getEditText("txtLoginName") sPassword=self.win.getEditText("txtPassword") global url @@ -157,11 +156,10 @@ class ServerParameter( unohelper.Base, XJobExecutor ): self.logobj.log_write('successful login',LOG_INFO, ': successful login from %s using database %s' % (sLogin, sDatabase)) self.win.endExecute() - - def btnCancel_clicked( self, oActionEvent ): + def btnCancel_clicked(self, oActionEvent): self.win.endExecute() - def btnPrevious_clicked(self,oActionEvent): + def btnPrevious_clicked(self, oActionEvent): self.win.endExecute() Change(None) self.win.endExecute() @@ -172,5 +170,4 @@ if __name__<>"package" and __name__=="__main__": elif __name__=="package": g_ImplementationHelper.addImplementation( ServerParameter, "org.openoffice.openerp.report.serverparam", ("com.sun.star.task.Job",),) - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Translation.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Translation.py index 06bce1f9fa5..13d02c86329 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Translation.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Translation.py @@ -61,7 +61,7 @@ if __name__<>"package": class AddLang(unohelper.Base, XJobExecutor ): - def __init__(self,sVariable="",sFields="",sDisplayName="",bFromModify=False): + def __init__(self, sVariable="", sFields="", sDisplayName="", bFromModify=False): LoginTest() if not loginstatus and __name__=="package": exit(1) @@ -157,7 +157,7 @@ class AddLang(unohelper.Base, XJobExecutor ): ErrorDialog("Please insert user define field Field-1 or Field-4","Just go to File->Properties->User Define \nField-1 E.g. http://localhost:8069 \nOR \nField-4 E.g. account.invoice") self.win.endExecute() - def lstbox_selected(self,oItemEvent): + def lstbox_selected(self, oItemEvent): try: desktop=getDesktop() @@ -183,7 +183,7 @@ class AddLang(unohelper.Base, XJobExecutor ): if self.bModify: self.win.setEditText("txtUName",self.sGDisplayName) - def getRes(self,sock ,sObject,sVar): + def getRes(self, sock, sObject, sVar): desktop=getDesktop() doc =desktop.getCurrentComponent() docinfo=doc.getDocumentInfo() @@ -203,7 +203,7 @@ class AddLang(unohelper.Base, XJobExecutor ): return sObject - def cmbVariable_selected(self,oItemEvent): + def cmbVariable_selected(self, oItemEvent): if self.count > 0 : try: desktop=getDesktop() @@ -229,7 +229,7 @@ class AddLang(unohelper.Base, XJobExecutor ): except: import traceback;traceback.print_exc() - def btnOk_clicked( self, oActionEvent ): + def btnOk_clicked(self, oActionEvent): self.bOkay = True desktop=getDesktop() doc = desktop.getCurrentComponent() @@ -263,7 +263,7 @@ class AddLang(unohelper.Base, XJobExecutor ): else: ErrorDialog("Please fill appropriate data in name field \nor select particular value from the list of fields.") - def btnCancel_clicked( self, oActionEvent ): + def btnCancel_clicked(self, oActionEvent): self.win.endExecute() diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/error.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/error.py index c0a3e5b5d63..cb86f5f429a 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/error.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/error.py @@ -48,7 +48,7 @@ if __name__<>"package": from gui import * class ErrorDialog: - def __init__(self,sErrorMsg, sErrorHelpMsg="",sTitle="Error Message"): + def __init__(self, sErrorMsg, sErrorHelpMsg="", sTitle="Error Message"): self.win = DBModalDialog(50, 50, 150, 90, sTitle) self.win.addFixedText("lblErrMsg", 5, 5, 190, 25, sErrorMsg) self.win.addFixedText("lblErrHelpMsg", 5, 30, 190, 25, sErrorHelpMsg) diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/functions.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/functions.py index 29f1cd87e46..1b614224147 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/functions.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/functions.py @@ -59,7 +59,13 @@ if __name__<>"package": database="test" uid = 1 -def genTree(object,aList,insField,host,level=3, ending=[], ending_excl=[], recur=[], root='', actualroot=""): +def genTree(object, aList, insField, host, level=3, ending=None, ending_excl=None, recur=None, root='', actualroot=""): + if ending is None: + ending = [] + if ending_excl is None: + ending_excl = [] + if recur is None: + recur = [] try: global url sock=RPCSession(url) @@ -79,7 +85,7 @@ def genTree(object,aList,insField,host,level=3, ending=[], ending_excl=[], recur info = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback)) obj.log_write('Function', LOG_ERROR, info) -def VariableScope(oTcur,insVariable,aObjectList,aComponentAdd,aItemList,sTableName=""): +def VariableScope(oTcur, insVariable, aObjectList, aComponentAdd, aItemList, sTableName=""): if sTableName.find(".") != -1: for i in range(len(aItemList)): if aComponentAdd[i]==sTableName: @@ -96,7 +102,7 @@ def VariableScope(oTcur,insVariable,aObjectList,aComponentAdd,aItemList,sTableNa if aObjectList[j][:aObjectList[j].find("(")] == sLVal and sLVal!="": insVariable.append(aObjectList[j]) -def getList(aObjectList,host,count): +def getList(aObjectList, host, count): desktop=getDesktop() doc =desktop.getCurrentComponent() docinfo=doc.getDocumentInfo() @@ -128,7 +134,7 @@ def getList(aObjectList,host,count): else: aObjectList.append("List of " + docinfo.getUserFieldValue(3)) -def getRelation(sRelName, sItem, sObjName, aObjectList, host ): +def getRelation(sRelName, sItem, sObjName, aObjectList, host): global url sock=RPCSession(url) global passwd @@ -143,7 +149,7 @@ def getRelation(sRelName, sItem, sObjName, aObjectList, host ): getRelation(res[k]['relation'], sItem[sItem.find(".")+1:], sObjName,aObjectList,host) -def getPath(sPath,sMain): +def getPath(sPath, sMain): desktop=getDesktop() doc =desktop.getCurrentComponent() oParEnum = doc.getTextFields().createEnumeration() @@ -161,7 +167,7 @@ def getPath(sPath,sMain): getPath(sPath, sMain) return sPath -def EnumDocument(aItemList,aComponentAdd): +def EnumDocument(aItemList, aComponentAdd): desktop = getDesktop() parent="" bFlag = False @@ -183,7 +189,7 @@ def EnumDocument(aItemList,aComponentAdd): aItemList.append( templist ) aComponentAdd.append( parent ) -def getChildTable(oPar,aItemList,aComponentAdd,sTableName=""): +def getChildTable(oPar, aItemList, aComponentAdd, sTableName=""): sNames = oPar.getCellNames() bEmptyTableFlag=True for val in sNames: @@ -229,7 +235,7 @@ def getChildTable(oPar,aItemList,aComponentAdd,sTableName=""): aComponentAdd.append(sTableName+"."+oPar.Name) return 0 -def getRecersiveSection(oCurrentSection,aSectionList): +def getRecersiveSection(oCurrentSection, aSectionList): desktop=getDesktop() doc =desktop.getCurrentComponent() oParEnum=doc.getText().createEnumeration() diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/logreport.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/logreport.py index 42198337450..f05a836c546 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/logreport.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/logreport.py @@ -39,11 +39,10 @@ def log_detail(self): _logger.setLevel(logging.INFO) class Logger(object): - def log_write(self,name,level,msg): + def log_write(self, name, level, msg): getattr(_logger,level)(msg) def shutdown(self): logging.shutdown() - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/rpc.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/rpc.py index f7c7f636485..5d6f8ca6dbc 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/rpc.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/rpc.py @@ -52,7 +52,7 @@ class RPCGateway(object): class RPCSession(object): - def __init__(self,url): + def __init__(self, url): m = re.match('^(http[s]?://|socket://)([\w.\-]+):(\d{1,5})$', url or '') @@ -152,7 +152,7 @@ class XMLRPCGateway(RPCGateway): return res - def execute(self, sDatabase,UID,sPassword,obj, method, *args): + def execute(self, sDatabase, UID, sPassword, obj, method, *args): global rpc_url sock = xmlrpclib.ServerProxy(rpc_url + 'object') diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/tools.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/tools.py index ef22a3a0d51..53dc81f5bc3 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/tools.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/tools.py @@ -21,19 +21,19 @@ ############################################################################## import urllib -def get_absolute_file_path( url ): +def get_absolute_file_path(url): url_unquoted = urllib.unquote(url) return os.name == 'nt' and url_unquoted[1:] or url_unquoted # This function reads the content of a file and return it to the caller -def read_data_from_file( filename ): +def read_data_from_file(filename): fp = file( filename, "rb" ) data = fp.read() fp.close() return data # This function writes the content to a file -def write_data_to_file( filename, data ): +def write_data_to_file(filename, data): fp = file( filename, 'wb' ) fp.write( data ) fp.close() diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/modify.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/modify.py index 03478651def..b5f5a1501b9 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/modify.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/modify.py @@ -61,7 +61,7 @@ if __name__<>"package": uid = 3 class modify(unohelper.Base, XJobExecutor ): - def __init__( self, ctx ): + def __init__(self, ctx): self.ctx = ctx self.module = "openerp_report" self.version = "0.1" diff --git a/addons/base_report_designer/plugin/openerp_report_designer/test/test_fields.py b/addons/base_report_designer/plugin/openerp_report_designer/test/test_fields.py index 8954aa8d7a8..c23e0e739bf 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/test/test_fields.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/test/test_fields.py @@ -10,7 +10,13 @@ import time sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object') -def get(object, level=3, ending=[], ending_excl=[], recur=[], root=''): +def get(object, level=3, ending=None, ending_excl=None, recur=None, root=''): + if ending is None: + ending = [] + if ending_excl is None: + ending_excl = [] + if recur is None: + recur = [] res = sock.execute('terp', 3, 'admin', 'account.invoice', 'fields_get') key = res.keys() key.sort() diff --git a/addons/base_vat/__init__.py b/addons/base_vat/__init__.py index 1d7c143b7dc..2331d5661c1 100644 --- a/addons/base_vat/__init__.py +++ b/addons/base_vat/__init__.py @@ -22,4 +22,4 @@ import res_company import base_vat -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_vat/res_company.py b/addons/base_vat/res_company.py index e7641db9c68..1c63aa20f07 100644 --- a/addons/base_vat/res_company.py +++ b/addons/base_vat/res_company.py @@ -29,4 +29,4 @@ class res_company_vat (osv.osv): "rather than via a simple format validation (checksum)."), } - \ No newline at end of file + diff --git a/addons/caldav/caldav_node.py b/addons/caldav/caldav_node.py index e32801f5cd5..4c7598660f1 100644 --- a/addons/caldav/caldav_node.py +++ b/addons/caldav/caldav_node.py @@ -43,7 +43,7 @@ class node_calendar_collection(nodes.node_dir): DAV_M_NS = dict_merge2(nodes.node_dir.DAV_M_NS, { "http://calendarserver.org/ns/" : '_get_dav', } ) - def _file_get(self,cr, nodename=False): + def _file_get(self, cr, nodename=False): return [] def _child_get(self, cr, name=False, parent_id=False, domain=None): @@ -100,7 +100,7 @@ class node_calendar_res_col(nodes.node_res_obj): DAV_M_NS = dict_merge2(nodes.node_res_obj.DAV_M_NS, { "http://calendarserver.org/ns/" : '_get_dav', } ) - def _file_get(self,cr, nodename=False): + def _file_get(self, cr, nodename=False): return [] def _child_get(self, cr, name=False, parent_id=False, domain=None): @@ -181,7 +181,7 @@ class node_calendar(nodes.node_class): http_options = { 'DAV': ['calendar-access'] } - def __init__(self,path, parent, context, calendar): + def __init__(self, path, parent, context, calendar): super(node_calendar,self).__init__(path, parent,context) self.calendar_id = calendar.id self.mimetype = 'application/x-directory' @@ -271,7 +271,7 @@ class node_calendar(nodes.node_class): def children(self, cr, domain=None): return self._child_get(cr, domain=domain) - def child(self,cr, name, domain=None): + def child(self, cr, name, domain=None): res = self._child_get(cr, name, domain=domain) if res: return res[0] @@ -353,16 +353,16 @@ class node_calendar(nodes.node_class): return None - def set_data(self, cr, data, fil_obj = None): + def set_data(self, cr, data, fil_obj=None): uid = self.context.uid calendar_obj = self.context._dirobj.pool.get('basic.calendar') res = calendar_obj.import_cal(cr, uid, data, self.calendar_id) return res - def get_data_len(self, cr, fil_obj = None): + def get_data_len(self, cr, fil_obj=None): return self.content_length - def _get_ttag(self,cr): + def _get_ttag(self, cr): return 'calendar-%d' % (self.calendar_id,) def rmcol(self, cr): @@ -441,7 +441,7 @@ class res_node_calendar(nodes.node_class): http_options = { 'DAV': ['calendar-access'] } - def __init__(self,path, parent, context, res_obj, res_model=None, res_id=None): + def __init__(self, path, parent, context, res_obj, res_model=None, res_id=None): super(res_node_calendar,self).__init__(path, parent, context) self.mimetype = 'text/calendar' self.create_date = parent.create_date @@ -474,10 +474,10 @@ class res_node_calendar(nodes.node_class): def _get_caldav_calendar_data(self, cr): return self.get_data(cr) - def get_data_len(self, cr, fil_obj = None): + def get_data_len(self, cr, fil_obj=None): return self.content_length - def set_data(self, cr, data, fil_obj = None): + def set_data(self, cr, data, fil_obj=None): uid = self.context.uid context = self.context.context.copy() context.update(self.dctx) @@ -486,7 +486,7 @@ class res_node_calendar(nodes.node_class): res = calendar_obj.import_cal(cr, uid, data, self.calendar_id, context=context) return res - def _get_ttag(self,cr): + def _get_ttag(self, cr): res = False if self.model and self.res_id: res = '%s_%d' % (self.model, self.res_id) diff --git a/addons/crm/crm.py b/addons/crm/crm.py index cca195a1539..d5f5b2511d1 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -58,7 +58,7 @@ class crm_case_channel(osv.osv): class crm_case_stage(osv.osv): """ Model for case stages. This models the main stages of a document - management flow. Main CRM objects (leads, opportunities, project + management flow. Main CRM objects (leads, opportunities, project issues, ...) will now use only stages, instead of state and stages. Stages are for example used to display the kanban view of records. """ @@ -126,11 +126,11 @@ class crm_case_section(osv.osv): 'note': fields.text('Description'), 'working_hours': fields.float('Working Hours', digits=(16,2 )), 'stage_ids': fields.many2many('crm.case.stage', 'section_stage_rel', 'section_id', 'stage_id', 'Stages'), - 'alias_id': fields.many2one('mail.alias', 'Alias', ondelete="cascade", required=True, + 'alias_id': fields.many2one('mail.alias', 'Alias', ondelete="cascade", required=True, help="The email address associated with this team. New emails received will automatically " "create new leads assigned to the team."), } - + def _get_stage_common(self, cr, uid, context): ids = self.pool.get('crm.case.stage').search(cr, uid, [('case_default','=',1)], context=context) return ids @@ -165,12 +165,12 @@ class crm_case_section(osv.osv): name = record['parent_id'][1] + ' / ' + name res.append((record['id'], name)) return res - + def create(self, cr, uid, vals, context=None): mail_alias = self.pool.get('mail.alias') if not vals.get('alias_id'): vals.pop('alias_name', None) # prevent errors during copy() - alias_id = mail_alias.create_unique_alias(cr, uid, + alias_id = mail_alias.create_unique_alias(cr, uid, {'alias_name': vals['name']}, model_name="crm.lead", context=context) @@ -178,7 +178,7 @@ class crm_case_section(osv.osv): res = super(crm_case_section, self).create(cr, uid, vals, context) mail_alias.write(cr, uid, [vals['alias_id']], {'alias_defaults': {'section_id': res, 'type':'lead'}}, context) return res - + def unlink(self, cr, uid, ids, context=None): # Cascade-delete mail aliases as well, as they should not exist without the sales team. mail_alias = self.pool.get('mail.alias') @@ -217,7 +217,6 @@ class crm_case_resource_type(osv.osv): 'section_id': fields.many2one('crm.case.section', 'Sales Team'), } - def _links_get(self, cr, uid, context=None): """Gets links value for reference field""" obj = self.pool.get('res.request.link') diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index d668ea710c1..7e33f397e8a 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -311,7 +311,6 @@ class crm_lead(base_stage, format_address, osv.osv): } return {'value' : values} - def _check(self, cr, uid, ids=False, context=None): """ Override of the base.stage method. Function called by the scheduler to process cases for date actions @@ -801,7 +800,7 @@ class crm_lead(base_stage, format_address, osv.osv): if section_id: vals.setdefault('message_follower_ids', []) vals['message_follower_ids'] += [(4, follower.id) for follower in section_id.message_follower_ids] - return super(crm_lead,self).write(cr, uid, ids, vals, context) + return super(crm_lead,self).write(cr, uid, ids, vals, context) # ---------------------------------------- # Mail Gateway diff --git a/addons/crm_claim/crm_claim.py b/addons/crm_claim/crm_claim.py index 535f6d20367..cbf3ec9f13a 100644 --- a/addons/crm_claim/crm_claim.py +++ b/addons/crm_claim/crm_claim.py @@ -35,7 +35,7 @@ CRM_CLAIM_PENDING_STATES = ( class crm_claim_stage(osv.osv): """ Model for claim stages. This models the main stages of a claim - management flow. Main CRM objects (leads, opportunities, project + management flow. Main CRM objects (leads, opportunities, project issues, ...) will now use only stages, instead of state and stages. Stages are for example used to display the kanban view of records. """ @@ -104,7 +104,7 @@ class crm_claim(base_stage, osv.osv): 'email_from': fields.char('Email', size=128, help="These people will receive email."), 'partner_phone': fields.char('Phone', size=32), 'stage_id': fields.many2one ('crm.claim.stage', 'Stage', - domain="['|', ('section_ids', '=', section_id), ('case_default', '=', True)]"), + domain="['|', ('section_ids', '=', section_id), ('case_default', '=', True)]"), 'cause': fields.text('Root Cause'), 'state': fields.related('stage_id', 'state', type="selection", store=True, selection=crm.AVAILABLE_STATES, string="State", readonly=True, diff --git a/addons/crm_helpdesk/crm_helpdesk.py b/addons/crm_helpdesk/crm_helpdesk.py index 9bd56cf3944..f36a3b72640 100644 --- a/addons/crm_helpdesk/crm_helpdesk.py +++ b/addons/crm_helpdesk/crm_helpdesk.py @@ -69,9 +69,9 @@ class crm_helpdesk(base_state, base_stage, osv.osv): 'probability': fields.float('Probability (%)'), 'categ_id': fields.many2one('crm.case.categ', 'Category', \ domain="['|',('section_id','=',False),('section_id','=',section_id),\ - ('object_id.model', '=', 'crm.helpdesk')]"), - 'duration': fields.float('Duration', states={'done': [('readonly', True)]}), - 'state': fields.selection(crm.AVAILABLE_STATES, 'Status', size=16, readonly=True, + ('object_id.model', '=', 'crm.helpdesk')]"), + 'duration': fields.float('Duration', states={'done': [('readonly', True)]}), + 'state': fields.selection(crm.AVAILABLE_STATES, 'Status', size=16, readonly=True, help='The state is set to \'Draft\', when a case is created.\ \nIf the case is in progress the state is set to \'Open\'.\ \nWhen the case is over, the state is set to \'Done\'.\ @@ -139,9 +139,9 @@ class crm_helpdesk(base_state, base_stage, osv.osv): return super(crm_helpdesk,self).message_update(cr, uid, ids, msg, update_vals=update_vals, context=context) - # ****************************** + # --------------------------------------------------- # OpenChatter - # ****************************** + # --------------------------------------------------- def case_get_note_msg_prefix(self, cr, uid, id, context=None): """ override of default base_state method. """ @@ -152,5 +152,4 @@ class crm_helpdesk(base_state, base_stage, osv.osv): self.message_post(cr, uid, ids, body=msg, context=context) return True - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm_profiling/crm_profiling.py b/addons/crm_profiling/crm_profiling.py index 4cc54a8d3d4..8f07dfcbdda 100644 --- a/addons/crm_profiling/crm_profiling.py +++ b/addons/crm_profiling/crm_profiling.py @@ -77,7 +77,7 @@ def _get_parents(cr, uid, ids): return ids_to_check -def test_prof(cr, uid, seg_id, pid, answers_ids = []): +def test_prof(cr, uid, seg_id, pid, answers_ids=None): """ return True if the partner pid fetch the segmentation rule seg_id @param cr: the current row, from the database cursor, diff --git a/addons/document/content_index.py b/addons/document/content_index.py index 4cf3c8dfed2..399541e1f59 100644 --- a/addons/document/content_index.py +++ b/addons/document/content_index.py @@ -51,7 +51,7 @@ class indexer(object): return mts[0] return None - def indexContent(self, content, filename=None, realfile = None): + def indexContent(self, content, filename=None, realfile=None): """ Use either content or the real file, to index. Some parsers will work better with the actual content, others parse a file easier. Try the @@ -95,16 +95,15 @@ class indexer(object): raise NhException('No appropriate method to index file.') - def _doIndexContent(self,content): + def _doIndexContent(self, content): raise NhException("Content cannot be handled here.") - def _doIndexFile(self,fpath): + def _doIndexFile(self, fpath): raise NhException("Content cannot be handled here.") def __repr__(self): return "" %(self.__module__, self.__class__.__name__) - def mime_match(mime, mdict): if mdict.has_key(mime): return (mime, mdict[mime]) @@ -136,7 +135,7 @@ class contentIndex(object): if not f: raise Exception("Your indexer should at least support a mimetype or extension.") - def doIndex(self, content, filename=None, content_type=None, realfname = None, debug=False): + def doIndex(self, content, filename=None, content_type=None, realfname=None, debug=False): fobj = None fname = None mime = None diff --git a/addons/document/document.py b/addons/document/document.py index cb30e5f93c9..3ae783f49e7 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -149,7 +149,7 @@ class document_file(osv.osv): _sql_constraints = [ # filename_uniq is not possible in pure SQL ] - def _check_duplication(self, cr, uid, vals, ids=[], op='create'): + def _check_duplication(self, cr, uid, vals, ids=None, op='create'): name = vals.get('name', False) parent_id = vals.get('parent_id', False) res_model = vals.get('res_model', False) diff --git a/addons/document/document_directory.py b/addons/document/document_directory.py index ac0671d36d3..ec51d9bcc6c 100644 --- a/addons/document/document_directory.py +++ b/addons/document/document_directory.py @@ -221,7 +221,7 @@ class document_directory(osv.osv): pass return res - def _locate_child(self, cr, uid, root_id, uri,nparent, ncontext): + def _locate_child(self, cr, uid, root_id, uri, nparent, ncontext): """ try to locate the node in uri, Return a tuple (node_dir, remaining_path) """ @@ -234,7 +234,7 @@ class document_directory(osv.osv): default.update(name=_("%s (copy)") % (name)) return super(document_directory,self).copy(cr, uid, id, default, context=context) - def _check_duplication(self, cr, uid, vals, ids=[], op='create'): + def _check_duplication(self, cr, uid, vals, ids=None, op='create'): name=vals.get('name',False) parent_id=vals.get('parent_id',False) ressource_parent_type_id=vals.get('ressource_parent_type_id',False) diff --git a/addons/document/nodes.py b/addons/document/nodes.py index f1c3c71a8e6..6bcb2237a9e 100644 --- a/addons/document/nodes.py +++ b/addons/document/nodes.py @@ -103,7 +103,7 @@ class node_context(object): def get(self, name, default=None): return self.context.get(name, default) - def get_uri(self, cr, uri): + def get_uri(self, cr, uri): """ Although this fn passes back to doc.dir, it is needed since it is a potential caching point. """ @@ -252,7 +252,7 @@ class node_class(object): print "node_class.children()" return [] #stub - def child(self,cr, name, domain=None): + def child(self, cr, name, domain=None): print "node_class.child()" return None @@ -270,7 +270,7 @@ class node_class(object): print "node_class.path_get()" return False - def get_data(self,cr): + def get_data(self, cr): raise TypeError('No data for %s.'% self.type) def open_data(self, cr, mode): @@ -287,10 +287,10 @@ class node_class(object): """ raise TypeError('No data for %s.' % self.type) - def _get_storage(self,cr): + def _get_storage(self, cr): raise RuntimeError("No storage for base class.") - def get_etag(self,cr): + def get_etag(self, cr): """ Get a tag, unique per object + modification. see. http://tools.ietf.org/html/rfc2616#section-13.3.3 """ @@ -434,7 +434,9 @@ class node_database(node_class): """ our_type = 'database' - def __init__(self, path=[], parent=False, context=None): + def __init__(self, path=None, parent=False, context=None): + if path is None: + path = [] super(node_database,self).__init__(path, parent, context) self.unixperms = 040750 self.uidperms = 5 @@ -477,11 +479,11 @@ class node_database(node_class): return res - def _file_get(self,cr, nodename=False): + def _file_get(self, cr, nodename=False): res = [] return res - def _get_ttag(self,cr): + def _get_ttag(self, cr): return 'db-%s' % cr.dbname def mkdosname(company_name, default='noname'): @@ -666,7 +668,6 @@ class node_dir(node_database): return dirobj.create(cr, uid, val) - def create_child(self, cr, path, data=None): """ API function to create a child file object and node Return the node_* created @@ -693,7 +694,7 @@ class node_dir(node_database): fnode.set_data(cr, data, fil) return fnode - def _get_ttag(self,cr): + def _get_ttag(self, cr): return 'dir-%d' % self.dir_id def move_to(self, cr, ndir_node, new_name=False, fil_obj=None, ndir_obj=None, in_write=False): @@ -802,7 +803,7 @@ class node_res_dir(node_class): def children(self, cr, domain=None): return self._child_get(cr, domain=domain) - def child(self,cr, name, domain=None): + def child(self, cr, name, domain=None): res = self._child_get(cr, name, domain=domain) if res: return res[0] @@ -878,7 +879,7 @@ class node_res_dir(node_class): res.append(self.res_obj_class(res_name, self.dir_id, self, self.context, self.res_model, bo)) return res - def _get_ttag(self,cr): + def _get_ttag(self, cr): return 'rdir-%d' % self.dir_id class node_res_obj(node_class): @@ -889,7 +890,7 @@ class node_res_obj(node_class): node_dirs (with limited domain). """ our_type = 'collection' - def __init__(self, path, dir_id, parent, context, res_model, res_bo, res_id = None): + def __init__(self, path, dir_id, parent, context, res_model, res_bo, res_id=None): super(node_res_obj,self).__init__(path, parent,context) assert parent #todo: more info from dirr @@ -958,7 +959,7 @@ class node_res_obj(node_class): return res[0] return None - def _file_get(self,cr, nodename=False): + def _file_get(self, cr, nodename=False): res = [] is_allowed = self.check_perms((nodename and 1) or 5) if not is_allowed: @@ -1160,7 +1161,7 @@ class node_res_obj(node_class): fnode.set_data(cr, data, fil) return fnode - def _get_ttag(self,cr): + def _get_ttag(self, cr): return 'rodir-%d-%d' % (self.dir_id, self.res_id) node_res_dir.res_obj_class = node_res_obj @@ -1210,7 +1211,6 @@ class node_file(node_class): return False return self.file_id == other.file_id - def open_data(self, cr, mode): stor = self.storage_id assert stor, "No storage for file #%s." % self.file_id @@ -1262,7 +1262,7 @@ class node_file(node_class): else: self.path = dirpath[0] - def get_data(self, cr, fil_obj = None): + def get_data(self, cr, fil_obj=None): """ Retrieve the data for some file. fil_obj may optionally be specified, and should be a browse object for the file. This is useful when the caller has already initiated @@ -1278,14 +1278,14 @@ class node_file(node_class): stobj = self.context._dirobj.pool.get('document.storage') return stobj.get_data(cr, self.context.uid,stor, self,self.context.context, fil_obj) - def get_data_len(self, cr, fil_obj = None): + def get_data_len(self, cr, fil_obj=None): # TODO: verify with the storage object! bin_size = self.context.context.get('bin_size', False) if bin_size and not self.content_length: self.content_length = fil_obj.db_datas return self.content_length - def set_data(self, cr, data, fil_obj = None): + def set_data(self, cr, data, fil_obj=None): """ Store data at some file. fil_obj may optionally be specified, and should be a browse object for the file. This is useful when the caller has already initiated @@ -1299,7 +1299,7 @@ class node_file(node_class): stobj = self.context._dirobj.pool.get('document.storage') return stobj.set_data(cr, self.context.uid,stor, self, data, self.context.context, fil_obj) - def _get_ttag(self,cr): + def _get_ttag(self, cr): return 'file-%d' % self.file_id def move_to(self, cr, ndir_node, new_name=False, fil_obj=None, ndir_obj=None, in_write=False): @@ -1362,7 +1362,7 @@ class node_file(node_class): class node_content(node_class): our_type = 'content' - def __init__(self, path, parent, context, cnt, dctx = None, act_id=None): + def __init__(self, path, parent, context, cnt, dctx=None, act_id=None): super(node_content,self).__init__(path, parent,context) self.cnt_id = cnt.id self.create_date = False @@ -1382,7 +1382,7 @@ class node_content(node_class): self.dctx.update(dctx) self.act_id = act_id - def fill_fields(self, cr, dctx = None): + def fill_fields(self, cr, dctx=None): """ Try to read the object and fill missing fields, like mimetype, dates etc. This function must be different from the constructor, because @@ -1395,8 +1395,7 @@ class node_content(node_class): if res and res[0][0]: self.mimetype = str(res[0][0]) - - def get_data(self, cr, fil_obj = None): + def get_data(self, cr, fil_obj=None): cntobj = self.context._dirobj.pool.get('document.directory.content') if not self.check_perms(4): raise IOError(errno.EPERM, "Permission denied.") @@ -1426,7 +1425,7 @@ class node_content(node_class): return nodefd_content(self, cr, mode, ctx) - def get_data_len(self, cr, fil_obj = None): + def get_data_len(self, cr, fil_obj=None): # FIXME : here, we actually generate the content twice!! # we should have cached the generated content, but it is # not advisable to do keep it in memory, until we have a cache @@ -1435,7 +1434,7 @@ class node_content(node_class): self.get_data(cr,fil_obj) return self.content_length - def set_data(self, cr, data, fil_obj = None): + def set_data(self, cr, data, fil_obj=None): cntobj = self.context._dirobj.pool.get('document.directory.content') if not self.check_perms(2): raise IOError(errno.EPERM, "Permission denied.") @@ -1444,7 +1443,7 @@ class node_content(node_class): ctx.update(self.dctx) return cntobj.process_write(cr, self.context.uid, self, data, ctx) - def _get_ttag(self,cr): + def _get_ttag(self, cr): return 'cnt-%d%s' % (self.cnt_id,(self.act_id and ('-' + str(self.act_id))) or '') def get_dav_resourcetype(self, cr): @@ -1558,5 +1557,4 @@ class nodefd_static(StringIO, node_descriptor): cr.close() StringIO.close(self) -#eof # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/document/odt2txt.py b/addons/document/odt2txt.py old mode 100755 new mode 100644 index 9ca9b6e596f..8a3dc59d9ed --- a/addons/document/odt2txt.py +++ b/addons/document/odt2txt.py @@ -24,11 +24,11 @@ import sys, zipfile, xml.dom.minidom import StringIO class OpenDocumentTextFile : - def __init__ (self, filepath) : + def __init__ (self, filepath): zip = zipfile.ZipFile(filepath) self.content = xml.dom.minidom.parseString(zip.read("content.xml")) - def toString (self) : + def toString (self): """ Converts the document to a string. """ buffer = u"" for val in ["text:p", "text:h", "text:list"]: @@ -36,7 +36,7 @@ class OpenDocumentTextFile : buffer += self.textToString(paragraph) + "\n" return buffer - def textToString(self, element) : + def textToString(self, element): buffer = u"" for node in element.childNodes : if node.nodeType == xml.dom.Node.TEXT_NODE : diff --git a/addons/document/std_index.py b/addons/document/std_index.py index 422590e127f..95c5e594c25 100644 --- a/addons/document/std_index.py +++ b/addons/document/std_index.py @@ -39,7 +39,7 @@ def _to_unicode(s): except UnicodeError: return s -def textToString(element) : +def textToString(element): buffer = u"" for node in element.childNodes : if node.nodeType == xml.dom.Node.TEXT_NODE : @@ -56,7 +56,7 @@ class TxtIndex(indexer): def _getExtensions(self): return ['.txt', '.py'] - def _doIndexContent(self,content): + def _doIndexContent(self, content): return content cntIndex.register(TxtIndex()) @@ -68,7 +68,7 @@ class PptxIndex(indexer): def _getExtensions(self): return ['.pptx'] - def _doIndexFile(self,fname): + def _doIndexFile(self, fname): def toString () : """ Converts the document to a string. """ buffer = u"" @@ -96,7 +96,7 @@ class DocIndex(indexer): def _getExtensions(self): return ['.doc'] - def _doIndexFile(self,fname): + def _doIndexFile(self, fname): try: pop = Popen(['antiword', fname], shell=False, stdout=PIPE) (data, _) = pop.communicate() @@ -116,7 +116,7 @@ class DocxIndex(indexer): def _getExtensions(self): return ['.docx'] - def _doIndexFile(self,fname): + def _doIndexFile(self, fname): zip = zipfile.ZipFile(fname) content = xml.dom.minidom.parseString(zip.read("word/document.xml")) def toString () : @@ -141,7 +141,7 @@ class XlsxIndex(indexer): def _getExtensions(self): return ['.xlsx'] - def _doIndexFile(self,fname): + def _doIndexFile(self, fname): zip = zipfile.ZipFile(fname) content = xml.dom.minidom.parseString(zip.read("xl/sharedStrings.xml")) def toString () : @@ -165,7 +165,7 @@ class PdfIndex(indexer): def _getExtensions(self): return ['.pdf'] - def _doIndexFile(self,fname): + def _doIndexFile(self, fname): pop = Popen(['pdftotext', '-enc', 'UTF-8', '-nopgbrk', fname, '-'], shell=False, stdout=PIPE) (data, _) = pop.communicate() return _to_unicode(data) @@ -181,7 +181,7 @@ class ImageNoIndex(indexer): return [] #return ['.png','.jpg','.gif','.jpeg','.bmp','.tiff'] - def _doIndexContent(self,content): + def _doIndexContent(self, content): return 'image' diff --git a/addons/document_webdav/document_webdav.py b/addons/document_webdav/document_webdav.py index f53353dd43c..3b604d6cffb 100644 --- a/addons/document_webdav/document_webdav.py +++ b/addons/document_webdav/document_webdav.py @@ -57,7 +57,7 @@ class document_davdir(osv.osv): # TODO group return - def _locate_child(self, cr, uid, root_id, uri,nparent, ncontext): + def _locate_child(self, cr, uid, root_id, uri, nparent, ncontext): """ try to locate the node in uri, Return a tuple (node_dir, remaining_path) """ diff --git a/addons/document_webdav/redirect.py b/addons/document_webdav/redirect.py index 31f462bcbbe..c3dd9248f45 100644 --- a/addons/document_webdav/redirect.py +++ b/addons/document_webdav/redirect.py @@ -30,7 +30,7 @@ class RedirectHTTPHandler(HttpLogHandler, FixSendError, HttpOptions, HTTPHandler _HTTP_OPTIONS = { 'Allow': ['OPTIONS', 'GET', 'HEAD', 'PROPFIND'] } redirect_paths = {} - def __init__(self,request, client_address, server): + def __init__(self, request, client_address, server): HTTPHandler.__init__(self,request,client_address,server) def send_head(self): diff --git a/addons/document_webdav/test_davclient.py b/addons/document_webdav/test_davclient.py old mode 100755 new mode 100644 index 0f66363c553..79ee471c69e --- a/addons/document_webdav/test_davclient.py +++ b/addons/document_webdav/test_davclient.py @@ -683,7 +683,7 @@ class DAVClient(object): assert d2 == d, "Data does not match" return ctype, rrange, d - def gd_put(self, path, body=None, srcpath=None, mime=None, noclobber=False, ): + def gd_put(self, path, body=None, srcpath=None, mime=None, noclobber=False): """ HTTP PUT @param noclobber will prevent overwritting a resource (If-None-Match) @param mime will set the content-type @@ -705,5 +705,4 @@ class DAVClient(object): etag = m.getheader('ETag') return etag or True -#eof # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/document_webdav/webdav.py b/addons/document_webdav/webdav.py index 903dd6a16ba..f714ff51518 100644 --- a/addons/document_webdav/webdav.py +++ b/addons/document_webdav/webdav.py @@ -236,7 +236,7 @@ def mk_prop_response(self, uri, good_props, bad_props, doc): return re -def mk_propname_response(self,uri,propnames,doc): +def mk_propname_response(self, uri, propnames, doc): """ make a new result element for a PROPNAME request This will simply format the propnames list. diff --git a/addons/document_webdav/webdav_server.py b/addons/document_webdav/webdav_server.py index 28909e61167..70ad4d2657f 100644 --- a/addons/document_webdav/webdav_server.py +++ b/addons/document_webdav/webdav_server.py @@ -81,7 +81,7 @@ class DAVHandler(HttpOptions, FixSendError, DAVRequestHandler): 'DELETE', 'TRACE', 'REPORT', ] } - def get_userinfo(self,user,pw): + def get_userinfo(self, user, pw): return False def _log(self, message): @@ -167,7 +167,7 @@ class DAVHandler(HttpOptions, FixSendError, DAVRequestHandler): self.close_connection = 1 DAVRequestHandler.send_header(self, key, value) - def send_body(self, DATA, code = None, msg = None, desc = None, ctype='application/octet-stream', headers=None): + def send_body(self, DATA, code=None, msg=None, desc=None, ctype='application/octet-stream', headers=None): if headers and 'Connection' in headers: pass elif self.request_version in ('HTTP/1.0', 'HTTP/0.9'): @@ -441,10 +441,10 @@ class dummy_dav_interface(object): def __init__(self, parent): self.parent = parent - def get_propnames(self,uri): + def get_propnames(self, uri): return self.PROPS - def get_prop(self,uri,ns,propname): + def get_prop(self, uri, ns, propname): if self.M_NS.has_key(ns): prefix=self.M_NS[ns] else: @@ -460,10 +460,10 @@ class dummy_dav_interface(object): def get_data(self, uri, range=None): raise DAV_NotFound - def _get_dav_creationdate(self,uri): + def _get_dav_creationdate(self, uri): return time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()) - def _get_dav_getlastmodified(self,uri): + def _get_dav_getlastmodified(self, uri): return time.strftime("%a, %d %b %Y %H:%M:%S GMT", time.gmtime()) def _get_dav_displayname(self, uri): diff --git a/addons/email_template/html2text.py b/addons/email_template/html2text.py old mode 100755 new mode 100644 index 745381850e3..880a8bb43a8 --- a/addons/email_template/html2text.py +++ b/addons/email_template/html2text.py @@ -41,13 +41,13 @@ def name2cp(k): if k.startswith("&#") and k.endswith(";"): return int(k[2:-1]) # not in latin-1 return ord(codecs.latin_1_decode(k)[0]) -unifiable = {'rsquo':"'", 'lsquo':"'", 'rdquo':'"', 'ldquo':'"', +unifiable = {'rsquo':"'", 'lsquo':"'", 'rdquo':'"', 'ldquo':'"', 'copy':'(C)', 'mdash':'--', 'nbsp':' ', 'rarr':'->', 'larr':'<-', 'middot':'*', 'ndash':'-', 'oelig':'oe', 'aelig':'ae', -'agrave':'a', 'aacute':'a', 'acirc':'a', 'atilde':'a', 'auml':'a', 'aring':'a', -'egrave':'e', 'eacute':'e', 'ecirc':'e', 'euml':'e', +'agrave':'a', 'aacute':'a', 'acirc':'a', 'atilde':'a', 'auml':'a', 'aring':'a', +'egrave':'e', 'eacute':'e', 'ecirc':'e', 'euml':'e', 'igrave':'i', 'iacute':'i', 'icirc':'i', 'iuml':'i', -'ograve':'o', 'oacute':'o', 'ocirc':'o', 'otilde':'o', 'ouml':'o', +'ograve':'o', 'oacute':'o', 'ocirc':'o', 'otilde':'o', 'ouml':'o', 'ugrave':'u', 'uacute':'u', 'ucirc':'u', 'uuml':'u'} unifiable_n = {} @@ -60,7 +60,7 @@ def charref(name): c = int(name[1:], 16) else: c = int(name) - + if not UNICODE_SNOB and c in unifiable_n.keys(): return unifiable_n[c] else: @@ -76,14 +76,14 @@ def entityref(c): def replaceEntities(s): s = s.group(1) - if s[0] == "#": + if s[0] == "#": return charref(s[1:]) else: return entityref(s) r_unescape = re.compile(r"&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));") def unescape(s): return r_unescape.sub(replaceEntities, s) - + def fixattrs(attrs): # Fix bug in sgmllib.py if not attrs: return attrs @@ -105,7 +105,7 @@ def optwrap(text): """Wrap all paragraphs in the provided text.""" if not BODY_WIDTH: return text - + assert wrap, "Requires Python 2.3." result = '' newlines = 0 @@ -136,7 +136,7 @@ def hn(tag): class _html2text(sgmllib.SGMLParser): def __init__(self, out=sys.stdout.write, baseurl=''): sgmllib.SGMLParser.__init__(self) - + if out is None: self.out = self.outtextf else: self.out = out self.outtext = u'' @@ -157,43 +157,43 @@ class _html2text(sgmllib.SGMLParser): self.abbr_data = None # last inner HTML (for abbr being defined) self.abbr_list = {} # stack of abbreviations to write later self.baseurl = baseurl - - def outtextf(self, s): + + def outtextf(self, s): self.outtext += s - + def close(self): sgmllib.SGMLParser.close(self) - + self.pbr() self.o('', 0, 'end') - + return self.outtext - + def handle_charref(self, c): self.o(charref(c)) def handle_entityref(self, c): self.o(entityref(c)) - + def unknown_starttag(self, tag, attrs): self.handle_tag(tag, attrs, 1) - + def unknown_endtag(self, tag): self.handle_tag(tag, None, 0) - + def previousIndex(self, attrs): """ returns the index of certain set of attributes (of a link) in the self.a list - + If the set of attributes is not found, returns None """ if not attrs.has_key('href'): return None - + i = -1 for a in self.a: i += 1 match = 0 - + if a.has_key('href') and a['href'] == attrs['href']: if a.has_key('title') or attrs.has_key('title'): if (a.has_key('title') and attrs.has_key('title') and @@ -206,13 +206,13 @@ class _html2text(sgmllib.SGMLParser): def handle_tag(self, tag, attrs, start): attrs = fixattrs(attrs) - + if hn(tag): self.p() if start: self.o(hn(tag)*"#" + ' ') if tag in ['p', 'div']: self.p() - + if tag == "br" and start: self.o(" \n") if tag == "hr" and start: @@ -220,21 +220,21 @@ class _html2text(sgmllib.SGMLParser): self.o("* * *") self.p() - if tag in ["head", "style", 'script']: + if tag in ["head", "style", 'script']: if start: self.quiet += 1 else: self.quiet -= 1 if tag in ["body"]: self.quiet = 0 # sites like 9rules.com never close - + if tag == "blockquote": - if start: + if start: self.p(); self.o('> ', 0, 1); self.start = 1 self.blockquote += 1 else: self.blockquote -= 1 self.p() - + if tag in ['em', 'i', 'u']: self.o("_") if tag in ['strong', 'b']: self.o("**") if tag == "code" and not self.pre: self.o('`') #TODO: `` `this` `` @@ -243,7 +243,7 @@ class _html2text(sgmllib.SGMLParser): attrsD = {} for (x, y) in attrs: attrsD[x] = y attrs = attrsD - + self.abbr_title = None self.abbr_data = '' if attrs.has_key('title'): @@ -253,13 +253,13 @@ class _html2text(sgmllib.SGMLParser): self.abbr_list[self.abbr_data] = self.abbr_title self.abbr_title = None self.abbr_data = '' - + if tag == "a": if start: attrsD = {} for (x, y) in attrs: attrsD[x] = y attrs = attrsD - if attrs.has_key('href') and not (SKIP_INTERNAL_LINKS and attrs['href'].startswith('#')): + if attrs.has_key('href') and not (SKIP_INTERNAL_LINKS and attrs['href'].startswith('#')): self.astack.append(attrs) self.o("[") else: @@ -277,7 +277,7 @@ class _html2text(sgmllib.SGMLParser): a['outcount'] = self.outcount self.a.append(a) self.o("][" + `a['count']` + "]") - + if tag == "img" and start: attrsD = {} for (x, y) in attrs: attrsD[x] = y @@ -296,20 +296,20 @@ class _html2text(sgmllib.SGMLParser): self.o("![") self.o(alt) self.o("]["+`attrs['count']`+"]") - + if tag == 'dl' and start: self.p() if tag == 'dt' and not start: self.pbr() if tag == 'dd' and start: self.o(' ') if tag == 'dd' and not start: self.pbr() - + if tag in ["ol", "ul"]: if start: self.list.append({'name':tag, 'num':0}) else: if self.list: self.list.pop() - + self.p() - + if tag == 'li': if start: self.pbr() @@ -323,10 +323,10 @@ class _html2text(sgmllib.SGMLParser): self.start = 1 else: self.pbr() - + if tag in ["table", "tr"] and start: self.p() if tag == 'td': self.pbr() - + if tag == "pre": if start: self.startpre = 1 @@ -334,34 +334,35 @@ class _html2text(sgmllib.SGMLParser): else: self.pre = 0 self.p() - + def pbr(self): if self.p_p == 0: self.p_p = 1 - def p(self): self.p_p = 2 - + def p(self): + self.p_p = 2 + def o(self, data, puredata=0, force=0): if self.abbr_data is not None: self.abbr_data += data - - if not self.quiet: + + if not self.quiet: if puredata and not self.pre: data = re.sub('\s+', ' ', data) if data and data[0] == ' ': self.space = 1 data = data[1:] if not data and not force: return - + if self.startpre: #self.out(" :") #TODO: not output when already one there self.startpre = 0 - + bq = (">" * self.blockquote) if not (force and data and data[0] == ">") and self.blockquote: bq += " " - + if self.pre: bq += " " data = data.replace("\n", "\n"+bq) - + if self.start: self.space = 0 self.p_p = 0 @@ -377,7 +378,7 @@ class _html2text(sgmllib.SGMLParser): if self.p_p: self.out(('\n'+bq)*self.p_p) self.space = 0 - + if self.space: if not self.lastWasNL: self.out(' ') self.space = 0 @@ -388,7 +389,7 @@ class _html2text(sgmllib.SGMLParser): newa = [] for link in self.a: if self.outcount > link['outcount']: - self.out(" ["+`link['count']`+"]: " + urlparse.urljoin(self.baseurl, link['href'])) + self.out(" ["+`link['count']`+"]: " + urlparse.urljoin(self.baseurl, link['href'])) if link.has_key('title'): self.out(" ("+link['title']+")") self.out("\n") else: @@ -397,7 +398,7 @@ class _html2text(sgmllib.SGMLParser): if self.a != newa: self.out("\n") # Don't need an extra line when nothing was done. self.a = newa - + if self.abbr_list and force == "end": for abbr, definition in self.abbr_list.items(): self.out(" *[" + abbr + "]: " + definition + "\n") @@ -410,8 +411,9 @@ class _html2text(sgmllib.SGMLParser): def handle_data(self, data): if r'\/script>' in data: self.quiet -= 1 self.o(data, 1) - - def unknown_decl(self, data): pass + + def unknown_decl(self, data): + pass def wrapwrite(text): sys.stdout.write(text.encode('utf8')) diff --git a/addons/event/event.py b/addons/event/event.py index 44def4f0c76..6512139faee 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -223,6 +223,7 @@ class event_event(osv.osv): 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'event.event', context=c), 'user_id': lambda obj, cr, uid, context: uid, } + def subscribe_to_event(self, cr, uid, ids, context=None): register_pool = self.pool.get('event.registration') user_pool = self.pool.get('res.users') @@ -252,6 +253,7 @@ class event_event(osv.osv): _constraints = [ (_check_closing_date, 'Error ! Closing Date cannot be set before Beginning Date.', ['date_end']), ] + def onchange_event_type(self, cr, uid, ids, type_event, context=None): if type_event: type_info = self.pool.get('event.type').browse(cr,uid,type_event,context) @@ -347,7 +349,6 @@ class event_registration(osv.osv): 'phone': fields.char('Phone', size=64), 'name': fields.char('Name', size=128, select=True), } - _defaults = { 'nb_register': 1, 'state': 'draft', diff --git a/addons/event/report/__init__.py b/addons/event/report/__init__.py index 1c60e2715df..4f2516e5615 100644 --- a/addons/event/report/__init__.py +++ b/addons/event/report/__init__.py @@ -21,4 +21,4 @@ import report_event_registration -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/event/wizard/event_confirm.py b/addons/event/wizard/event_confirm.py index e21d523bb12..e001aac9937 100644 --- a/addons/event/wizard/event_confirm.py +++ b/addons/event/wizard/event_confirm.py @@ -34,4 +34,4 @@ class event_confirm(osv.osv_memory): event_confirm() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/event_moodle/event_moodle.py b/addons/event_moodle/event_moodle.py index 0a565200f35..0bac50ca445 100644 --- a/addons/event_moodle/event_moodle.py +++ b/addons/event_moodle/event_moodle.py @@ -127,7 +127,7 @@ class event_moodle(osv.osv): passwd = passwd + '+' return passwd - def check_email(self,email): + def check_email(self, email): """ check if email is correct diff --git a/addons/event_project/event_project.py b/addons/event_project/event_project.py index 8590b84c4ad..34892b56f39 100644 --- a/addons/event_project/event_project.py +++ b/addons/event_project/event_project.py @@ -55,4 +55,4 @@ class event(osv.osv): event() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/event_project/wizard/event_project_retro.py b/addons/event_project/wizard/event_project_retro.py index c7eba5e0ec1..a794749701b 100644 --- a/addons/event_project/wizard/event_project_retro.py +++ b/addons/event_project/wizard/event_project_retro.py @@ -80,4 +80,4 @@ class event_project(osv.osv_memory): event_project() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_attendance/wizard/hr_attendance_bymonth.py b/addons/hr_attendance/wizard/hr_attendance_bymonth.py index 40dca536d7d..03e1db5dc3a 100644 --- a/addons/hr_attendance/wizard/hr_attendance_bymonth.py +++ b/addons/hr_attendance/wizard/hr_attendance_bymonth.py @@ -50,4 +50,4 @@ class hr_attendance_bymonth(osv.osv_memory): hr_attendance_bymonth() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_attendance/wizard/hr_attendance_byweek.py b/addons/hr_attendance/wizard/hr_attendance_byweek.py index 139ff94cd5a..9ee69a937d1 100644 --- a/addons/hr_attendance/wizard/hr_attendance_byweek.py +++ b/addons/hr_attendance/wizard/hr_attendance_byweek.py @@ -48,4 +48,4 @@ class hr_attendance_byweek(osv.osv_memory): hr_attendance_byweek() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_attendance/wizard/hr_attendance_error.py b/addons/hr_attendance/wizard/hr_attendance_error.py index e2f9dc94b3f..d489e699d89 100644 --- a/addons/hr_attendance/wizard/hr_attendance_error.py +++ b/addons/hr_attendance/wizard/hr_attendance_error.py @@ -66,4 +66,4 @@ class hr_attendance_error(osv.osv_memory): hr_attendance_error() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py index d0da22c5681..b13e90cd627 100644 --- a/addons/hr_evaluation/hr_evaluation.py +++ b/addons/hr_evaluation/hr_evaluation.py @@ -43,6 +43,7 @@ class hr_evaluation_plan(osv.osv): 'month_next': 12, 'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'account.account', context=c), } + hr_evaluation_plan() class hr_evaluation_plan_phase(osv.osv): @@ -95,6 +96,7 @@ Thanks, '''), } + hr_evaluation_plan_phase() class hr_employee(osv.osv): @@ -210,8 +212,6 @@ class hr_evaluation(osv.osv): elif phase.action == "self": children = [evaluation.employee_id] for child in children: -# if not child.user_id: -# continue int_id = hr_eval_inter_obj.create(cr, uid, { 'evaluation_id': evaluation.id, @@ -250,7 +250,7 @@ class hr_evaluation(osv.osv): raise osv.except_osv(_('Warning!'),_("You cannot change state, because some appraisal(s) are in waiting answer or draft state.")) return True - def button_done(self,cr, uid, ids, context=None): + def button_done(self, cr, uid, ids, context=None): self.write(cr, uid, ids,{'state':'done', 'date_close': time.strftime('%Y-%m-%d')}, context=context) return True diff --git a/addons/hr_payroll/report/report_contribution_register.py b/addons/hr_payroll/report/report_contribution_register.py index e32e93532b5..c0285f3de50 100644 --- a/addons/hr_payroll/report/report_contribution_register.py +++ b/addons/hr_payroll/report/report_contribution_register.py @@ -72,4 +72,4 @@ class contribution_register_report(report_sxw.rml_parse): report_sxw.report_sxw('report.contribution.register.lines', 'hr.contribution.register', 'hr_payroll/report/report_contribution_register.rml', parser=contribution_register_report) -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_payroll/report/report_payslip.py b/addons/hr_payroll/report/report_payslip.py index e2ef7dab974..df4c729b298 100644 --- a/addons/hr_payroll/report/report_payslip.py +++ b/addons/hr_payroll/report/report_payslip.py @@ -46,4 +46,4 @@ class payslip_report(report_sxw.rml_parse): report_sxw.report_sxw('report.payslip', 'hr.payslip', 'hr_payroll/report/report_payslip.rml', parser=payslip_report) -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_payroll/report/report_payslip_details.py b/addons/hr_payroll/report/report_payslip_details.py index 1e9839eaa6f..5a110cbfdcd 100644 --- a/addons/hr_payroll/report/report_payslip_details.py +++ b/addons/hr_payroll/report/report_payslip_details.py @@ -116,4 +116,4 @@ class payslip_details_report(report_sxw.rml_parse): report_sxw.report_sxw('report.paylip.details', 'hr.payslip', 'hr_payroll/report/report_payslip_details.rml', parser=payslip_details_report) -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_payroll_account/__init__.py b/addons/hr_payroll_account/__init__.py index ffe4b707ac0..ceb8531473b 100644 --- a/addons/hr_payroll_account/__init__.py +++ b/addons/hr_payroll_account/__init__.py @@ -23,4 +23,4 @@ import hr_payroll_account import wizard -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_payroll_account/wizard/__init__.py b/addons/hr_payroll_account/wizard/__init__.py index 27128f05597..ee460faefb8 100644 --- a/addons/hr_payroll_account/wizard/__init__.py +++ b/addons/hr_payroll_account/wizard/__init__.py @@ -22,4 +22,4 @@ import hr_payroll_payslips_by_employees -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_payroll_account/wizard/hr_payroll_payslips_by_employees.py b/addons/hr_payroll_account/wizard/hr_payroll_payslips_by_employees.py index 7e3f4bbbe2b..af41b7b3b51 100644 --- a/addons/hr_payroll_account/wizard/hr_payroll_payslips_by_employees.py +++ b/addons/hr_payroll_account/wizard/hr_payroll_payslips_by_employees.py @@ -38,4 +38,4 @@ class hr_payslip_employees(osv.osv_memory): hr_payslip_employees() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index 298e3e64195..902b436ed29 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -243,7 +243,7 @@ class hr_applicant(base_stage, osv.Model): 'stage_id': _read_group_stage_ids } - def onchange_job(self,cr, uid, ids, job, context=None): + def onchange_job(self, cr, uid, ids, job, context=None): result = {} if job: @@ -494,7 +494,6 @@ class hr_applicant(base_stage, osv.Model): message = _("Applicant has been created.") return self.message_post(cr, uid, ids, body=message, context=context) - class hr_job(osv.osv): _inherit = "hr.job" _name = "hr.job" @@ -505,7 +504,6 @@ class hr_job(osv.osv): help="Email alias for this job position. New emails will automatically " "create new applicants for this job position."), } - _defaults = { 'alias_domain': False, # always hide alias during creation } @@ -548,12 +546,12 @@ class hr_job(osv.osv): datas['model'] = 'survey.print' context.update({'response_id': [0], 'response_no': 0,}) return { - 'type': 'ir.actions.report.xml', - 'report_name': 'survey.form', - 'datas': datas, - 'context' : context, - 'nodestroy':True, - } + 'type': 'ir.actions.report.xml', + 'report_name': 'survey.form', + 'datas': datas, + 'context' : context, + 'nodestroy':True, + } class applicant_category(osv.osv): """ Category of applicant """ diff --git a/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job.py b/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job.py index 418a42bef93..f1fa6446588 100644 --- a/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job.py +++ b/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job.py @@ -29,7 +29,7 @@ class hr_recruitment_partner_create(osv.osv_memory): 'close': fields.boolean('Close job request'), } - def view_init(self, cr , uid , fields_list, context=None): + def view_init(self, cr, uid, fields_list, context=None): case_obj = self.pool.get('hr.applicant') if context is None: context = {} diff --git a/addons/hr_recruitment/wizard/hr_recruitment_employee_hired.py b/addons/hr_recruitment/wizard/hr_recruitment_employee_hired.py index 291c16a7644..0b57082c019 100644 --- a/addons/hr_recruitment/wizard/hr_recruitment_employee_hired.py +++ b/addons/hr_recruitment/wizard/hr_recruitment_employee_hired.py @@ -26,7 +26,7 @@ class hired_employee(osv.osv_memory): _name = 'hired.employee' _description = 'Create Employee' - def case_close(self, cr, uid,ids, context=None): + def case_close(self, cr, uid, ids, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @@ -39,7 +39,7 @@ class hired_employee(osv.osv_memory): self.pool.get('hr.applicant').case_close(cr, uid,context.get('active_ids',[])) return {} - def case_close_with_emp(self, cr, uid,ids, context=None): + def case_close_with_emp(self, cr, uid, ids, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py index a1562d53a61..53a90aa26ed 100644 --- a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py +++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py @@ -84,7 +84,7 @@ class account_analytic_account(osv.osv): res['value']['to_invoice'] = ir_model_obj.get_object_reference(cr, uid, 'hr_timesheet_invoice', 'timesheet_invoice_factor1')[1] return res - def on_change_partner_id(self, cr, uid, ids,partner_id, name, context=None): + def on_change_partner_id(self, cr, uid, ids, partner_id, name, context=None): res = super(account_analytic_account,self).on_change_partner_id(cr, uid, ids,partner_id, name, context=context) part = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context) pricelist = part.property_product_pricelist and part.property_product_pricelist.id or False @@ -199,6 +199,7 @@ class hr_analytic_timesheet(osv.osv): hr_analytic_timesheet() + class account_invoice(osv.osv): _inherit = "account.invoice" @@ -218,6 +219,7 @@ class account_invoice(osv.osv): account_invoice() + class account_move_line(osv.osv): _inherit = "account.move.line" @@ -234,4 +236,3 @@ class account_move_line(osv.osv): account_move_line() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/hr_timesheet_invoice/report/account_analytic_profit.py b/addons/hr_timesheet_invoice/report/account_analytic_profit.py index 8b6cd7f9fbd..fc44089bf9e 100644 --- a/addons/hr_timesheet_invoice/report/account_analytic_profit.py +++ b/addons/hr_timesheet_invoice/report/account_analytic_profit.py @@ -120,4 +120,4 @@ class account_analytic_profit(report_sxw.rml_parse): report_sxw.report_sxw('report.account.analytic.profit', 'account.analytic.line', 'addons/hr_timesheet_invoice/report/account_analytic_profit.rml', parser=account_analytic_profit) -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py index 0014ac685b2..2e220a9397b 100644 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py @@ -38,7 +38,7 @@ class account_analytic_line(osv.osv): # 'price': boolean # 'product': many2one id # } - def invoice_cost_create(self, cr, uid, ids, data={}, context=None): + def invoice_cost_create(self, cr, uid, ids, data=None, context=None): analytic_account_obj = self.pool.get('account.analytic.account') res_partner_obj = self.pool.get('res.partner') account_payment_term_obj = self.pool.get('account.payment.term') @@ -52,6 +52,8 @@ class account_analytic_line(osv.osv): invoices = [] if context is None: context = {} + if data is None: + data = {} account_ids = {} for line in self.pool.get('account.analytic.line').browse(cr, uid, ids, context=context): @@ -86,14 +88,14 @@ class account_analytic_line(osv.osv): 'date_due': date_due, 'fiscal_position': account.partner_id.property_account_position.id } - + context2 = context.copy() context2['lang'] = partner.lang - # set company_id in context, so the correct default journal will be selected + # set company_id in context, so the correct default journal will be selected context2['force_company'] = curr_invoice['company_id'] - # set force_company in context so the correct product properties are selected (eg. income account) + # set force_company in context so the correct product properties are selected (eg. income account) context2['company_id'] = curr_invoice['company_id'] - + last_invoice = invoice_obj.create(cr, uid, curr_invoice, context=context2) invoices.append(last_invoice) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 13c11cf72c7..cd58f52f959 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -358,7 +358,7 @@ class hr_timesheet_sheet(osv.osv): 'department_id':fields.many2one('hr.department','Department'), } - def _default_date_from(self,cr, uid, context=None): + def _default_date_from(self, cr, uid, context=None): user = self.pool.get('res.users').browse(cr, uid, uid, context=context) r = user.company_id and user.company_id.timesheet_range or 'month' if r=='month': @@ -369,7 +369,7 @@ class hr_timesheet_sheet(osv.osv): return time.strftime('%Y-01-01') return time.strftime('%Y-%m-%d') - def _default_date_to(self,cr, uid, context=None): + def _default_date_to(self, cr, uid, context=None): user = self.pool.get('res.users').browse(cr, uid, uid, context=context) r = user.company_id and user.company_id.timesheet_range or 'month' if r=='month': diff --git a/addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py b/addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py index fdab774a250..a6974fc2ccf 100644 --- a/addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py +++ b/addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py @@ -61,4 +61,4 @@ class hr_timesheet_current_open(osv.osv_memory): hr_timesheet_current_open() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/idea/idea.py b/addons/idea/idea.py index e2e5ec50ddf..9b4a9c580a9 100644 --- a/addons/idea/idea.py +++ b/addons/idea/idea.py @@ -39,6 +39,7 @@ class idea_category(osv.osv): ('name', 'unique(name)', 'The name of the category must be unique' ) ] _order = 'name asc' + idea_category() class idea_idea(osv.osv): @@ -65,24 +66,24 @@ class idea_idea(osv.osv): } _order = 'name asc' - def idea_cancel(self, cr, uid, ids, context={}): + def idea_cancel(self, cr, uid, ids, context=None): self.write(cr, uid, ids, { 'state': 'cancel' }) self.message_post(cr, uid, ids, body=_('Idea canceled.'), context=context) return True - def idea_open(self, cr, uid, ids, context={}): + def idea_open(self, cr, uid, ids, context=None): self.write(cr, uid, ids, { 'state': 'open'}) self.message_post(cr, uid, ids, body=_('Idea accepted.'), context=context) return True - def idea_close(self, cr, uid, ids, context={}): + def idea_close(self, cr, uid, ids, context=None): self.message_post(cr, uid, ids, body=_('Idea done.'), context=context) self.write(cr, uid, ids, { 'state': 'close' }) return True - def idea_draft(self, cr, uid, ids, context={}): + def idea_draft(self, cr, uid, ids, context=None): self.message_post(cr, uid, ids, body=_('Idea reset to draft.'), context=context) self.write(cr, uid, ids, { 'state': 'draft' }) return True -idea_idea() +idea_idea() diff --git a/addons/import_base/import_framework.py b/addons/import_base/import_framework.py index 559f42c8974..95683129f35 100644 --- a/addons/import_base/import_framework.py +++ b/addons/import_base/import_framework.py @@ -227,7 +227,7 @@ class import_framework(Thread): return map - def _fields_mapp(self,dict_sugar, openerp_dict, table): + def _fields_mapp(self, dict_sugar, openerp_dict, table): """ call all the mapper and transform data to be compatible with import_data diff --git a/addons/import_sugarcrm/import_sugarcrm.py b/addons/import_sugarcrm/import_sugarcrm.py index 5ffa44cb9c5..0099fc8b9a7 100644 --- a/addons/import_sugarcrm/import_sugarcrm.py +++ b/addons/import_sugarcrm/import_sugarcrm.py @@ -253,7 +253,7 @@ class sugar_import(import_framework): val['datas_fname'] = Filename return val - def get_history_mapping(self): + def get_history_mapping(self): return { 'model' : 'ir.attachment', 'dependencies' : [self.TABLE_USER, self.TABLE_ACCOUNT, self.TABLE_CONTACT, self.TABLE_LEAD, self.TABLE_OPPORTUNITY, self.TABLE_MEETING, self.TABLE_CALL, self.TABLE_EMAIL], @@ -301,7 +301,7 @@ class sugar_import(import_framework): val['email_from'] = partner_email return val - def get_crm_claim_mapping(self): + def get_crm_claim_mapping(self): return { 'model' : 'crm.claim', 'dependencies' : [self.TABLE_USER, self.TABLE_ACCOUNT, self.TABLE_CONTACT, self.TABLE_LEAD], @@ -602,7 +602,7 @@ class sugar_import(import_framework): partner_contact_email = address.email return partner_contact_id, partner_contact_email - def import_opp(self, val): + def import_opp(self, val): partner_contact_id, partner_contact_email = self.import_opportunity_contact(val) val['partner_address_id/id'] = partner_contact_id val['email_from'] = partner_contact_email diff --git a/addons/l10n_be/__init__.py b/addons/l10n_be/__init__.py index 7bdc1f61b1f..e994d524775 100644 --- a/addons/l10n_be/__init__.py +++ b/addons/l10n_be/__init__.py @@ -21,4 +21,4 @@ import wizard -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_be_coda/l10n_be_coda.py b/addons/l10n_be_coda/l10n_be_coda.py index 1aa6e84402a..1dab4ab1964 100644 --- a/addons/l10n_be_coda/l10n_be_coda.py +++ b/addons/l10n_be_coda/l10n_be_coda.py @@ -171,6 +171,7 @@ class account_coda_trans_type(osv.osv): 'parent_id': fields.many2one('account.coda.trans.type', 'Parent'), 'description': fields.text('Description', translate=True), } + account_coda_trans_type() class account_coda_trans_code(osv.osv): @@ -187,6 +188,7 @@ class account_coda_trans_code(osv.osv): 'description': fields.char('Description', size=128, translate=True, select=2), 'comment': fields.text('Comment', translate=True), } + account_coda_trans_code() class account_coda_trans_category(osv.osv): @@ -197,6 +199,7 @@ class account_coda_trans_category(osv.osv): 'category': fields.char('Transaction Category', size=3, required=True), 'description': fields.char('Description', size=256, translate=True), } + account_coda_trans_category() class account_coda_comm_type(osv.osv): @@ -209,14 +212,17 @@ class account_coda_comm_type(osv.osv): } _sql_constraints = [ ('code_uniq', 'unique (code)','The Structured Communication Code must be unique !') - ] + ] + account_coda_comm_type() class coda_bank_statement(osv.osv): _name = 'coda.bank.statement' _description = 'CODA Bank Statement' - def _default_journal_id(self, cr, uid, context={}): + def _default_journal_id(self, cr, uid, context=None): + if context is None: + context = {} if context.get('journal_id', False): return context['journal_id'] return False @@ -232,7 +238,7 @@ class coda_bank_statement(osv.osv): res[r] = round(res[r], 2) return res - def _get_period(self, cr, uid, context={}): + def _get_period(self, cr, uid, context=None): periods = self.pool.get('account.period').find(cr, uid) if periods: return periods[0] @@ -404,6 +410,7 @@ class account_bank_statement_line_global(osv.osv): _columns = { 'coda_statement_line_ids': fields.one2many('coda.bank.statement.line', 'globalisation_id', 'CODA Bank Statement Lines', readonly=True), } + account_bank_statement_line_global() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_be_invoice_bba/invoice.py b/addons/l10n_be_invoice_bba/invoice.py index bb03e4d6d02..188a8d896fd 100644 --- a/addons/l10n_be_invoice_bba/invoice.py +++ b/addons/l10n_be_invoice_bba/invoice.py @@ -2,9 +2,9 @@ ############################################################################## # # OpenERP, Open Source Management Solution -# +# # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. -# +# # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the @@ -36,23 +36,23 @@ class account_invoice(osv.osv): _inherit = 'account.invoice' def _get_reference_type(self, cursor, user, context=None): - """Add BBA Structured Communication Type and change labels from 'reference' into 'communication' """ + """Add BBA Structured Communication Type and change labels from 'reference' into 'communication' """ res = super(account_invoice, self)._get_reference_type(cursor, user, context=context) res[[i for i,x in enumerate(res) if x[0] == 'none'][0]] = ('none', 'Free Communication') res.append(('bba', 'BBA Structured Communication')) - #l_logger.warning('reference_type = %s' %res ) + #l_logger.warning('reference_type = %s' %res ) return res - def check_bbacomm(self, val): + def check_bbacomm(self, val): supported_chars = '0-9+*/ ' pattern = re.compile('[^' + supported_chars + ']') if pattern.findall(val or ''): - return False + return False bbacomm = re.sub('\D', '', val or '') if len(bbacomm) == 12: base = int(bbacomm[:10]) - mod = base % 97 or 97 + mod = base % 97 or 97 if mod == int(bbacomm[-2:]): return True return False @@ -64,29 +64,29 @@ class account_invoice(osv.osv): return True def onchange_partner_id(self, cr, uid, ids, type, partner_id, - date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False): + date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False): result = super(account_invoice, self).onchange_partner_id(cr, uid, ids, type, partner_id, date_invoice, payment_term, partner_bank_id, company_id) # reference_type = self.default_get(cr, uid, ['reference_type'])['reference_type'] # _logger.warning('partner_id %s' % partner_id) reference = False reference_type = 'none' - if partner_id: + if partner_id: if (type == 'out_invoice'): reference_type = self.pool.get('res.partner').browse(cr, uid, partner_id).out_inv_comm_type if reference_type: reference = self.generate_bbacomm(cr, uid, ids, type, reference_type, partner_id, '', context={})['value']['reference'] - res_update = { + res_update = { 'reference_type': reference_type or 'none', 'reference': reference, } result['value'].update(res_update) - return result + return result def generate_bbacomm(self, cr, uid, ids, type, reference_type, partner_id, reference, context=None): partner_obj = self.pool.get('res.partner') - reference = reference or '' - algorithm = False + reference = reference or '' + algorithm = False if partner_id: algorithm = partner_obj.browse(cr, uid, partner_id, context=context).out_inv_comm_algorithm algorithm = algorithm or 'random' @@ -97,7 +97,7 @@ class account_invoice(osv.osv): doy = time.strftime('%j') year = time.strftime('%Y') seq = '001' - seq_ids = self.search(cr, uid, + seq_ids = self.search(cr, uid, [('type', '=', 'out_invoice'), ('reference_type', '=', 'bba'), ('reference', 'like', '+++%s/%s/%%' % (doy, year))], order='reference') if seq_ids: @@ -110,7 +110,7 @@ class account_invoice(osv.osv): '\nPlease create manually a unique BBA Structured Communication.')) bbacomm = doy + year + seq base = int(bbacomm) - mod = base % 97 or 97 + mod = base % 97 or 97 reference = '+++%s/%s/%s%02d+++' % (doy, year, seq, mod) elif algorithm == 'partner_ref': if not self.check_bbacomm(reference): @@ -119,13 +119,13 @@ class account_invoice(osv.osv): if (len(partner_ref_nr) < 3) or (len(partner_ref_nr) > 7): raise osv.except_osv(_('Warning!'), _('The Partner should have a 3-7 digit Reference Number for the generation of BBA Structured Communications!' \ - '\nPlease correct the Partner record.')) + '\nPlease correct the Partner record.')) else: partner_ref_nr = partner_ref_nr.ljust(7, '0') seq = '001' - seq_ids = self.search(cr, uid, + seq_ids = self.search(cr, uid, [('type', '=', 'out_invoice'), ('reference_type', '=', 'bba'), - ('reference', 'like', '+++%s/%s/%%' % (partner_ref_nr[:3], partner_ref_nr[3:]))], order='reference') + ('reference', 'like', '+++%s/%s/%%' % (partner_ref_nr[:3], partner_ref_nr[3:]))], order='reference') if seq_ids: prev_seq = int(self.browse(cr, uid, seq_ids[-1]).reference[12:15]) if prev_seq < 999: @@ -133,10 +133,10 @@ class account_invoice(osv.osv): else: raise osv.except_osv(_('Warning!'), _('The daily maximum of outgoing invoices with an automatically generated BBA Structured Communications has been exceeded!' \ - '\nPlease create manually a unique BBA Structured Communication.')) + '\nPlease create manually a unique BBA Structured Communication.')) bbacomm = partner_ref_nr + seq base = int(bbacomm) - mod = base % 97 or 97 + mod = base % 97 or 97 reference = '+++%s/%s/%s%02d+++' % (partner_ref_nr[:3], partner_ref_nr[3:], seq, mod) elif algorithm == 'random': if not self.check_bbacomm(reference): @@ -144,67 +144,66 @@ class account_invoice(osv.osv): bbacomm = str(base).rjust(7, '0') base = int(bbacomm) mod = base % 97 or 97 - mod = str(mod).rjust(2, '0') + mod = str(mod).rjust(2, '0') reference = '+++%s/%s/%s%s+++' % (bbacomm[:3], bbacomm[3:7], bbacomm[7:], mod) else: raise osv.except_osv(_('Error!'), _("Unsupported Structured Communication Type Algorithm '%s' !" \ - "\nPlease contact your OpenERP support channel.") % algorithm) - return {'value': {'reference': reference}} - + "\nPlease contact your OpenERP support channel.") % algorithm) + return {'value': {'reference': reference}} + def create(self, cr, uid, vals, context=None): if vals.has_key('reference_type'): reference_type = vals['reference_type'] - if reference_type == 'bba': + if reference_type == 'bba': if vals.has_key('reference'): bbacomm = vals['reference'] else: raise osv.except_osv(_('Warning!'), _('Empty BBA Structured Communication!' \ - '\nPlease fill in a unique BBA Structured Communication.')) + '\nPlease fill in a unique BBA Structured Communication.')) if self.check_bbacomm(bbacomm): reference = re.sub('\D', '', bbacomm) - vals['reference'] = '+++' + reference[0:3] + '/' + reference[3:7] + '/' + reference[7:] + '+++' - same_ids = self.search(cr, uid, + vals['reference'] = '+++' + reference[0:3] + '/' + reference[3:7] + '/' + reference[7:] + '+++' + same_ids = self.search(cr, uid, [('type', '=', 'out_invoice'), ('reference_type', '=', 'bba'), ('reference', '=', vals['reference'])]) if same_ids: raise osv.except_osv(_('Warning!'), _('The BBA Structured Communication has already been used!' \ - '\nPlease create manually a unique BBA Structured Communication.')) - return super(account_invoice, self).create(cr, uid, vals, context=context) + '\nPlease create manually a unique BBA Structured Communication.')) + return super(account_invoice, self).create(cr, uid, vals, context=context) - def write(self, cr, uid, ids, vals, context={}): + def write(self, cr, uid, ids, vals, context=None): if isinstance(ids, (int, long)): ids = [ids] - for inv in self.browse(cr, uid, ids, context): + for inv in self.browse(cr, uid, ids, context): if vals.has_key('reference_type'): reference_type = vals['reference_type'] - else: + else: reference_type = inv.reference_type or '' - if reference_type == 'bba': + if reference_type == 'bba': if vals.has_key('reference'): bbacomm = vals['reference'] else: bbacomm = inv.reference or '' if self.check_bbacomm(bbacomm): reference = re.sub('\D', '', bbacomm) - vals['reference'] = '+++' + reference[0:3] + '/' + reference[3:7] + '/' + reference[7:] + '+++' - same_ids = self.search(cr, uid, - [('id', '!=', inv.id), ('type', '=', 'out_invoice'), + vals['reference'] = '+++' + reference[0:3] + '/' + reference[3:7] + '/' + reference[7:] + '+++' + same_ids = self.search(cr, uid, + [('id', '!=', inv.id), ('type', '=', 'out_invoice'), ('reference_type', '=', 'bba'), ('reference', '=', vals['reference'])]) if same_ids: raise osv.except_osv(_('Warning!'), _('The BBA Structured Communication has already been used!' \ - '\nPlease create manually a unique BBA Structured Communication.')) - return super(account_invoice, self).write(cr, uid, ids, vals, context) + '\nPlease create manually a unique BBA Structured Communication.')) + return super(account_invoice, self).write(cr, uid, ids, vals, context) _columns = { 'reference': fields.char('Communication', size=64, help="The partner reference of this invoice."), 'reference_type': fields.selection(_get_reference_type, 'Communication Type', required=True), } - _constraints = [ (_check_communication, 'Invalid BBA Structured Communication !', ['Communication']), ] diff --git a/addons/l10n_br/l10n_br.py b/addons/l10n_br/l10n_br.py index af387334cd1..f35ced7ea09 100644 --- a/addons/l10n_br/l10n_br.py +++ b/addons/l10n_br/l10n_br.py @@ -81,4 +81,4 @@ class l10n_br_account_cst(osv.osv): l10n_br_account_cst() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch/partner.py b/addons/l10n_ch/partner.py index 9301c564227..aba9ea7b204 100644 --- a/addons/l10n_ch/partner.py +++ b/addons/l10n_ch/partner.py @@ -30,4 +30,4 @@ class res_partner(osv.osv): } res_partner() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch/payment.py b/addons/l10n_ch/payment.py index aba757502b0..a681daf569d 100644 --- a/addons/l10n_ch/payment.py +++ b/addons/l10n_ch/payment.py @@ -24,7 +24,7 @@ from osv import osv class payment_order(osv.osv): _inherit = 'payment.order' - def get_wizard(self,mode): + def get_wizard(self, mode): if mode == 'dta': return 'l10n_ch', 'action_dta_create' diff --git a/addons/l10n_ch/report/report_webkit_html.py b/addons/l10n_ch/report/report_webkit_html.py index 1699871dc26..6b6a84e0cf4 100644 --- a/addons/l10n_ch/report/report_webkit_html.py +++ b/addons/l10n_ch/report/report_webkit_html.py @@ -76,7 +76,7 @@ class l10n_ch_report_webkit_html(report_sxw.rml_parse): self._check(ids) return super(l10n_ch_report_webkit_html, self).set_context(objects, data, ids, report_type=report_type) - def police_absolute_path(self, inner_path) : + def police_absolute_path(self, inner_path): """Will get the ocrb police absolute path""" path = addons.get_module_resource(os.path.join('l10n_ch', 'report', inner_path)) return path diff --git a/addons/l10n_ch/wizard/create_dta.py b/addons/l10n_ch/wizard/create_dta.py index 695fe763aa9..f2d8f14b772 100644 --- a/addons/l10n_ch/wizard/create_dta.py +++ b/addons/l10n_ch/wizard/create_dta.py @@ -41,7 +41,7 @@ TRANS=[ (u'ä','a'), ] -def _u2a(text) : +def _u2a(text): """Tries to convert unicode charactere to asci equivalence""" if not text : return "" txt = "" diff --git a/addons/l10n_fr/l10n_fr.py b/addons/l10n_fr/l10n_fr.py index 5efb4244306..e1240ddd83a 100644 --- a/addons/l10n_fr/l10n_fr.py +++ b/addons/l10n_fr/l10n_fr.py @@ -29,7 +29,6 @@ class l10n_fr_report(osv.osv): 'name': fields.char('Name', size=128), 'line_ids': fields.one2many('l10n.fr.line', 'report_id', 'Lines'), } - _sql_constraints = [ ('code_uniq', 'unique (code)','The code report must be unique !') ] @@ -61,7 +60,4 @@ class res_company(osv.osv): res_company() - - - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_fr/report/base_report.py b/addons/l10n_fr/report/base_report.py index 2c44b062f45..c93d5308901 100644 --- a/addons/l10n_fr/report/base_report.py +++ b/addons/l10n_fr/report/base_report.py @@ -117,4 +117,4 @@ class base_report(report_sxw.rml_parse): break self._set_variable(code, sum) -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_lu/wizard/pdf_ext.py b/addons/l10n_lu/wizard/pdf_ext.py index 3b58fab5b68..e90cf0527d2 100644 --- a/addons/l10n_lu/wizard/pdf_ext.py +++ b/addons/l10n_lu/wizard/pdf_ext.py @@ -57,7 +57,7 @@ trailer %%EOF """ -def output_field( f ): +def output_field(f): return "\xfe\xff" + "".join( [ "\x00"+c for c in f ] ) def extract_keys(lines): diff --git a/addons/lunch/report/order.py b/addons/lunch/report/order.py index 11ca7f79dbc..b1745f7d5f5 100644 --- a/addons/lunch/report/order.py +++ b/addons/lunch/report/order.py @@ -26,14 +26,14 @@ from osv import osv class order(report_sxw.rml_parse): - def get_lines(self, user,objects): + def get_lines(self, user, objects): lines=[] for obj in objects: if user.id==obj.user_id.id: lines.append(obj) return lines - def get_total(self, user,objects): + def get_total(self, user, objects): lines=[] for obj in objects: if user.id==obj.user_id.id: diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index c671dd55ec4..061647c388a 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -590,7 +590,7 @@ class mail_thread(osv.AbstractModel): context = context or {} attachments = attachments or [] assert (not thread_id) or isinstance(thread_id, (int,long)) or \ - (isinstance(thread_id, (list, tuple)) and len(thread_id) == 1), "Invalid thread_id" + (isinstance(thread_id, (list, tuple)) and len(thread_id) == 1), "Invalid thread_id" if isinstance(thread_id, (list, tuple)): thread_id = thread_id and thread_id[0] @@ -618,7 +618,7 @@ class mail_thread(osv.AbstractModel): 'parent_id': parent_id, 'attachment_ids': attachment_ids, }) - for x in ('from', 'to', 'cc'): values.pop(x, None) # Avoid warnings + for x in ('from', 'to', 'cc'): values.pop(x, None) # Avoid warnings return self.pool.get('mail.message').create(cr, uid, values, context=context) #------------------------------------------------------ diff --git a/addons/mail/static/scripts/openerp_mailgate.py b/addons/mail/static/scripts/openerp_mailgate.py old mode 100755 new mode 100644 diff --git a/addons/membership/report/__init__.py b/addons/membership/report/__init__.py index 05c893ae400..84dc92c63f0 100644 --- a/addons/membership/report/__init__.py +++ b/addons/membership/report/__init__.py @@ -20,4 +20,4 @@ ############################################################################## import report_membership -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/membership/report/report_membership.py b/addons/membership/report/report_membership.py index 9090c752686..273ec0db74f 100644 --- a/addons/membership/report/report_membership.py +++ b/addons/membership/report/report_membership.py @@ -141,4 +141,4 @@ class report_membership(osv.osv): report_membership() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/membership/wizard/__init__.py b/addons/membership/wizard/__init__.py index 7ad7cc32008..a15a0a7329f 100644 --- a/addons/membership/wizard/__init__.py +++ b/addons/membership/wizard/__init__.py @@ -20,4 +20,4 @@ ############################################################################## import membership_invoice -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 00a5790b67e..cf203a60c7f 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -274,13 +274,15 @@ class mrp_bom(osv.osv): return {'value': {'name': prod.name, 'product_uom': prod.uom_id.id}} return {} - def _bom_find(self, cr, uid, product_id, product_uom, properties=[]): + def _bom_find(self, cr, uid, product_id, product_uom, properties=None): """ Finds BoM for particular product and product uom. @param product_id: Selected product. @param product_uom: Unit of measure of a product. @param properties: List of related properties. @return: False or BoM id. """ + if properties is None: + properties = [] cr.execute('select id from mrp_bom where product_id=%s and bom_id is null order by sequence', (product_id,)) ids = map(lambda x: x[0], cr.fetchall()) max_prop = 0 @@ -295,7 +297,7 @@ class mrp_bom(osv.osv): max_prop = prop return result - def _bom_explode(self, cr, uid, bom, factor, properties=[], addthis=False, level=0, routing_id=False): + def _bom_explode(self, cr, uid, bom, factor, properties=None, addthis=False, level=0, routing_id=False): """ Finds Products and Work Centers for related BoM for manufacturing order. @param bom: BoM of particular product. @param factor: Factor of product UoM. @@ -609,11 +611,13 @@ class mrp_production(osv.osv): self.write(cr, uid, ids, {'state': 'picking_except'}) return True - def action_compute(self, cr, uid, ids, properties=[], context=None): + def action_compute(self, cr, uid, ids, properties=None, context=None): """ Computes bills of material of a product. @param properties: List containing dictionaries of properties. @return: No. of products. """ + if properties is None: + properties = [] results = [] bom_obj = self.pool.get('mrp.bom') uom_obj = self.pool.get('product.uom') @@ -832,7 +836,7 @@ class mrp_production(osv.osv): 'product_id': wc.product_id.id, 'unit_amount': wc_line.hour, 'product_uom_id': wc.product_id.id and wc.product_id.uom_id.id or False - + } ) if wc.costs_journal_id and wc.costs_general_account_id: value = wc_line.cycle * wc.costs_cycle @@ -849,7 +853,7 @@ class mrp_production(osv.osv): 'product_id': wc.product_id.id, 'unit_amount': wc_line.cycle, 'product_uom_id': wc.product_id.id and wc.product_id.uom_id.id or False - + } ) return amount diff --git a/addons/mrp/procurement.py b/addons/mrp/procurement.py index 7f417dc18b1..795ac5453fb 100644 --- a/addons/mrp/procurement.py +++ b/addons/mrp/procurement.py @@ -33,7 +33,7 @@ class procurement_order(osv.osv): 'property_ids': fields.many2many('mrp.property', 'procurement_property_rel', 'procurement_id','property_id', 'Properties'), } - def check_produce_product(self, cr, uid, procurement, context=[]): + def check_produce_product(self, cr, uid, procurement, context=None): """ Finds the bill of material for the product from procurement order. @return: True or False """ diff --git a/addons/mrp/report/bom_structure.py b/addons/mrp/report/bom_structure.py index a5b43c19f01..458a0c19649 100644 --- a/addons/mrp/report/bom_structure.py +++ b/addons/mrp/report/bom_structure.py @@ -35,7 +35,7 @@ class bom_structure(report_sxw.rml_parse): def get_children(self, object, level=0): result = [] - def _get_rec(object,level): + def _get_rec(object, level): for l in object: res = {} res['name'] = l.name @@ -61,4 +61,4 @@ class bom_structure(report_sxw.rml_parse): report_sxw.report_sxw('report.bom.structure','mrp.bom','mrp/report/bom_structure.rml',parser=bom_structure,header='internal') -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mrp/stock.py b/addons/mrp/stock.py index d5ddc7f0280..fdfe09f35b4 100644 --- a/addons/mrp/stock.py +++ b/addons/mrp/stock.py @@ -102,7 +102,7 @@ class StockMove(osv.osv): wf_service.trg_validate(uid, 'procurement.order', m, 'button_wait_done', cr) return processed_ids - def action_consume(self, cr, uid, ids, product_qty, location_id=False, context=None): + def action_consume(self, cr, uid, ids, product_qty, location_id=False, context=None): """ Consumed product with specific quatity from specific source location. @param product_qty: Consumed product quantity @param location_id: Source location diff --git a/addons/mrp_operations/mrp_operations.py b/addons/mrp_operations/mrp_operations.py index ee2547bc7df..9f6671c3b2b 100644 --- a/addons/mrp_operations/mrp_operations.py +++ b/addons/mrp_operations/mrp_operations.py @@ -422,7 +422,7 @@ class mrp_production(osv.osv): pass return result - def action_compute(self, cr, uid, ids, properties=[], context=None): + def action_compute(self, cr, uid, ids, properties=None, context=None): """ Computes bills of material of a product and planned date of work order. @param properties: List containing dictionaries of properties. @return: No. of products. diff --git a/addons/plugin/plugin_handler.py b/addons/plugin/plugin_handler.py index 42754951317..95fe80f3b29 100644 --- a/addons/plugin/plugin_handler.py +++ b/addons/plugin/plugin_handler.py @@ -6,7 +6,6 @@ Created on 18 oct. 2011 from osv import osv, fields - class plugin_handler(osv.osv_memory): _name = 'plugin.handler' @@ -37,7 +36,7 @@ class plugin_handler(osv.osv_memory): @param email: email is a standard RFC2822 email message @return Dictionary which contain id and the model name of the document linked with the mail if no document is found the id = 0 - (model_name, res_id, url, name_get) + (model_name, res_id, url, name_get) """ mail_message_obj = self.pool.get('mail.message') model = "" @@ -52,7 +51,7 @@ class plugin_handler(osv.osv_memory): msg_ids = mail_message_obj.search(cr, uid, [('message_id','=', message_id)]) msg_id = len(msg_ids) and msg_ids[0] or False if not msg_id and parent_id: - msg_id = parent_id + msg_id = parent_id if msg_id: msg = mail_message_obj.browse(cr, uid, msg_id) res_id = msg.res_id @@ -61,7 +60,6 @@ class plugin_handler(osv.osv_memory): name = self.pool.get(model).name_get(cr, uid, [res_id])[0][1] return (model,res_id, url,name) - def document_type(self, cr, uid, context=None): """ Return the list of available model to push @@ -74,13 +72,13 @@ class plugin_handler(osv.osv_memory): doc_dict['res.partner'] = "Partner" return doc_dict.items() - # Can be used where search record was used + # Can be used where search record was used def list_document_get(self, cr, uid, model, name): """ This function return the result of name_search on the object model - @param model: the name of the model + @param model: the name of the model @param : the name of the document - @return : the result of name_search a list of tuple + @return : the result of name_search a list of tuple [(id, 'name')] """ return self.pool.get(model).name_search(cr, uid, name) @@ -89,7 +87,7 @@ class plugin_handler(osv.osv_memory): """ @param email: email is a standard RFC2822 email message @param model: On which model the message is pushed - @param thread_id: on which document the message is pushed, if thread_id = 0 a new document is created + @param thread_id: on which document the message is pushed, if thread_id = 0 a new document is created @return Dictionary which contain model , url and resource id. """ mail_message = self.pool.get('mail.message') @@ -97,7 +95,7 @@ class plugin_handler(osv.osv_memory): msg = self.pool.get('mail.thread').message_parse(cr, uid, email) message_id = msg.get('message-id') mail_ids = mail_message.search(cr, uid, [('message_id','=',message_id),('res_id','=',res_id),('model','=',model)]) - + if message_id and mail_ids : mail_record = mail_message.browse(cr, uid, mail_ids)[0] res_id = mail_record.res_id @@ -109,11 +107,11 @@ class plugin_handler(osv.osv_memory): res_id = model_obj.message_process(cr, uid, model, email) notify = "Mail successfully pushed, a new %s has been created " % model else: - model_obj.message_post(cr, uid, [res_id], - body= msg.get('body'), - subject= msg.get('subject'), - type= 'email', - parent_id= msg.get('parent_id'), + model_obj.message_post(cr, uid, [res_id], + body= msg.get('body'), + subject= msg.get('subject'), + type= 'email', + parent_id= msg.get('parent_id'), attachments= msg.get('attachments')) notify = "Mail successfully pushed" url = self._make_url(cr, uid, res_id, model) @@ -123,7 +121,7 @@ class plugin_handler(osv.osv_memory): """ @param data : the data use to create the res.partner [('field_name', value)], field name is required - @param partner_id : On which partner the address is attached + @param partner_id : On which partner the address is attached if partner_id = 0 then create a new partner with the same name that the address @return : the partner_id sended or created, this allow the plugin to open the right partner page """ @@ -138,7 +136,7 @@ class plugin_handler(osv.osv_memory): return ('res.partner', partner_id, url) # Specific to outlook rfc822 is not available so we split in arguments headerd,body,attachemnts - def push_message_outlook(self, cr, uid, model, headers,res_id=0 ,body=False, body_html=False, attachments=False): + def push_message_outlook(self, cr, uid, model, headers, res_id=0, body=False, body_html=False, attachments=False): # ---------------------------------------- # solution 1 # construct a fake rfc822 from the separated arguement @@ -149,14 +147,14 @@ class plugin_handler(osv.osv_memory): # solution 2 # use self.pushmessage only with header and body # add attachemnt yourself after - mail_message = self.pool.get('mail.message') + mail_message = self.pool.get('mail.message') ir_attachment_obj = self.pool.get('ir.attachment') attach_ids = [] msg = self.pool.get('mail.thread').message_parse(cr, uid, headers) - message_id = msg.get('message-id') + message_id = msg.get('message-id') push_mail = self.push_message(cr, uid, model, headers, res_id) res_id = push_mail[1] - model = push_mail[0] + model = push_mail[0] for name in attachments.keys(): attachment_ids = ir_attachment_obj.search(cr, uid, [('res_model', '=', model), ('res_id', '=', res_id), ('datas_fname', '=', name)]) if attachment_ids: diff --git a/addons/point_of_sale/report/account_statement.py b/addons/point_of_sale/report/account_statement.py index be5d4b3a330..c1fc73a35d7 100644 --- a/addons/point_of_sale/report/account_statement.py +++ b/addons/point_of_sale/report/account_statement.py @@ -48,4 +48,4 @@ class account_statement(report_sxw.rml_parse): report_sxw.report_sxw('report.account.statement', 'account.bank.statement', 'addons/statement/report/account_statement.rml', parser=account_statement,header='internal') -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py b/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py index 4f342099a59..0e75e7f7ae1 100644 --- a/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py +++ b/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py @@ -38,13 +38,13 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse): 'get_net_total_starting':self._get_net_total_starting, }) - def _get_user(self,line_ids): + def _get_user(self, line_ids): sql = "select name from res_users where id = %d"%(line_ids['create_uid']) self.cr.execute(sql) user = self.cr.fetchone() return user[0] - def _get_data(self,user): + def _get_data(self, user): data = {} sql = """ SELECT abs.journal_id,abs.id,abs.date,abs.closing_date,abs.name as statement,aj.name as journal,ap.name as period,ru.name as user,rc.name as company, abs.state,abs.balance_end_real FROM account_bank_statement as abs @@ -57,7 +57,7 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse): data = self.cr.dictfetchall() return data - def _get_lines(self,statement): + def _get_lines(self, statement): data = {} sql = """ select absl.* from account_bank_statement_line as absl, account_bank_statement as abs where absl.statement_id = abs.id and abs.id = %d"""%(statement['id']) @@ -65,7 +65,7 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse): data = self.cr.dictfetchall() return data - def _get_bal(self,data): + def _get_bal(self, data): res = {} sql =""" select sum(pieces*number) as bal from account_cashbox_line where starting_id = %d """%(data['id']) self.cr.execute(sql) @@ -75,7 +75,7 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse): else: return False - def _get_sub_total(self,user,data,date): + def _get_sub_total(self, user, data, date): res={} self.cr.execute(""" select sum(absl.amount) from account_bank_statement as abs LEFT JOIN account_bank_statement_line as absl ON abs.id = absl.statement_id @@ -90,7 +90,7 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse): else: return False - def _get_partner(self,statement): + def _get_partner(self, statement): res = {} if statement['pos_statement_id']: sql =""" select rp.name from account_bank_statement_line as absl,res_partner as rp @@ -102,7 +102,7 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse): else: return 0.00 - def _get_net_total_starting(self,user): + def _get_net_total_starting(self, user): lst = [] res={} total_ending_bal = 0.0 @@ -124,7 +124,7 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse): lst.append(total_starting_bal) return lst - def _get_net_total(self,user): + def _get_net_total(self, user): res={} sql = """select sum(absl.amount) as net_total from account_bank_statement as abs LEFT JOIN account_bank_statement_line as absl ON abs.id = absl.statement_id @@ -137,4 +137,4 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse): report_sxw.report_sxw('report.all.closed.cashbox.of.the.day', 'account.bank.statement', 'addons/point_of_sale/report/all_closed_cashbox_of_the_day.rml', parser=all_closed_cashbox_of_the_day,header='internal') -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/point_of_sale/report/pos_details.py b/addons/point_of_sale/report/pos_details.py index d13c127165e..f8565a8776a 100644 --- a/addons/point_of_sale/report/pos_details.py +++ b/addons/point_of_sale/report/pos_details.py @@ -24,7 +24,7 @@ from report import report_sxw class pos_details(report_sxw.rml_parse): - def _get_invoice(self,inv_id): + def _get_invoice(self, inv_id): res={} if inv_id: self.cr.execute("select number from account_invoice as ac where id = %s", (inv_id,)) @@ -37,7 +37,7 @@ class pos_details(report_sxw.rml_parse): user_obj = self.pool.get('res.users') return user_obj.search(self.cr, self.uid, []) - def _pos_sales_details(self,form): + def _pos_sales_details(self, form): pos_obj = self.pool.get('pos.order') user_obj = self.pool.get('res.users') data = [] @@ -74,7 +74,7 @@ class pos_details(report_sxw.rml_parse): def _get_sales_total_2(self): return self.total - def _get_sum_invoice_2(self,form): + def _get_sum_invoice_2(self, form): pos_obj = self.pool.get('pos.order') user_obj = self.pool.get('res.users') user_ids = form['user_ids'] or self._get_all_users() diff --git a/addons/point_of_sale/report/pos_details_summary.py b/addons/point_of_sale/report/pos_details_summary.py index a7009ea5972..a917ce99c06 100644 --- a/addons/point_of_sale/report/pos_details_summary.py +++ b/addons/point_of_sale/report/pos_details_summary.py @@ -42,7 +42,7 @@ class pos_details_summary(report_sxw.rml_parse): 'getcompany':self.get_company }) - def get_company(self,objects): + def get_company(self, objects): comp=[obj.company_id.name for obj in objects] return '%s' % (comp[0]) diff --git a/addons/point_of_sale/report/pos_lines.py b/addons/point_of_sale/report/pos_lines.py index 66b52d6ce01..6c48d9e9733 100644 --- a/addons/point_of_sale/report/pos_lines.py +++ b/addons/point_of_sale/report/pos_lines.py @@ -41,7 +41,7 @@ class pos_lines(report_sxw.rml_parse): self.total = tot return self.total - def __taxes__(self,obj): + def __taxes__(self, obj): self.cr.execute ( " Select acct.name from pos_order as po " \ " LEFT JOIN pos_order_line as pol ON po.id = pol.order_id " \ " LEFT JOIN product_taxes_rel as ptr ON pol.product_id = ptr.prod_id " \ @@ -52,4 +52,4 @@ class pos_lines(report_sxw.rml_parse): report_sxw.report_sxw('report.pos.lines', 'pos.order', 'addons/point_of_sale/report/pos_lines.rml', parser=pos_lines,header='internal') -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/point_of_sale/report/pos_payment_report.py b/addons/point_of_sale/report/pos_payment_report.py index beadd2d5cb6..1fed98a4852 100644 --- a/addons/point_of_sale/report/pos_payment_report.py +++ b/addons/point_of_sale/report/pos_payment_report.py @@ -33,7 +33,7 @@ class pos_payment_report(report_sxw.rml_parse): 'pos_payment_total':self._pos_payment_total, }) - def _pos_payment(self,obj): + def _pos_payment(self, obj): data={} sql = """ select id from pos_order where id = %d"""%(obj.id) self.cr.execute(sql) @@ -56,9 +56,9 @@ class pos_payment_report(report_sxw.rml_parse): self.total += d['price_unit'] * d['qty'] return data - def _pos_payment_total(self,o): + def _pos_payment_total(self, o): return self.total report_sxw.report_sxw('report.pos.payment.report', 'pos.order', 'addons/point_of_sale/report/pos_payment_report.rml', parser=pos_payment_report,header='internal') -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/point_of_sale/report/pos_payment_report_user.py b/addons/point_of_sale/report/pos_payment_report_user.py index c90387e4f7a..b347c86da2a 100644 --- a/addons/point_of_sale/report/pos_payment_report_user.py +++ b/addons/point_of_sale/report/pos_payment_report_user.py @@ -33,7 +33,7 @@ class pos_payment_report_user(report_sxw.rml_parse): 'pos_payment_user_total':self.__pos_payment_user__total__, }) - def __pos_payment_user__(self,form): + def __pos_payment_user__(self, form): data={} ids = form['user_id'] sql = "select pt.name,pp.default_code as code,pol.qty,pu.name as uom,pol.discount,pol.price_unit, " \ @@ -61,4 +61,4 @@ class pos_payment_report_user(report_sxw.rml_parse): report_sxw.report_sxw('report.pos.payment.report.user', 'pos.order', 'addons/point_of_sale/report/pos_payment_report_user.rml', parser=pos_payment_report_user,header='internal') -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/point_of_sale/report/pos_receipt.py b/addons/point_of_sale/report/pos_receipt.py index 93604e755e0..2ee6b2e3360 100644 --- a/addons/point_of_sale/report/pos_receipt.py +++ b/addons/point_of_sale/report/pos_receipt.py @@ -74,4 +74,4 @@ class order(report_sxw.rml_parse): report_sxw.report_sxw('report.pos.receipt', 'pos.order', 'addons/point_of_sale/report/pos_receipt.rml', parser=order, header=False) -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/point_of_sale/report/pos_sales_user.py b/addons/point_of_sale/report/pos_sales_user.py index 6ac2e1892c1..aa43592363f 100644 --- a/addons/point_of_sale/report/pos_sales_user.py +++ b/addons/point_of_sale/report/pos_sales_user.py @@ -33,7 +33,7 @@ class pos_sales_user(report_sxw.rml_parse): }) - def _get_data(self,form): + def _get_data(self, form): dt1 = form['date_start'] + ' 00:00:00' dt2 = form['date_end'] + ' 23:59:59' data={} diff --git a/addons/point_of_sale/report/pos_sales_user_today.py b/addons/point_of_sale/report/pos_sales_user_today.py index 9696d036959..35bc61efea8 100644 --- a/addons/point_of_sale/report/pos_sales_user_today.py +++ b/addons/point_of_sale/report/pos_sales_user_today.py @@ -33,7 +33,7 @@ class pos_sales_user_today(report_sxw.rml_parse): }) - def _get_data(self,form): + def _get_data(self, form): data={} ids = form['user_id'] @@ -47,4 +47,4 @@ class pos_sales_user_today(report_sxw.rml_parse): report_sxw.report_sxw('report.pos.sales.user.today', 'pos.order', 'addons/point_of_sale/report/pos_sales_user_today.rml', parser=pos_sales_user_today,header='internal') -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/point_of_sale/report/pos_users_product.py b/addons/point_of_sale/report/pos_users_product.py index 87cf306990a..032a25043e8 100644 --- a/addons/point_of_sale/report/pos_users_product.py +++ b/addons/point_of_sale/report/pos_users_product.py @@ -60,9 +60,9 @@ class pos_user_product(report_sxw.rml_parse): data = self.cr.fetchone() return data[0] - def _get_total(self,o): + def _get_total(self, o): return self.total report_sxw.report_sxw('report.pos.user.product', 'account.bank.statement', 'addons/statement/report/pos_users_product.rml', parser=pos_user_product,header='internal') -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/product/product.py b/addons/product/product.py index d04f308bc4b..d5acee0333b 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -335,7 +335,7 @@ class product_template(osv.osv): res = False return res - def onchange_uom(self, cursor, user, ids, uom_id,uom_po_id): + def onchange_uom(self, cursor, user, ids, uom_id, uom_po_id): if uom_id: return {'value': {'uom_po_id': uom_id}} return {} @@ -594,7 +594,7 @@ class product_product(osv.osv): self.pool.get('product.template').unlink(cr, uid, unlink_product_tmpl_ids, context=context) return super(product_product, self).unlink(cr, uid, unlink_ids, context=context) - def onchange_uom(self, cursor, user, ids, uom_id,uom_po_id): + def onchange_uom(self, cursor, user, ids, uom_id, uom_po_id): if uom_id and uom_po_id: uom_obj=self.pool.get('product.uom') uom=uom_obj.browse(cursor,user,[uom_id])[0] diff --git a/addons/product/report/product_pricelist.py b/addons/product/report/product_pricelist.py index c19c12c06d7..1f72dcd04b2 100644 --- a/addons/product/report/product_pricelist.py +++ b/addons/product/report/product_pricelist.py @@ -24,6 +24,7 @@ from report import report_sxw from osv import osv import pooler from tools.translate import _ + class product_pricelist(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(product_pricelist, self).__init__(cr, uid, name, context=context) @@ -39,7 +40,7 @@ class product_pricelist(report_sxw.rml_parse): 'get_titles': self._get_titles, }) - def _get_titles(self,form): + def _get_titles(self, form): lst = [] vals = {} qtys = 1 @@ -51,7 +52,7 @@ class product_pricelist(report_sxw.rml_parse): lst.append(vals) return lst - def _set_quantity(self,form): + def _set_quantity(self, form): for i in range(1,6): q = 'qty%d'%i if form[q] >0 and form[q] not in self.quantity: @@ -76,7 +77,7 @@ class product_pricelist(report_sxw.rml_parse): symbol = pool.get('res.currency').read(self.cr, self.uid, [pricelist['currency_id'][0]], ['symbol'], context=self.localcontext)[0] return symbol['symbol'] or '' - def _get_categories(self, products,form): + def _get_categories(self, products, form): cat_ids=[] res=[] self.pricelist = form['price_list'] @@ -111,7 +112,7 @@ class product_pricelist(report_sxw.rml_parse): res.append({'name':cat[1],'products': products}) return res - def _get_price(self,pricelist_id, product_id,qty): + def _get_price(self, pricelist_id, product_id, qty): sale_price_digits = self.get_digits(dp='Product Price') pool = pooler.get_pool(self.cr.dbname) price_dict = pool.get('product.pricelist').price_get(self.cr, self.uid, [pricelist_id], product_id, qty, context=self.localcontext) @@ -123,5 +124,5 @@ class product_pricelist(report_sxw.rml_parse): return price report_sxw.report_sxw('report.product.pricelist','product.product','addons/product/report/product_pricelist.rml',parser=product_pricelist) -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/product_manufacturer/product_manufacturer.py b/addons/product_manufacturer/product_manufacturer.py index 93f4a6f1a8e..1aeff8d4f78 100644 --- a/addons/product_manufacturer/product_manufacturer.py +++ b/addons/product_manufacturer/product_manufacturer.py @@ -40,4 +40,4 @@ class product_attribute(osv.osv): } product_attribute() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/product_visible_discount/__init__.py b/addons/product_visible_discount/__init__.py index 4abaf54aa85..b1dda0c009e 100644 --- a/addons/product_visible_discount/__init__.py +++ b/addons/product_visible_discount/__init__.py @@ -20,4 +20,4 @@ import product_visible_discount -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/project/project.py b/addons/project/project.py index 0d92d71a45f..dd4bbdcab21 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -55,7 +55,6 @@ class project_task_type(osv.osv): } _order = 'sequence' - def short_name(name): """Keep first word(s) of name to make it small enough but distinctive""" @@ -191,7 +190,6 @@ class project(osv.osv): # Lambda indirection method to avoid passing a copy of the overridable method when declaring the field _alias_models = lambda self, *args, **kwargs: self._get_alias_models(*args, **kwargs) - _columns = { 'complete_name': fields.function(_complete_name, string="Project Name", type='char', size=250), 'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the project without removing it."), @@ -311,11 +309,12 @@ class project(osv.osv): task_obj.duplicate_task(cr, uid, map_task_id, context=context) return True - def copy(self, cr, uid, id, default={}, context=None): + def copy(self, cr, uid, id, default=None, context=None): if context is None: context = {} + if default is None: + default = {} - default = default or {} context['active_test'] = False default['state'] = 'open' default['tasks'] = [] @@ -650,12 +649,12 @@ class task(base_stage, osv.osv): res[task.id]['progress'] = 100.0 return res - def onchange_remaining(self, cr, uid, ids, remaining=0.0, planned = 0.0): + def onchange_remaining(self, cr, uid, ids, remaining=0.0, planned=0.0): if remaining and not planned: return {'value':{'planned_hours': remaining}} return {} - def onchange_planned(self, cr, uid, ids, planned = 0.0, effective = 0.0): + def onchange_planned(self, cr, uid, ids, planned=0.0, effective=0.0): return {'value':{'remaining_hours': planned - effective}} def onchange_project(self, cr, uid, id, project_id): @@ -686,7 +685,9 @@ class task(base_stage, osv.osv): #FIXME why there is already the copy and the old one self.write(cr, uid, new, {'parent_ids':[(6,0,set(parent_ids))], 'child_ids':[(6,0, set(child_ids))]}) - def copy_data(self, cr, uid, id, default={}, context=None): + def copy_data(self, cr, uid, id, default=None, context=None): + if default is None: + default = {} default = default or {} default.update({'work_ids':[], 'date_start': False, 'date_end': False, 'date_deadline': False}) if not default.get('remaining_hours', False): @@ -699,7 +700,6 @@ class task(base_stage, osv.osv): default.update({'name':new_name}) return super(task, self).copy_data(cr, uid, id, default, context) - def _is_template(self, cr, uid, ids, field_name, arg, context=None): res = {} for task in self.browse(cr, uid, ids, context=context): @@ -777,7 +777,6 @@ class task(base_stage, osv.osv): 'color': fields.integer('Color Index'), 'user_email': fields.related('user_id', 'email', type='char', string='User Email', readonly=True), } - _defaults = { 'stage_id': _get_default_stage_id, 'project_id': _get_default_project_id, @@ -790,7 +789,6 @@ class task(base_stage, osv.osv): 'user_id': lambda obj, cr, uid, context: uid, 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'project.task', context=c), } - _order = "priority, sequence, date_start, name, id" def set_priority(self, cr, uid, ids, priority, *args): @@ -853,9 +851,8 @@ class task(base_stage, osv.osv): (_check_recursion, 'Error ! You cannot create recursive tasks.', ['parent_ids']), (_check_dates, 'Error ! Task end-date must be greater then task start-date', ['date_start','date_end']) ] - # + # Override view according to the company definition - # def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): users_obj = self.pool.get('res.users') if context is None: context = {} @@ -887,9 +884,9 @@ class task(base_stage, osv.osv): res['fields'][f]['string'] = res['fields'][f]['string'].replace('Hours',tm) return res - # **************************************** + # ---------------------------------------- # Case management - # **************************************** + # ---------------------------------------- def stage_find(self, cr, uid, cases, section_id, domain=[], order='sequence', context=None): """ Override of the base.stage method @@ -1021,10 +1018,12 @@ class task(base_stage, osv.osv): new_attachment_ids.append(attachment.copy(cr, uid, attachment_id, default={'res_id': delegated_task_id}, context=context)) return new_attachment_ids - def do_delegate(self, cr, uid, ids, delegate_data={}, context=None): + def do_delegate(self, cr, uid, ids, delegate_data=None, context=None): """ Delegate Task to another users. """ + if delegate_data is None: + delegate_data = {} assert delegate_data['user_id'], _("Delegated User should be specified") delegated_tasks = {} for task in self.browse(cr, uid, ids, context=context): @@ -1170,7 +1169,7 @@ class task(base_stage, osv.osv): return result # --------------------------------------------------- - # mail gateway + # Mail gateway # --------------------------------------------------- def message_new(self, cr, uid, msg, custom_values=None, context=None): diff --git a/addons/project/wizard/project_task_reevaluate.py b/addons/project/wizard/project_task_reevaluate.py index 382c9d64361..b00c531717f 100644 --- a/addons/project/wizard/project_task_reevaluate.py +++ b/addons/project/wizard/project_task_reevaluate.py @@ -26,7 +26,7 @@ from tools.translate import _ class project_task_reevaluate(osv.osv_memory): _name = 'project.task.reevaluate' - def _get_remaining(self,cr, uid, context=None): + def _get_remaining(self, cr, uid, context=None): if context is None: context = {} active_id = context.get('active_id', False) diff --git a/addons/project_gtd/project_gtd.py b/addons/project_gtd/project_gtd.py index c4e485876d8..4c48ae3db1f 100644 --- a/addons/project_gtd/project_gtd.py +++ b/addons/project_gtd/project_gtd.py @@ -67,7 +67,7 @@ class project_task(osv.osv): default['context_id'] = False return super(project_task,self).copy_data(cr, uid, id, default, context) - def _get_context(self,cr, uid, context=None): + def _get_context(self, cr, uid, context=None): ids = self.pool.get('project.gtd.context').search(cr, uid, [], context=context) return ids and ids[0] or False diff --git a/addons/project_gtd/wizard/project_gtd_empty.py b/addons/project_gtd/wizard/project_gtd_empty.py index 04c9689cc27..fe40db06f5f 100644 --- a/addons/project_gtd/wizard/project_gtd_empty.py +++ b/addons/project_gtd/wizard/project_gtd_empty.py @@ -30,7 +30,7 @@ class project_timebox_empty(osv.osv_memory): 'name': fields.char('Name', size=32) } - def view_init(self, cr , uid , fields_list, context=None): + def view_init(self, cr, uid, fields_list, context=None): if context is None: context = {} self._empty(cr, uid, context=context) diff --git a/addons/project_mrp/project_procurement.py b/addons/project_mrp/project_procurement.py index 1c347c8ae02..ae5e1ccbf15 100644 --- a/addons/project_mrp/project_procurement.py +++ b/addons/project_mrp/project_procurement.py @@ -42,7 +42,7 @@ class procurement_order(osv.osv): return False return True - def check_produce_service(self, cr, uid, procurement, context=None): + def check_produce_service(self, cr, uid, procurement, context=None): return True def _convert_qty_company_hours(self, cr, uid, procurement, context=None): diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index 488c780b988..4036217b886 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -225,7 +225,7 @@ class task(osv.osv): return super(task,self).unlink(cr, uid, ids, *args, **kwargs) - def write(self, cr, uid, ids,vals,context=None): + def write(self, cr, uid, ids, vals, context=None): if context is None: context = {} if vals.get('project_id',False) or vals.get('name',False): diff --git a/addons/project_timesheet/report/task_report.py b/addons/project_timesheet/report/task_report.py index b32d852bc5f..89476b991b1 100644 --- a/addons/project_timesheet/report/task_report.py +++ b/addons/project_timesheet/report/task_report.py @@ -29,7 +29,7 @@ class report_timesheet_task_user(osv.osv): _auto = False _order = "name" - def get_hrs_timesheet(self, cr, uid, ids, name,args,context): + def get_hrs_timesheet(self, cr, uid, ids, name, args, context): result = {} for record in self.browse(cr, uid, ids, context): last_date = datetime.strptime(record.name, '%Y-%m-%d') + relativedelta(months=1) - relativedelta(days=1) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 8502fd7ee3f..d654078a055 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -31,9 +31,6 @@ import decimal_precision as dp from osv.orm import browse_record, browse_null from tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT, DATETIME_FORMATS_MAP -# -# Model definition -# class purchase_order(osv.osv): def _amount_all(self, cr, uid, ids, field_name, arg, context=None): @@ -239,7 +236,6 @@ class purchase_order(osv.osv): else: raise osv.except_osv(_('Invalid Action!'), _('In order to delete a purchase order, you must cancel it first.')) - # TODO: temporary fix in 5.0, to remove in 5.2 when subflows support # automatically sending subflow.delete upon deletion wf_service = netsvc.LocalService("workflow") for id in unlink_ids: @@ -333,7 +329,7 @@ class purchase_order(osv.osv): 'view_id': view_id, 'res_id': pick_ids[0] }) - + action.update({ 'context': ctx, }) @@ -380,7 +376,7 @@ class purchase_order(osv.osv): for line in po.order_line: if line.state=='draft': todo.append(line.id) -# current_name = self.name_get(cr, uid, ids)[0][1] + self.pool.get('purchase.order.line').action_confirm(cr, uid, todo, context) for id in ids: self.write(cr, uid, [id], {'state' : 'confirmed', 'validator' : uid}) @@ -491,7 +487,7 @@ class purchase_order(osv.osv): self.invoice_done_send_note(cr, uid, ids, context=context) return True - def has_stockable_product(self,cr, uid, ids, *args): + def has_stockable_product(self, cr, uid, ids, *args): for order in self.browse(cr, uid, ids): for order_line in order.order_line: if order_line.product_id and order_line.product_id.product_tmpl_id.type in ('product', 'consu'): @@ -596,7 +592,7 @@ class purchase_order(osv.osv): wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr) return [picking_id] - def action_picking_create(self,cr, uid, ids, context=None): + def action_picking_create(self, cr, uid, ids, context=None): picking_ids = [] for order in self.browse(cr, uid, ids): picking_ids.extend(self._create_pickings(cr, uid, order, order.order_line, None, context=context)) @@ -665,7 +661,7 @@ class purchase_order(osv.osv): list_key.sort() return tuple(list_key) - # compute what the new orders should contain + # Compute what the new orders should contain new_orders = {} @@ -1098,4 +1094,5 @@ class mail_mail(osv.osv): return super(mail_mail, self)._postprocess_sent_message(cr, uid, mail=mail, context=context) mail_mail() + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/purchase/wizard/purchase_order_group.py b/addons/purchase/wizard/purchase_order_group.py index 99ae11a7ba8..13bfb539861 100644 --- a/addons/purchase/wizard/purchase_order_group.py +++ b/addons/purchase/wizard/purchase_order_group.py @@ -88,4 +88,4 @@ class purchase_order_group(osv.osv_memory): purchase_order_group() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/purchase_requisition/purchase_requisition.py b/addons/purchase_requisition/purchase_requisition.py index 5ab19390656..c21a9ee8955 100644 --- a/addons/purchase_requisition/purchase_requisition.py +++ b/addons/purchase_requisition/purchase_requisition.py @@ -207,7 +207,7 @@ class purchase_requisition_line(osv.osv): 'company_id': fields.related('requisition_id','company_id',type='many2one',relation='res.company',string='Company', store=True, readonly=True), } - def onchange_product_id(self, cr, uid, ids, product_id,product_uom_id, context=None): + def onchange_product_id(self, cr, uid, ids, product_id, product_uom_id, context=None): """ Changes UoM and name if product_id changes. @param name: Name of the field @param product_id: Changed product_id diff --git a/addons/report_webkit/ir_report.py b/addons/report_webkit/ir_report.py index d2709ea6fc2..68e129d021d 100644 --- a/addons/report_webkit/ir_report.py +++ b/addons/report_webkit/ir_report.py @@ -35,7 +35,7 @@ from webkit_report import WebKitParser from report.report_sxw import rml_parse def register_report(name, model, tmpl_path, parser=rml_parse): - "Register the report into the services" + """Register the report into the services""" name = 'report.%s' % name if netsvc.Service._services.get(name, False): service = netsvc.Service._services[name] diff --git a/addons/report_webkit/report_helper.py b/addons/report_webkit/report_helper.py index 12651f308dc..8d0a27998b0 100644 --- a/addons/report_webkit/report_helper.py +++ b/addons/report_webkit/report_helper.py @@ -75,7 +75,7 @@ class WebKitHelper(object): head = header_obj.browse(self.cursor, self.uid, header_img_id) return (head.img, head.type) - def embed_logo_by_name(self, name, width=0, height=0) : + def embed_logo_by_name(self, name, width=0, height=0): """Return HTML embedded logo by name""" img, type = self.get_logo_by_name(name) return self.embed_image(type, img, width, height) diff --git a/addons/resource/faces/task.py b/addons/resource/faces/task.py index 81379c67240..7516f41db2a 100644 --- a/addons/resource/faces/task.py +++ b/addons/resource/faces/task.py @@ -567,7 +567,8 @@ class _ValueWrapper(object): return result #@-node:_cmp #@+node:__getattr__ - def __getattr__(self, name): return getattr(self._value, name) + def __getattr__(self, name): + return getattr(self._value, name) #@-node:__getattr__ #@+node:__getitem__ def __getitem__(self, slice): diff --git a/addons/resource/resource.py b/addons/resource/resource.py index ed21eea85cc..45fd9c20bc9 100644 --- a/addons/resource/resource.py +++ b/addons/resource/resource.py @@ -438,7 +438,7 @@ class resource_calendar_leaves(osv.osv): (check_dates, 'Error! leave start-date must be lower then leave end-date.', ['date_from', 'date_to']) ] - def onchange_resource(self,cr, uid, ids, resource, context=None): + def onchange_resource(self, cr, uid, ids, resource, context=None): result = {} if resource: resource_pool = self.pool.get('resource.resource') diff --git a/addons/sale/report/__init__.py b/addons/sale/report/__init__.py index 0248595f4da..6986639d942 100644 --- a/addons/sale/report/__init__.py +++ b/addons/sale/report/__init__.py @@ -22,4 +22,4 @@ import sale_order import sale_report -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 96f44d353d6..c47bf1357c8 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -253,7 +253,7 @@ class sale_order(osv.osv): return osv.osv.unlink(self, cr, uid, unlink_ids, context=context) - def onchange_pricelist_id(self, cr, uid, ids, pricelist_id, order_lines, context={}): + def onchange_pricelist_id(self, cr, uid, ids, pricelist_id, order_lines, context=None): if (not pricelist_id) or (not order_lines): return {} warning = { @@ -262,7 +262,6 @@ class sale_order(osv.osv): } return {'warning': warning} - def onchange_partner_id(self, cr, uid, ids, part): if not part: return {'value': {'partner_invoice_id': False, 'partner_shipping_id': False, 'payment_term': False, 'fiscal_position': False}} @@ -437,7 +436,9 @@ class sale_order(osv.osv): return False return True - def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed', 'done', 'exception'], date_inv = False, context=None): + def action_invoice_create(self, cr, uid, ids, grouped=False, states=None, date_inv = False, context=None): + if states is None: + states = ['confirmed', 'done', 'exception'] res = False invoices = {} invoice_ids = [] @@ -648,7 +649,7 @@ class sale_order(osv.osv): def cancel_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): self.message_post(cr, uid, [obj.id], body=_("Sale Order for %s cancelled.") % (obj.partner_id.name), context=context) - + def done_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): self.message_post(cr, uid, [obj.id], body=_("Sale Order for %s set to Done") % (obj.partner_id.name), context=context) @@ -874,12 +875,12 @@ class sale_order_line(osv.osv): context_partner = {'lang': lang, 'partner_id': partner_id} if not product: - return {'value': {'th_weight': 0, + return {'value': {'th_weight': 0, 'product_uos_qty': qty}, 'domain': {'product_uom': [], 'product_uos': []}} if not date_order: date_order = time.strftime(DEFAULT_SERVER_DATE_FORMAT) -# + result = {} warning_msgs = {} product_obj = product_obj.browse(cr, uid, product, context=context) @@ -995,6 +996,7 @@ class mail_compose_message(osv.osv): wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'sale.order', context.get('default_res_id', False), 'quotation_sent', cr) return super(mail_compose_message, self).send_mail(cr, uid, ids, context=context) + mail_compose_message() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale/wizard/__init__.py b/addons/sale/wizard/__init__.py index 6cf076164d8..bfc8679de16 100644 --- a/addons/sale/wizard/__init__.py +++ b/addons/sale/wizard/__init__.py @@ -23,4 +23,4 @@ import sale_make_invoice import sale_line_invoice import sale_make_invoice_advance -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale_crm/__init__.py b/addons/sale_crm/__init__.py index f5db3f4333b..ac44586e7db 100644 --- a/addons/sale_crm/__init__.py +++ b/addons/sale_crm/__init__.py @@ -22,4 +22,4 @@ import wizard import sale_crm -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale_order_dates/sale_order_dates.py b/addons/sale_order_dates/sale_order_dates.py index ceb6d48755c..1b069cb2bed 100644 --- a/addons/sale_order_dates/sale_order_dates.py +++ b/addons/sale_order_dates/sale_order_dates.py @@ -61,4 +61,4 @@ class sale_order_dates(osv.osv): sale_order_dates() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/report/lot_overview.py b/addons/stock/report/lot_overview.py index 89974fa122b..bf2fd32e32c 100644 --- a/addons/stock/report/lot_overview.py +++ b/addons/stock/report/lot_overview.py @@ -34,7 +34,7 @@ class lot_overview(report_sxw.rml_parse): 'grand_total_price':self._grand_total, }) - def process(self,location_id): + def process(self, location_id): location_obj = pooler.get_pool(self.cr.dbname).get('stock.location') data = location_obj._product_get_report(self.cr,self.uid, [location_id]) diff --git a/addons/stock/report/lot_overview_all.py b/addons/stock/report/lot_overview_all.py index 0b4edcaecf4..552949ec4b2 100644 --- a/addons/stock/report/lot_overview_all.py +++ b/addons/stock/report/lot_overview_all.py @@ -34,7 +34,7 @@ class lot_overview_all(report_sxw.rml_parse): 'grand_total_price':self._grand_total, }) - def process(self,location_id): + def process(self, location_id): location_obj = pooler.get_pool(self.cr.dbname).get('stock.location') data = location_obj._product_get_all_report(self.cr,self.uid, [location_id]) data['location_name'] = location_obj.read(self.cr, self.uid, [location_id],['complete_name'])[0]['complete_name'] diff --git a/addons/stock/report/product_stock.py b/addons/stock/report/product_stock.py index b7dd254234c..1d882ad632b 100644 --- a/addons/stock/report/product_stock.py +++ b/addons/stock/report/product_stock.py @@ -42,7 +42,9 @@ class external_pdf(render): class report_stock(report_int): - def create(self, cr, uid, ids, datas, context={}): + def create(self, cr, uid, ids, datas, context=None): + if context is None: + context = {} product_ids = ids if 'location_id' in context: location_id = context['location_id'] diff --git a/addons/stock/report/report_stock.py b/addons/stock/report/report_stock.py index a711cdf23ee..19fae806fc0 100644 --- a/addons/stock/report/report_stock.py +++ b/addons/stock/report/report_stock.py @@ -74,10 +74,9 @@ class stock_report_prodlots(osv.osv): group by location_id, product_id, prodlot_id )""") - def unlink(self, cr, uid, ids, context={}): + def unlink(self, cr, uid, ids, context=None): raise osv.except_osv(_('Error!'), _('You cannot delete any record!')) - stock_report_prodlots() class stock_report_tracklots(osv.osv): @@ -130,8 +129,8 @@ class stock_report_tracklots(osv.osv): ) as report group by location_id, product_id, tracking_id )""") - - def unlink(self, cr, uid, ids, context={}): + + def unlink(self, cr, uid, ids, context=None): raise osv.except_osv(_('Error!'), _('You cannot delete any record!')) stock_report_tracklots() @@ -162,6 +161,7 @@ class report_stock_lines_date(osv.osv): where p.active='true' group by p.id )""") + report_stock_lines_date() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/report/stock_by_location.py b/addons/stock/report/stock_by_location.py index 2dbe03a347e..8ed8800fb29 100644 --- a/addons/stock/report/stock_by_location.py +++ b/addons/stock/report/stock_by_location.py @@ -26,7 +26,7 @@ from report.interface import toxml #FIXME: we should use toxml class report_custom(report_rml): - def create_xml(self, cr, uid, ids, datas, context={}): + def create_xml(self, cr, uid, ids, datas, context=None): config = """ 09/09/2005 diff --git a/addons/stock/report/stock_inventory_move_report.py b/addons/stock/report/stock_inventory_move_report.py index e8c0d44bcc1..762373f1250 100644 --- a/addons/stock/report/stock_inventory_move_report.py +++ b/addons/stock/report/stock_inventory_move_report.py @@ -30,7 +30,7 @@ class stock_inventory_move(report_sxw.rml_parse): 'qty_total':self._qty_total }) - def _qty_total(self,objects): + def _qty_total(self, objects): total = 0.0 uom = objects[0].product_uom.name for obj in objects: diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 8e1180352c2..322acb15716 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -346,22 +346,28 @@ class stock_location(osv.osv): }) return product_obj.get_product_available(cr, uid, product_ids, context=context) - def _product_get(self, cr, uid, id, product_ids=False, context=None, states=['done']): + def _product_get(self, cr, uid, id, product_ids=False, context=None, states=None): """ @param product_ids: @param states: @return: """ + if states is None: + states = ['done'] ids = id and [id] or [] return self._product_get_multi_location(cr, uid, ids, product_ids, context=context, states=states) - def _product_all_get(self, cr, uid, id, product_ids=False, context=None, states=['done']): + def _product_all_get(self, cr, uid, id, product_ids=False, context=None, states=None): + if states is None: + states = ['done'] # build the list of ids of children of the location given by id ids = id and [id] or [] location_ids = self.search(cr, uid, [('location_id', 'child_of', ids)]) return self._product_get_multi_location(cr, uid, location_ids, product_ids, context, states) - def _product_virtual_get(self, cr, uid, id, product_ids=False, context=None, states=['done']): + def _product_virtual_get(self, cr, uid, id, product_ids=False, context=None, states=None): + if states is None: + states = ['done'] return self._product_all_get(cr, uid, id, product_ids, context, ['confirmed', 'waiting', 'assigned', 'done']) def _product_reserve(self, cr, uid, ids, product_id, product_qty, context=None, lock=False): @@ -522,7 +528,7 @@ class stock_tracking(osv.osv): def unlink(self, cr, uid, ids, context=None): raise osv.except_osv(_('Error!'), _('You cannot remove a lot line.')) - def action_traceability(self, cr, uid, ids, context={}): + def action_traceability(self, cr, uid, ids, context=None): """ It traces the information of a product @param self: The object pointer. @param cr: A database cursor diff --git a/addons/stock_invoice_directly/wizard/stock_invoice.py b/addons/stock_invoice_directly/wizard/stock_invoice.py index 3725d9b6d7f..4bb0ab41d88 100644 --- a/addons/stock_invoice_directly/wizard/stock_invoice.py +++ b/addons/stock_invoice_directly/wizard/stock_invoice.py @@ -47,4 +47,4 @@ class invoice_directly(osv.osv_memory): invoice_directly() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock_location/procurement_pull.py b/addons/stock_location/procurement_pull.py index 5482669f543..840e6c854c7 100644 --- a/addons/stock_location/procurement_pull.py +++ b/addons/stock_location/procurement_pull.py @@ -45,7 +45,7 @@ class procurement_order(osv.osv): return (line.type_proc=='move') and (line.location_src_id) return False - def action_move_create(self, cr, uid, ids,context=None): + def action_move_create(self, cr, uid, ids, context=None): proc_obj = self.pool.get('procurement.order') move_obj = self.pool.get('stock.move') picking_obj=self.pool.get('stock.picking') diff --git a/addons/stock_planning/stock_planning.py b/addons/stock_planning/stock_planning.py index 7fcaf23045e..e2c723fa4e2 100644 --- a/addons/stock_planning/stock_planning.py +++ b/addons/stock_planning/stock_planning.py @@ -406,7 +406,7 @@ class stock_planning(osv.osv): res[val.id] = 'Future' return res - def _get_op(self, cr, uid, ids, field_names, arg, context=None): # op = OrderPoint + def _get_op(self, cr, uid, ids, field_names, arg, context=None): res = {} for val in self.browse(cr, uid, ids, context=context): res[val.id]={} diff --git a/addons/stock_planning/wizard/stock_planning_createlines.py b/addons/stock_planning/wizard/stock_planning_createlines.py index 394606ebb4d..ba882d59cf3 100644 --- a/addons/stock_planning/wizard/stock_planning_createlines.py +++ b/addons/stock_planning/wizard/stock_planning_createlines.py @@ -49,7 +49,7 @@ class stock_planning_createlines(osv.osv_memory): 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.planning', context=c), } - def create_planning(self,cr, uid, ids, context=None): + def create_planning(self, cr, uid, ids, context=None): if context is None: context = {} product_obj = self.pool.get('product.product') diff --git a/addons/survey/survey.py b/addons/survey/survey.py index f618a95cccf..d01140092d4 100644 --- a/addons/survey/survey.py +++ b/addons/survey/survey.py @@ -548,7 +548,7 @@ class survey_question_column_heading(osv.osv): _description = 'Survey Question Column Heading' _rec_name = 'title' - def _get_in_visible_rating_weight(self,cr, uid, context=None): + def _get_in_visible_rating_weight(self, cr, uid, context=None): if context is None: context = {} if context.get('in_visible_rating_weight', False): @@ -601,7 +601,7 @@ class survey_answer(osv.osv): } return val - def _get_in_visible_answer_type(self,cr, uid, context=None): + def _get_in_visible_answer_type(self, cr, uid, context=None): if context is None: context = {} return context.get('in_visible_answer_type', False) diff --git a/addons/survey/wizard/__init__.py b/addons/survey/wizard/__init__.py index aa1270da751..0ea0e5cd424 100644 --- a/addons/survey/wizard/__init__.py +++ b/addons/survey/wizard/__init__.py @@ -27,4 +27,4 @@ import survey_selection import survey_answer import survey_print -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/survey/wizard/survey_answer.py b/addons/survey/wizard/survey_answer.py index 2b774a22feb..8ece1e184cf 100644 --- a/addons/survey/wizard/survey_answer.py +++ b/addons/survey/wizard/survey_answer.py @@ -1008,7 +1008,7 @@ class survey_question_wiz(osv.osv_memory): return survey_question_wiz_id - def action_new_question(self,cr, uid, ids, context=None): + def action_new_question(self, cr, uid, ids, context=None): """ New survey.Question form. """ @@ -1050,7 +1050,7 @@ class survey_question_wiz(osv.osv_memory): 'context': context } - def action_edit_page(self,cr, uid, ids, context=None): + def action_edit_page(self, cr, uid, ids, context=None): """ Edit survey.page. """ @@ -1072,7 +1072,7 @@ class survey_question_wiz(osv.osv_memory): 'context': context } - def action_delete_page(self,cr, uid, ids, context=None): + def action_delete_page(self, cr, uid, ids, context=None): """ Delete survey.page. """ @@ -1098,7 +1098,7 @@ class survey_question_wiz(osv.osv_memory): 'context': context } - def action_edit_question(self,cr, uid, ids, context=None): + def action_edit_question(self, cr, uid, ids, context=None): """ Edit survey.question. """ @@ -1120,7 +1120,7 @@ class survey_question_wiz(osv.osv_memory): 'context': context } - def action_delete_question(self,cr, uid, ids, context=None): + def action_delete_question(self, cr, uid, ids, context=None): """ Delete survey.question. """