Merge lp:~openerp-dev/openobject-addons/trunk-unmutable-defaults-abo into lp:openobject-addons

Proposed by Anto
Status: Merged
Merged at revision: 7702
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-unmutable-defaults-abo
Merge into: lp:openobject-addons
Diff against target: 5307 lines (+656/-625)
193 files modified
account/account.py (+44/-17)
account/account_bank.py (+3/-3)
account/account_move_line.py (+1/-1)
account/project/wizard/account_analytic_chart.py (+1/-1)
account/project/wizard/account_analytic_inverted_balance_report.py (+1/-1)
account/project/wizard/project_account_analytic_line.py (+1/-1)
account/report/account_balance.py (+1/-1)
account/report/account_central_journal.py (+1/-1)
account/report/account_general_journal.py (+1/-1)
account/report/account_report.py (+1/-1)
account/report/account_tax_report.py (+6/-2)
account/res_currency.py (+0/-1)
account/wizard/account_invoice_state.py (+1/-1)
account/wizard/account_journal_select.py (+1/-1)
account/wizard/account_move_bank_reconcile.py (+1/-1)
account/wizard/account_move_journal.py (+1/-1)
account/wizard/account_move_line_reconcile_select.py (+1/-1)
account/wizard/account_move_line_select.py (+1/-1)
account/wizard/account_move_line_unreconcile_select.py (+1/-1)
account/wizard/account_reconcile.py (+1/-1)
account/wizard/account_state_open.py (+1/-1)
account/wizard/account_subscription_generate.py (+1/-1)
account/wizard/account_unreconcile.py (+1/-1)
account_analytic_plans/report/crossovered_analytic.py (+6/-4)
account_anglo_saxon/__init__.py (+1/-1)
account_anglo_saxon/sale.py (+0/-43)
account_asset/account_asset.py (+5/-3)
account_budget/report/analytic_account_budget_report.py (+5/-3)
account_budget/report/budget_report.py (+3/-1)
account_budget/report/crossovered_budget_report.py (+3/-1)
account_budget/wizard/account_budget_analytic.py (+1/-1)
account_budget/wizard/account_budget_crossovered_report.py (+1/-1)
account_budget/wizard/account_budget_report.py (+1/-1)
account_followup/__init__.py (+1/-1)
account_followup/wizard/__init__.py (+1/-1)
account_followup/wizard/account_followup_print.py (+1/-1)
account_payment/__init__.py (+1/-1)
account_payment/account_invoice.py (+1/-1)
account_payment/account_move_line.py (+2/-2)
account_payment/account_payment.py (+3/-1)
account_payment/report/__init__.py (+1/-1)
account_payment/report/payment_order.py (+2/-2)
account_payment/wizard/__init__.py (+1/-1)
account_payment/wizard/account_payment_pay.py (+1/-1)
account_payment/wizard/account_payment_populate_statement.py (+1/-1)
account_sequence/__init__.py (+1/-1)
account_voucher/__init__.py (+1/-1)
account_voucher/account_voucher.py (+4/-2)
account_voucher/report/__init__.py (+1/-1)
anonymization/anonymization.py (+2/-2)
audittrail/audittrail.py (+11/-5)
base_crypt/crypt.py (+3/-1)
base_module_doc_rst/report/ir_module_reference_print_graph.py (+1/-1)
base_module_record/wizard/base_module_record_objects.py (+1/-1)
base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py (+17/-15)
base_report_designer/plugin/openerp_report_designer/bin/script/About.py (+1/-1)
base_report_designer/plugin/openerp_report_designer/bin/script/AddAttachment.py (+8/-8)
base_report_designer/plugin/openerp_report_designer/bin/script/Change.py (+2/-2)
base_report_designer/plugin/openerp_report_designer/bin/script/ConvertBracesToField.py (+26/-24)
base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py (+1/-1)
base_report_designer/plugin/openerp_report_designer/bin/script/ExportToRML.py (+1/-1)
base_report_designer/plugin/openerp_report_designer/bin/script/Expression.py (+3/-3)
base_report_designer/plugin/openerp_report_designer/bin/script/Fields.py (+6/-6)
base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py (+3/-3)
base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py (+3/-3)
base_report_designer/plugin/openerp_report_designer/bin/script/Repeatln.py (+4/-4)
base_report_designer/plugin/openerp_report_designer/bin/script/SendToServer.py (+4/-4)
base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py (+4/-7)
base_report_designer/plugin/openerp_report_designer/bin/script/Translation.py (+6/-6)
base_report_designer/plugin/openerp_report_designer/bin/script/lib/error.py (+1/-1)
base_report_designer/plugin/openerp_report_designer/bin/script/lib/functions.py (+14/-8)
base_report_designer/plugin/openerp_report_designer/bin/script/lib/logreport.py (+1/-2)
base_report_designer/plugin/openerp_report_designer/bin/script/lib/rpc.py (+2/-2)
base_report_designer/plugin/openerp_report_designer/bin/script/lib/tools.py (+3/-3)
base_report_designer/plugin/openerp_report_designer/bin/script/modify.py (+1/-1)
base_report_designer/plugin/openerp_report_designer/test/test_fields.py (+7/-1)
base_vat/__init__.py (+1/-1)
base_vat/res_company.py (+1/-1)
caldav/caldav_node.py (+11/-11)
crm/crm.py (+6/-7)
crm/crm_lead.py (+1/-2)
crm_claim/crm_claim.py (+2/-2)
crm_helpdesk/crm_helpdesk.py (+5/-6)
crm_profiling/crm_profiling.py (+1/-1)
document/content_index.py (+4/-5)
document/document.py (+1/-1)
document/document_directory.py (+2/-2)
document/nodes.py (+26/-28)
document/odt2txt.py (+3/-3)
document/std_index.py (+8/-8)
document_webdav/document_webdav.py (+1/-1)
document_webdav/redirect.py (+1/-1)
document_webdav/test_davclient.py (+1/-2)
document_webdav/webdav.py (+1/-1)
document_webdav/webdav_server.py (+6/-6)
email_template/html2text.py (+53/-51)
event/event.py (+2/-1)
event/report/__init__.py (+1/-1)
event/wizard/event_confirm.py (+1/-1)
event_moodle/event_moodle.py (+1/-1)
event_project/event_project.py (+1/-1)
event_project/wizard/event_project_retro.py (+1/-1)
hr_attendance/wizard/hr_attendance_bymonth.py (+1/-1)
hr_attendance/wizard/hr_attendance_byweek.py (+1/-1)
hr_attendance/wizard/hr_attendance_error.py (+1/-1)
hr_evaluation/hr_evaluation.py (+3/-3)
hr_payroll/report/report_contribution_register.py (+1/-1)
hr_payroll/report/report_payslip.py (+1/-1)
hr_payroll/report/report_payslip_details.py (+1/-1)
hr_payroll_account/__init__.py (+1/-1)
hr_payroll_account/wizard/__init__.py (+1/-1)
hr_payroll_account/wizard/hr_payroll_payslips_by_employees.py (+1/-1)
hr_recruitment/hr_recruitment.py (+7/-9)
hr_recruitment/wizard/hr_recruitment_create_partner_job.py (+1/-1)
hr_recruitment/wizard/hr_recruitment_employee_hired.py (+2/-2)
hr_timesheet_invoice/hr_timesheet_invoice.py (+3/-2)
hr_timesheet_invoice/report/account_analytic_profit.py (+1/-1)
hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py (+7/-5)
hr_timesheet_sheet/hr_timesheet_sheet.py (+2/-2)
hr_timesheet_sheet/wizard/hr_timesheet_current.py (+1/-1)
idea/idea.py (+6/-5)
import_base/import_framework.py (+1/-1)
import_sugarcrm/import_sugarcrm.py (+3/-3)
l10n_be/__init__.py (+1/-1)
l10n_be_coda/l10n_be_coda.py (+10/-3)
l10n_be_invoice_bba/invoice.py (+39/-40)
l10n_br/l10n_br.py (+1/-1)
l10n_ch/partner.py (+1/-1)
l10n_ch/payment.py (+1/-1)
l10n_ch/report/report_webkit_html.py (+1/-1)
l10n_ch/wizard/create_dta.py (+1/-1)
l10n_fr/l10n_fr.py (+0/-4)
l10n_fr/report/base_report.py (+1/-1)
l10n_lu/wizard/pdf_ext.py (+1/-1)
lunch/report/order.py (+2/-2)
mail/mail_thread.py (+2/-2)
membership/report/__init__.py (+1/-1)
membership/report/report_membership.py (+1/-1)
membership/wizard/__init__.py (+1/-1)
mrp/mrp.py (+9/-5)
mrp/procurement.py (+1/-1)
mrp/report/bom_structure.py (+2/-2)
mrp/stock.py (+1/-1)
mrp_operations/mrp_operations.py (+1/-1)
plugin/plugin_handler.py (+17/-19)
point_of_sale/report/account_statement.py (+1/-1)
point_of_sale/report/all_closed_cashbox_of_the_day.py (+9/-9)
point_of_sale/report/pos_details.py (+3/-3)
point_of_sale/report/pos_details_summary.py (+1/-1)
point_of_sale/report/pos_lines.py (+2/-2)
point_of_sale/report/pos_payment_report.py (+3/-3)
point_of_sale/report/pos_payment_report_user.py (+2/-2)
point_of_sale/report/pos_receipt.py (+1/-1)
point_of_sale/report/pos_sales_user.py (+1/-1)
point_of_sale/report/pos_sales_user_today.py (+2/-2)
point_of_sale/report/pos_users_product.py (+2/-2)
product/product.py (+2/-2)
product/report/product_pricelist.py (+6/-5)
product_manufacturer/product_manufacturer.py (+1/-1)
product_visible_discount/__init__.py (+1/-1)
project/project.py (+15/-16)
project/wizard/project_task_reevaluate.py (+1/-1)
project_gtd/project_gtd.py (+1/-1)
project_gtd/wizard/project_gtd_empty.py (+1/-1)
project_mrp/project_procurement.py (+1/-1)
project_timesheet/project_timesheet.py (+1/-1)
project_timesheet/report/task_report.py (+1/-1)
purchase/purchase.py (+6/-9)
purchase/wizard/purchase_order_group.py (+1/-1)
purchase_requisition/purchase_requisition.py (+1/-1)
report_webkit/ir_report.py (+1/-1)
report_webkit/report_helper.py (+1/-1)
resource/faces/task.py (+2/-1)
resource/resource.py (+1/-1)
sale/report/__init__.py (+1/-1)
sale/sale.py (+8/-6)
sale/wizard/__init__.py (+1/-1)
sale_crm/__init__.py (+1/-1)
sale_order_dates/sale_order_dates.py (+1/-1)
stock/report/lot_overview.py (+1/-1)
stock/report/lot_overview_all.py (+1/-1)
stock/report/product_stock.py (+3/-1)
stock/report/report_stock.py (+4/-4)
stock/report/stock_by_location.py (+1/-1)
stock/report/stock_inventory_move_report.py (+1/-1)
stock/stock.py (+10/-4)
stock_invoice_directly/wizard/stock_invoice.py (+1/-1)
stock_location/procurement_pull.py (+1/-1)
stock_planning/stock_planning.py (+1/-1)
stock_planning/wizard/stock_planning_createlines.py (+1/-1)
survey/survey.py (+2/-2)
survey/wizard/__init__.py (+1/-1)
survey/wizard/survey_answer.py (+5/-5)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-unmutable-defaults-abo
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+127462@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account.py'
2--- account/account.py 2012-09-30 12:46:54 +0000
3+++ account/account.py 2012-10-02 11:29:53 +0000
4@@ -595,12 +595,15 @@
5 res.append((record['id'], name))
6 return res
7
8- def copy(self, cr, uid, id, default={}, context=None, done_list=[], local=False):
9+ def copy(self, cr, uid, id, default=None, context=None, done_list=None, local=False):
10+ if default is None:
11+ default = {}
12+ else:
13+ default = default.copy()
14+ if done_list is None:
15+ done_list = []
16 account = self.browse(cr, uid, id, context=context)
17 new_child_ids = []
18- if not default:
19- default = {}
20- default = default.copy()
21 default.update(code=_("%s (copy)") % (account['code'] or ''))
22 if not local:
23 done_list = []
24@@ -777,11 +780,14 @@
25 (_check_currency, 'Configuration error!\nThe currency chosen should be shared by the default accounts too.', ['currency','default_debit_account_id','default_credit_account_id']),
26 ]
27
28- def copy(self, cr, uid, id, default={}, context=None, done_list=[], local=False):
29+ def copy(self, cr, uid, id, default=None, context=None, done_list=None, local=False):
30+ if default is None:
31+ default = {}
32+ else:
33+ default = default.copy()
34+ if done_list is None:
35+ done_list = []
36 journal = self.browse(cr, uid, id, context=context)
37- if not default:
38- default = {}
39- default = default.copy()
40 default.update(
41 code=_("%s (copy)") % (journal['code'] or ''),
42 name=_("%s (copy)") % (journal['name'] or ''),
43@@ -1178,7 +1184,7 @@
44 'end_journal_period_id':fields.many2one('account.journal.period','End of Year Entries Journal', readonly=True),
45 }
46
47- def copy(self, cr, uid, id, default={}, context=None):
48+ def copy(self, cr, uid, id, default=None, context=None):
49 default.update({
50 'period_ids': [],
51 'end_journal_period_id': False
52@@ -1437,9 +1443,15 @@
53 result = super(account_move, self).create(cr, uid, vals, context)
54 return result
55
56- def copy(self, cr, uid, id, default={}, context=None):
57+ def copy(self, cr, uid, id, default=None, context=None):
58+ if context is None:
59+ default = {}
60+ else:
61+ default = default.copy()
62 if context is None:
63 context = {}
64+ else:
65+ context = context.copy()
66 default.update({
67 'state':'draft',
68 'name':'/',
69@@ -2269,7 +2281,10 @@
70 _defaults = {
71 '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'),
72 }
73- def generate(self, cr, uid, ids, datas={}, context=None):
74+
75+ def generate(self, cr, uid, ids, data=None, context=None):
76+ if data is None:
77+ data = {}
78 move_ids = []
79 entry = {}
80 account_move_obj = self.pool.get('account.move')
81@@ -2280,8 +2295,8 @@
82 if context is None:
83 context = {}
84
85- if datas.get('date', False):
86- context.update({'date': datas['date']})
87+ if data.get('date', False):
88+ context.update({'date': data['date']})
89
90 move_date = context.get('date', time.strftime('%Y-%m-%d'))
91 move_date = datetime.strptime(move_date,"%Y-%m-%d")
92@@ -2467,10 +2482,10 @@
93 all_moves = []
94 obj_model = self.pool.get('account.model')
95 for line in self.browse(cr, uid, ids, context=context):
96- datas = {
97+ data = {
98 'date': line.date,
99 }
100- move_ids = obj_model.generate(cr, uid, [line.subscription_id.model_id.id], datas, context)
101+ move_ids = obj_model.generate(cr, uid, [line.subscription_id.model_id.id], data, context)
102 tocheck[line.subscription_id.id] = True
103 self.write(cr, uid, [line.id], {'move_id':move_ids[0]})
104 all_moves.extend(move_ids)
105@@ -3236,7 +3251,7 @@
106 property_obj.create(cr, uid, vals, context=context)
107 return True
108
109- 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):
110+ 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):
111 '''
112 This function recursively loads the template objects and create the real objects from them.
113
114@@ -3254,6 +3269,12 @@
115 * a last identical containing the mapping of tax code templates and tax codes
116 :rtype: tuple(dict, dict, dict)
117 '''
118+ if acc_ref is None:
119+ acc_ref = {}
120+ if taxes_ref is None:
121+ taxes_ref = {}
122+ if tax_code_ref is None:
123+ tax_code_ref = {}
124 template = self.pool.get('account.chart.template').browse(cr, uid, template_id, context=context)
125 if template.parent_id:
126 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)
127@@ -3266,7 +3287,7 @@
128 tax_code_ref.update(tmp3)
129 return acc_ref, taxes_ref, tax_code_ref
130
131- 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):
132+ 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):
133 '''
134 This function generates all the objects from the templates
135
136@@ -3284,6 +3305,12 @@
137 * a last identical containing the mapping of tax code templates and tax codes
138 :rtype: tuple(dict, dict, dict)
139 '''
140+ if account_ref is None:
141+ account_ref = {}
142+ if taxes_ref is None:
143+ taxes_ref = {}
144+ if tax_code_ref is None:
145+ tax_code_ref = {}
146 template = self.pool.get('account.chart.template').browse(cr, uid, template_id, context=context)
147 obj_tax_code_template = self.pool.get('account.tax.code.template')
148 obj_acc_tax = self.pool.get('account.tax')
149
150=== modified file 'account/account_bank.py'
151--- account/account_bank.py 2012-09-13 11:46:09 +0000
152+++ account/account_bank.py 2012-10-02 11:29:53 +0000
153@@ -29,12 +29,12 @@
154 'currency_id': fields.related('journal_id', 'currency', type="many2one", relation='res.currency', readonly=True,
155 string="Currency", help="Currency of the related account journal."),
156 }
157- def create(self, cr, uid, data, context={}):
158+ def create(self, cr, uid, data, context=None):
159 result = super(bank, self).create(cr, uid, data, context=context)
160 self.post_write(cr, uid, [result], context=context)
161 return result
162
163- def write(self, cr, uid, ids, data, context={}):
164+ def write(self, cr, uid, ids, data, context=None):
165 result = super(bank, self).write(cr, uid, ids, data, context=context)
166 self.post_write(cr, uid, ids, context=context)
167 return result
168@@ -53,7 +53,7 @@
169 data['currency_name'] = data['currency_id'] and currency_name[data['currency_id'][0]] or ''
170 return super(bank, self)._prepare_name_get(cr, uid, bank_dicts, context=context)
171
172- def post_write(self, cr, uid, ids, context={}):
173+ def post_write(self, cr, uid, ids, context=None):
174 if isinstance(ids, (int, long)):
175 ids = [ids]
176
177
178=== modified file 'account/account_move_line.py'
179--- account/account_move_line.py 2012-09-29 12:34:49 +0000
180+++ account/account_move_line.py 2012-10-02 11:29:53 +0000
181@@ -1105,7 +1105,7 @@
182 'has been confirmed.') % res[2])
183 return res
184
185- def _remove_move_reconcile(self, cr, uid, move_ids=[], context=None):
186+ def _remove_move_reconcile(self, cr, uid, move_ids=None, context=None):
187 # Function remove move rencocile ids related with moves
188 obj_move_line = self.pool.get('account.move.line')
189 obj_move_rec = self.pool.get('account.move.reconcile')
190
191=== modified file 'account/project/wizard/account_analytic_chart.py'
192--- account/project/wizard/account_analytic_chart.py 2011-01-14 00:11:01 +0000
193+++ account/project/wizard/account_analytic_chart.py 2012-10-02 11:29:53 +0000
194@@ -47,4 +47,4 @@
195 return result
196
197 account_analytic_chart()
198-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
199\ No newline at end of file
200+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
201
202=== modified file 'account/project/wizard/account_analytic_inverted_balance_report.py'
203--- account/project/wizard/account_analytic_inverted_balance_report.py 2011-04-29 08:49:48 +0000
204+++ account/project/wizard/account_analytic_inverted_balance_report.py 2012-10-02 11:29:53 +0000
205@@ -52,4 +52,4 @@
206 }
207
208 account_analytic_inverted_balance()
209-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
210\ No newline at end of file
211+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
212
213=== modified file 'account/project/wizard/project_account_analytic_line.py'
214--- account/project/wizard/project_account_analytic_line.py 2011-05-02 12:16:02 +0000
215+++ account/project/wizard/project_account_analytic_line.py 2012-10-02 11:29:53 +0000
216@@ -55,4 +55,4 @@
217
218 project_account_analytic_line()
219
220-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
221\ No newline at end of file
222+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
223
224=== modified file 'account/report/account_balance.py'
225--- account/report/account_balance.py 2011-06-08 10:04:27 +0000
226+++ account/report/account_balance.py 2012-10-02 11:29:53 +0000
227@@ -68,7 +68,7 @@
228 return self.pool.get('account.account').browse(self.cr, self.uid, data['form']['id']).company_id.name
229 return super(account_balance ,self)._get_account(data)
230
231- def lines(self, form, ids=[], done=None):#, level=1):
232+ def lines(self, form, ids=None, done=None):
233 def _process_child(accounts, disp_acc, parent):
234 account_rec = [acct for acct in accounts if acct['id']==parent][0]
235 currency_obj = self.pool.get('res.currency')
236
237=== modified file 'account/report/account_central_journal.py'
238--- account/report/account_central_journal.py 2011-01-14 00:11:01 +0000
239+++ account/report/account_central_journal.py 2012-10-02 11:29:53 +0000
240@@ -105,4 +105,4 @@
241
242 report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/account_central_journal.rml', parser=journal_print, header='internal')
243
244-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
245\ No newline at end of file
246+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
247
248=== modified file 'account/report/account_general_journal.py'
249--- account/report/account_general_journal.py 2011-01-14 00:11:01 +0000
250+++ account/report/account_general_journal.py 2012-10-02 11:29:53 +0000
251@@ -158,4 +158,4 @@
252
253 report_sxw.report_sxw('report.account.general.journal', 'account.journal.period', 'addons/account/report/general_journal.rml', parser=journal_print, header='internal')
254
255-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
256\ No newline at end of file
257+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
258
259=== modified file 'account/report/account_report.py'
260--- account/report/account_report.py 2012-06-05 11:53:52 +0000
261+++ account/report/account_report.py 2012-10-02 11:29:53 +0000
262@@ -284,4 +284,4 @@
263 )""")
264 report_account_sales()
265
266-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
267\ No newline at end of file
268+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
269
270=== modified file 'account/report/account_tax_report.py'
271--- account/report/account_tax_report.py 2012-02-03 16:26:19 +0000
272+++ account/report/account_tax_report.py 2012-10-02 11:29:53 +0000
273@@ -160,7 +160,7 @@
274 i+=1
275 return res
276
277- def _get_codes(self, based_on, company_id, parent=False, level=0, period_list=[], context=None):
278+ def _get_codes(self, based_on, company_id, parent=False, level=0, period_list=None, context=None):
279 obj_tc = self.pool.get('account.tax.code')
280 ids = obj_tc.search(self.cr, self.uid, [('parent_id','=',parent),('company_id','=',company_id)], order='sequence', context=context)
281
282@@ -171,7 +171,11 @@
283 res += self._get_codes(based_on, company_id, code.id, level+1, context=context)
284 return res
285
286- def _add_codes(self, based_on, account_list=[], period_list=[], context=None):
287+ def _add_codes(self, based_on, account_list=None, period_list=None, context=None):
288+ if account_list is None:
289+ account_list = []
290+ if period_list is None:
291+ period_list = []
292 res = []
293 obj_tc = self.pool.get('account.tax.code')
294 for account in account_list:
295
296=== modified file 'account/res_currency.py'
297--- account/res_currency.py 2012-03-30 13:30:01 +0000
298+++ account/res_currency.py 2012-10-02 11:29:53 +0000
299@@ -45,4 +45,3 @@
300 res_currency_account()
301
302 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
303-
304
305=== modified file 'account/wizard/account_invoice_state.py'
306--- account/wizard/account_invoice_state.py 2012-08-06 15:44:10 +0000
307+++ account/wizard/account_invoice_state.py 2012-10-02 11:29:53 +0000
308@@ -71,4 +71,4 @@
309
310 account_invoice_cancel()
311
312-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
313\ No newline at end of file
314+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
315
316=== modified file 'account/wizard/account_journal_select.py'
317--- account/wizard/account_journal_select.py 2011-01-14 00:11:01 +0000
318+++ account/wizard/account_journal_select.py 2012-10-02 11:29:53 +0000
319@@ -47,4 +47,4 @@
320
321 account_journal_select()
322
323-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
324\ No newline at end of file
325+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
326
327=== modified file 'account/wizard/account_move_bank_reconcile.py'
328--- account/wizard/account_move_bank_reconcile.py 2012-07-25 07:33:57 +0000
329+++ account/wizard/account_move_bank_reconcile.py 2012-10-02 11:29:53 +0000
330@@ -61,4 +61,4 @@
331
332 account_move_bank_reconcile()
333
334-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
335\ No newline at end of file
336+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
337
338=== modified file 'account/wizard/account_move_journal.py'
339--- account/wizard/account_move_journal.py 2012-09-18 13:27:27 +0000
340+++ account/wizard/account_move_journal.py 2012-10-02 11:29:53 +0000
341@@ -38,7 +38,7 @@
342 _defaults = {
343 'target_move': 'all'
344 }
345- def _get_period(self, cr, uid, context={}):
346+ def _get_period(self, cr, uid, context=None):
347 """
348 Return default account period value
349 """
350
351=== modified file 'account/wizard/account_move_line_reconcile_select.py'
352--- account/wizard/account_move_line_reconcile_select.py 2011-02-15 12:13:39 +0000
353+++ account/wizard/account_move_line_reconcile_select.py 2012-10-02 11:29:53 +0000
354@@ -52,4 +52,4 @@
355
356 account_move_line_reconcile_select()
357
358-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
359\ No newline at end of file
360+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
361
362=== modified file 'account/wizard/account_move_line_select.py'
363--- account/wizard/account_move_line_select.py 2011-01-14 00:11:01 +0000
364+++ account/wizard/account_move_line_select.py 2012-10-02 11:29:53 +0000
365@@ -69,4 +69,4 @@
366
367 account_move_line_select()
368
369-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
370\ No newline at end of file
371+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
372
373=== modified file 'account/wizard/account_move_line_unreconcile_select.py'
374--- account/wizard/account_move_line_unreconcile_select.py 2011-02-15 12:13:39 +0000
375+++ account/wizard/account_move_line_unreconcile_select.py 2012-10-02 11:29:53 +0000
376@@ -41,4 +41,4 @@
377
378 account_move_line_unreconcile_select()
379
380-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
381\ No newline at end of file
382+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
383
384=== modified file 'account/wizard/account_reconcile.py'
385--- account/wizard/account_reconcile.py 2012-09-29 09:14:16 +0000
386+++ account/wizard/account_reconcile.py 2012-10-02 11:29:53 +0000
387@@ -160,4 +160,4 @@
388
389 account_move_line_reconcile_writeoff()
390
391-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
392\ No newline at end of file
393+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
394
395=== modified file 'account/wizard/account_state_open.py'
396--- account/wizard/account_state_open.py 2012-07-25 07:33:57 +0000
397+++ account/wizard/account_state_open.py 2012-10-02 11:29:53 +0000
398@@ -41,4 +41,4 @@
399
400 account_state_open()
401
402-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
403\ No newline at end of file
404+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
405
406=== modified file 'account/wizard/account_subscription_generate.py'
407--- account/wizard/account_subscription_generate.py 2012-06-25 13:33:53 +0000
408+++ account/wizard/account_subscription_generate.py 2012-10-02 11:29:53 +0000
409@@ -50,4 +50,4 @@
410
411 account_subscription_generate()
412
413-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
414\ No newline at end of file
415+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
416
417=== modified file 'account/wizard/account_unreconcile.py'
418--- account/wizard/account_unreconcile.py 2011-01-14 00:11:01 +0000
419+++ account/wizard/account_unreconcile.py 2012-10-02 11:29:53 +0000
420@@ -50,4 +50,4 @@
421
422 account_unreconcile_reconcile()
423
424-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
425\ No newline at end of file
426+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
427
428=== modified file 'account_analytic_plans/report/crossovered_analytic.py'
429--- account_analytic_plans/report/crossovered_analytic.py 2012-06-13 09:13:22 +0000
430+++ account_analytic_plans/report/crossovered_analytic.py 2012-10-02 11:29:53 +0000
431@@ -34,7 +34,7 @@
432 })
433 self.base_amount = 0.00
434
435- def find_children(self,ref_ids):
436+ def find_children(self, ref_ids):
437 to_return_ids = []
438 final_list = []
439 parent_list = []
440@@ -53,7 +53,7 @@
441 final_list.extend(set_list)
442 return final_list #to_return_ids[0]
443
444- def set_account(self,cats):
445+ def set_account(self, cats):
446 lst = []
447 category = self.pool.get('account.analytic.account').read(self.cr, self.uid, cats)
448 for cat in category:
449@@ -62,7 +62,7 @@
450 lst.extend(self.set_account(cat['child_ids']))
451 return lst
452
453- def _ref_lines(self,form):
454+ def _ref_lines(self, form):
455 result = []
456 res = {}
457 acc_pool = self.pool.get('account.analytic.account')
458@@ -112,7 +112,9 @@
459 result.append(res)
460 return result
461
462- def _lines(self, form, ids={}):
463+ def _lines(self, form, ids=None):
464+ if ids is None:
465+ ids = {}
466 if not ids:
467 ids = self.ids
468
469
470=== modified file 'account_anglo_saxon/__init__.py'
471--- account_anglo_saxon/__init__.py 2011-01-14 00:11:01 +0000
472+++ account_anglo_saxon/__init__.py 2012-10-02 11:29:53 +0000
473@@ -23,4 +23,4 @@
474 import purchase
475 import invoice
476
477-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
478\ No newline at end of file
479+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
480
481=== removed file 'account_anglo_saxon/sale.py'
482--- account_anglo_saxon/sale.py 2011-01-14 00:11:01 +0000
483+++ account_anglo_saxon/sale.py 1970-01-01 00:00:00 +0000
484@@ -1,43 +0,0 @@
485-# -*- encoding: utf-8 -*-
486-##############################################################################
487-#
488-# OpenERP, Open Source Management Solution
489-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
490-#
491-# This program is free software: you can redistribute it and/or modify
492-# it under the terms of the GNU Affero General Public License as
493-# published by the Free Software Foundation, either version 3 of the
494-# License, or (at your option) any later version.
495-#
496-# This program is distributed in the hope that it will be useful,
497-# but WITHOUT ANY WARRANTY; without even the implied warranty of
498-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
499-# GNU Affero General Public License for more details.
500-#
501-# You should have received a copy of the GNU Affero General Public License
502-# along with this program. If not, see <http://www.gnu.org/licenses/>.
503-#
504-##############################################################################
505-
506-from osv import fields, osv
507-
508-#class sale_order_line(osv.osv):
509-# _name = 'sale.order.line'
510-# _description = 'Sale Order line'
511-# _inherit = 'sale.order.line'
512-#
513-# def invoice_line_create(self, cr, uid, ids, context={}):
514-# line_ids = super('sale_order_line',self).invoice_line_create(cr, uid, ids, context)
515-# invoice_line_obj = self.pool.get('account.invoice.line')
516-# for line in invoice_line_obj.browse(cr, uid, line_ids):
517-# if line.product_id:
518-# a = line.product_id.product_tmpl_id.property_stock_account_output and line.product_id.product_tmpl_id.property_stock_account_output.id
519-# if not a:
520-# a = line.product_id.categ_id.property_stock_account_output_categ and line.product_id.categ_id.property_stock_account_output_categ.id
521-# if a:
522-# a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, a)
523-# invoice_line_obj.write(cr, uid, line.id, {'account_id':a})
524-#
525-#sale_order_line()
526-
527-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
528
529=== modified file 'account_asset/account_asset.py'
530--- account_asset/account_asset.py 2012-09-29 13:21:28 +0000
531+++ account_asset/account_asset.py 2012-10-02 11:29:53 +0000
532@@ -75,7 +75,7 @@
533 _name = 'account.asset.asset'
534 _description = 'Asset'
535
536- def _get_period(self, cr, uid, context={}):
537+ def _get_period(self, cr, uid, context=None):
538 periods = self.pool.get('account.period').find(cr, uid)
539 if periods:
540 return periods[0]
541@@ -176,7 +176,9 @@
542 year = depreciation_date.year
543 return True
544
545- def validate(self, cr, uid, ids, context={}):
546+ def validate(self, cr, uid, ids, context=None):
547+ if context is None:
548+ context = {}
549 return self.write(cr, uid, ids, {
550 'state':'open'
551 }, context)
552@@ -304,7 +306,7 @@
553 default.update({'depreciation_line_ids': [], 'state': 'draft'})
554 return super(account_asset_asset, self).copy(cr, uid, id, default, context=context)
555
556- def _compute_entries(self, cr, uid, ids, period_id, context={}):
557+ def _compute_entries(self, cr, uid, ids, period_id, context=None):
558 result = []
559 period_obj = self.pool.get('account.period')
560 depreciation_obj = self.pool.get('account.asset.depreciation.line')
561
562=== modified file 'account_budget/report/analytic_account_budget_report.py'
563--- account_budget/report/analytic_account_budget_report.py 2011-01-14 00:11:01 +0000
564+++ account_budget/report/analytic_account_budget_report.py 2012-10-02 11:29:53 +0000
565@@ -35,7 +35,9 @@
566 })
567 self.context = context
568
569- def funct(self, object, form, ids={}, done=None, level=1):
570+ def funct(self, object, form, ids=None, done=None, level=1):
571+ if ids is None:
572+ ids = {}
573 if not ids:
574 ids = self.ids
575 if not done:
576@@ -153,7 +155,7 @@
577 tot['perc'] = float(tot['prac'] / tot['theo']) * 100
578 return result
579
580- def funct_total(self,form):
581+ def funct_total(self, form):
582 result = []
583 res = {}
584 res = {
585@@ -167,4 +169,4 @@
586
587 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')
588
589-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
590\ No newline at end of file
591+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
592
593=== modified file 'account_budget/report/budget_report.py'
594--- account_budget/report/budget_report.py 2011-04-15 06:09:42 +0000
595+++ account_budget/report/budget_report.py 2012-10-02 11:29:53 +0000
596@@ -34,7 +34,9 @@
597 })
598 self.context = context
599
600- def funct(self, object, form, ids={}, done=None, level=1):
601+ def funct(self, object, form, ids=None, done=None, level=1):
602+ if ids is None:
603+ ids = {}
604 if not ids:
605 ids = self.ids
606 if not done:
607
608=== modified file 'account_budget/report/crossovered_budget_report.py'
609--- account_budget/report/crossovered_budget_report.py 2011-04-15 06:09:42 +0000
610+++ account_budget/report/crossovered_budget_report.py 2012-10-02 11:29:53 +0000
611@@ -37,7 +37,9 @@
612 })
613 self.context = context
614
615- def funct(self, object, form, ids={}, done=None, level=1):
616+ def funct(self, object, form, ids=None, done=None, level=1):
617+ if ids is None:
618+ ids = {}
619 if not ids:
620 ids = self.ids
621 if not done:
622
623=== modified file 'account_budget/wizard/account_budget_analytic.py'
624--- account_budget/wizard/account_budget_analytic.py 2011-04-29 08:49:48 +0000
625+++ account_budget/wizard/account_budget_analytic.py 2012-10-02 11:29:53 +0000
626@@ -52,4 +52,4 @@
627
628 account_budget_analytic()
629
630-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
631\ No newline at end of file
632+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
633
634=== modified file 'account_budget/wizard/account_budget_crossovered_report.py'
635--- account_budget/wizard/account_budget_crossovered_report.py 2011-04-29 08:49:48 +0000
636+++ account_budget/wizard/account_budget_crossovered_report.py 2012-10-02 11:29:53 +0000
637@@ -53,4 +53,4 @@
638
639 account_budget_crossvered_report()
640
641-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
642\ No newline at end of file
643+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
644
645=== modified file 'account_budget/wizard/account_budget_report.py'
646--- account_budget/wizard/account_budget_report.py 2011-04-29 08:49:48 +0000
647+++ account_budget/wizard/account_budget_report.py 2012-10-02 11:29:53 +0000
648@@ -54,4 +54,4 @@
649
650 account_budget_report()
651
652-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
653\ No newline at end of file
654+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
655
656=== modified file 'account_followup/__init__.py'
657--- account_followup/__init__.py 2012-09-17 15:10:31 +0000
658+++ account_followup/__init__.py 2012-10-02 11:29:53 +0000
659@@ -23,4 +23,4 @@
660 import wizard
661 import report
662
663-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
664\ No newline at end of file
665+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
666
667=== modified file 'account_followup/wizard/__init__.py'
668--- account_followup/wizard/__init__.py 2011-01-14 00:11:01 +0000
669+++ account_followup/wizard/__init__.py 2012-10-02 11:29:53 +0000
670@@ -21,4 +21,4 @@
671
672 import account_followup_print
673
674-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
675\ No newline at end of file
676+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
677
678=== modified file 'account_followup/wizard/account_followup_print.py'
679--- account_followup/wizard/account_followup_print.py 2012-09-05 15:14:51 +0000
680+++ account_followup/wizard/account_followup_print.py 2012-10-02 11:29:53 +0000
681@@ -209,7 +209,7 @@
682 to_update[str(id)]= {'level': fups[followup_line_id][1], 'partner_id': stat_line_id}
683 return {'partner_ids': partner_list, 'to_update': to_update}
684
685- def do_mail(self ,cr, uid, ids, context=None):
686+ def do_mail(self, cr, uid, ids, context=None):
687 mod_obj = self.pool.get('ir.model.data')
688 move_obj = self.pool.get('account.move.line')
689 user_obj = self.pool.get('res.users')
690
691=== modified file 'account_payment/__init__.py'
692--- account_payment/__init__.py 2011-01-14 00:11:01 +0000
693+++ account_payment/__init__.py 2012-10-02 11:29:53 +0000
694@@ -29,4 +29,4 @@
695 import account_invoice
696 import report
697
698-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
699\ No newline at end of file
700+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
701
702=== modified file 'account_payment/account_invoice.py'
703--- account_payment/account_invoice.py 2011-07-01 23:41:24 +0000
704+++ account_payment/account_invoice.py 2012-10-02 11:29:53 +0000
705@@ -50,4 +50,4 @@
706
707 Invoice()
708
709-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
710\ No newline at end of file
711+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
712
713=== modified file 'account_payment/account_move_line.py'
714--- account_payment/account_move_line.py 2012-08-07 11:31:37 +0000
715+++ account_payment/account_move_line.py 2012-10-02 11:29:53 +0000
716@@ -26,7 +26,7 @@
717 class account_move_line(osv.osv):
718 _inherit = "account.move.line"
719
720- def amount_to_pay(self, cr, uid, ids, name, arg={}, context=None):
721+ def amount_to_pay(self, cr, uid, ids, name, arg=None, context=None):
722 """ Return the amount still to pay regarding all the payemnt orders
723 (excepting cancelled orders)"""
724 if not ids:
725@@ -117,4 +117,4 @@
726
727 account_move_line()
728
729-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
730\ No newline at end of file
731+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
732
733=== modified file 'account_payment/account_payment.py'
734--- account_payment/account_payment.py 2012-07-25 11:39:00 +0000
735+++ account_payment/account_payment.py 2012-10-02 11:29:53 +0000
736@@ -139,7 +139,9 @@
737 wf_service.trg_validate(uid, 'payment.order', ids[0], 'done', cr)
738 return True
739
740- def copy(self, cr, uid, id, default={}, context=None):
741+ def copy(self, cr, uid, id, default=None, context=None):
742+ if default is None:
743+ default = {}
744 default.update({
745 'state': 'draft',
746 'line_ids': [],
747
748=== modified file 'account_payment/report/__init__.py'
749--- account_payment/report/__init__.py 2011-01-14 00:11:01 +0000
750+++ account_payment/report/__init__.py 2012-10-02 11:29:53 +0000
751@@ -20,4 +20,4 @@
752 ##############################################################################
753
754 import payment_order
755-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
756\ No newline at end of file
757+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
758
759=== modified file 'account_payment/report/payment_order.py'
760--- account_payment/report/payment_order.py 2011-01-14 00:11:01 +0000
761+++ account_payment/report/payment_order.py 2012-10-02 11:29:53 +0000
762@@ -77,7 +77,7 @@
763 user = pool.get('res.users').browse(self.cr, self.uid, self.uid)
764 return user.company_id and user.company_id.currency_id and user.company_id.currency_id.symbol or False
765
766- def _get_account_name(self,bank_id):
767+ def _get_account_name(self, bank_id):
768 if bank_id:
769 pool = pooler.get_pool(self.cr.dbname)
770 value_name = pool.get('res.partner.bank').name_get(self.cr, self.uid, [bank_id])
771@@ -87,4 +87,4 @@
772
773 report_sxw.report_sxw('report.payment.order', 'payment.order', 'addons/account_payment/report/payment_order.rml', parser=payment_order, header="external")
774
775-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
776\ No newline at end of file
777+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
778
779=== modified file 'account_payment/wizard/__init__.py'
780--- account_payment/wizard/__init__.py 2011-01-14 00:11:01 +0000
781+++ account_payment/wizard/__init__.py 2012-10-02 11:29:53 +0000
782@@ -23,4 +23,4 @@
783 import account_payment_populate_statement
784 import account_payment_pay
785
786-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
787\ No newline at end of file
788+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
789
790=== modified file 'account_payment/wizard/account_payment_pay.py'
791--- account_payment/wizard/account_payment_pay.py 2012-01-31 13:36:57 +0000
792+++ account_payment/wizard/account_payment_pay.py 2012-10-02 11:29:53 +0000
793@@ -56,4 +56,4 @@
794
795 account_payment_make_payment()
796
797-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
798\ No newline at end of file
799+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
800
801=== modified file 'account_payment/wizard/account_payment_populate_statement.py'
802--- account_payment/wizard/account_payment_populate_statement.py 2012-01-31 13:36:57 +0000
803+++ account_payment/wizard/account_payment_populate_statement.py 2012-10-02 11:29:53 +0000
804@@ -120,4 +120,4 @@
805
806 account_payment_populate_statement()
807
808-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
809\ No newline at end of file
810+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
811
812=== modified file 'account_sequence/__init__.py'
813--- account_sequence/__init__.py 2011-01-14 00:11:01 +0000
814+++ account_sequence/__init__.py 2012-10-02 11:29:53 +0000
815@@ -22,4 +22,4 @@
816 import account_sequence
817 import account_sequence_installer
818
819-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
820\ No newline at end of file
821+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
822
823=== modified file 'account_voucher/__init__.py'
824--- account_voucher/__init__.py 2011-10-16 01:28:00 +0000
825+++ account_voucher/__init__.py 2012-10-02 11:29:53 +0000
826@@ -24,4 +24,4 @@
827 import report
828 import wizard
829
830-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
831\ No newline at end of file
832+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
833
834=== modified file 'account_voucher/account_voucher.py'
835--- account_voucher/account_voucher.py 2012-09-30 11:20:34 +0000
836+++ account_voucher/account_voucher.py 2012-10-02 11:29:53 +0000
837@@ -849,7 +849,7 @@
838 res['account_id'] = account_id
839 return {'value':res}
840
841- def _sel_context(self, cr, uid, voucher_id,context=None):
842+ def _sel_context(self, cr, uid, voucher_id, context=None):
843 """
844 Select the context to use accordingly if it needs to be multicurrency or not.
845
846@@ -1275,7 +1275,9 @@
847 self.reconcile_send_note(cr, uid, [voucher.id], context=context)
848 return True
849
850- def copy(self, cr, uid, id, default={}, context=None):
851+ def copy(self, cr, uid, id, default=None, context=None):
852+ if default is None:
853+ default = {}
854 default.update({
855 'state': 'draft',
856 'number': False,
857
858=== modified file 'account_voucher/report/__init__.py'
859--- account_voucher/report/__init__.py 2011-01-14 00:11:01 +0000
860+++ account_voucher/report/__init__.py 2012-10-02 11:29:53 +0000
861@@ -23,4 +23,4 @@
862 import account_voucher_print
863 import account_voucher_sales_receipt
864
865-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
866\ No newline at end of file
867+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
868
869=== modified file 'anonymization/anonymization.py'
870--- anonymization/anonymization.py 2012-09-20 09:08:13 +0000
871+++ anonymization/anonymization.py 2012-10-02 11:29:53 +0000
872@@ -363,7 +363,7 @@
873 })
874 raise osv.except_osv(error_type, error_msg)
875
876- def anonymize_database(self,cr, uid, ids, context=None):
877+ def anonymize_database(self, cr, uid, ids, context=None):
878 """Sets the 'anonymized' state to defined fields"""
879
880 # create a new history record:
881@@ -498,7 +498,7 @@
882 'target':'new',
883 }
884
885- def reverse_anonymize_database(self,cr, uid, ids, context=None):
886+ def reverse_anonymize_database(self, cr, uid, ids, context=None):
887 """Set the 'clear' state to defined fields"""
888
889 ir_model_fields_anonymization_model = self.pool.get('ir.model.fields.anonymization')
890
891=== modified file 'audittrail/audittrail.py'
892--- audittrail/audittrail.py 2012-09-30 12:53:37 +0000
893+++ audittrail/audittrail.py 2012-10-02 11:29:53 +0000
894@@ -202,7 +202,7 @@
895 res = value
896 return res
897
898- def create_log_line(self, cr, uid, log_id, model, lines=[]):
899+ def create_log_line(self, cr, uid, log_id, model, lines=None):
900 """
901 Creates lines for changed fields with its old and new values
902
903@@ -211,6 +211,8 @@
904 @param model: Object which values are being changed
905 @param lines: List of values for line is to be created
906 """
907+ if lines is None:
908+ lines = []
909 pool = pooler.get_pool(cr.dbname)
910 obj_pool = pool.get(model.model)
911 model_pool = pool.get('ir.model')
912@@ -349,9 +351,9 @@
913 data[(model.id, resource_id)] = {'text':values_text, 'value': values}
914 return data
915
916- def prepare_audittrail_log_line(self, cr, uid, pool, model, resource_id, method, old_values, new_values, field_list=[]):
917+ def prepare_audittrail_log_line(self, cr, uid, pool, model, resource_id, method, old_values, new_values, field_list=None):
918 """
919- This function compares the old data (i.e before the method was executed) and the new data
920+ This function compares the old data (i.e before the method was executed) and the new data
921 (after the method was executed) and returns a structure with all the needed information to
922 log those differences.
923
924@@ -375,9 +377,11 @@
925 (model.id, resource_id): []
926 }
927
928- The reason why the structure returned is build as above is because when modifying an existing
929+ The reason why the structure returned is build as above is because when modifying an existing
930 record, we may have to log a change done in a x2many field of that object
931 """
932+ if field_list is None:
933+ field_list = []
934 key = (model.id, resource_id)
935 lines = {
936 key: []
937@@ -416,7 +420,7 @@
938 lines[key].append(data)
939 return lines
940
941- def process_data(self, cr, uid, pool, res_ids, model, method, old_values={}, new_values={}, field_list=[]):
942+ def process_data(self, cr, uid, pool, res_ids, model, method, old_values=None, new_values=None, field_list=None):
943 """
944 This function processes and iterates recursively to log the difference between the old
945 data (i.e before the method was executed) and the new data and creates audittrail log
946@@ -435,6 +439,8 @@
947 on specific fields only.
948 :return: True
949 """
950+ if field_list is None:
951+ field_list = []
952 # loop on all the given ids
953 for res_id in res_ids:
954 # compare old and new values and get audittrail log lines accordingly
955
956=== modified file 'base_crypt/crypt.py'
957--- base_crypt/crypt.py 2012-08-10 14:12:19 +0000
958+++ base_crypt/crypt.py 2012-10-02 11:29:53 +0000
959@@ -47,7 +47,9 @@
960 magic_md5 = '$1$'
961 _logger = logging.getLogger(__name__)
962
963-def gen_salt( length=8, symbols=ascii_letters + digits ):
964+def gen_salt( length=8, symbols=None):
965+ if symbols is None:
966+ symbols = ascii_letters + digits
967 seed()
968 return ''.join( sample( symbols, length ) )
969
970
971=== modified file 'base_module_doc_rst/report/ir_module_reference_print_graph.py'
972--- base_module_doc_rst/report/ir_module_reference_print_graph.py 2011-01-14 00:11:01 +0000
973+++ base_module_doc_rst/report/ir_module_reference_print_graph.py 2012-10-02 11:29:53 +0000
974@@ -79,4 +79,4 @@
975 'addons/base_module_doc_rst/report/ir_module_reference_graph.rml',
976 parser=ir_module_reference_print_graph, header=False)
977
978-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
979\ No newline at end of file
980+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
981
982=== modified file 'base_module_record/wizard/base_module_record_objects.py'
983--- base_module_record/wizard/base_module_record_objects.py 2012-03-07 06:01:32 +0000
984+++ base_module_record/wizard/base_module_record_objects.py 2012-10-02 11:29:53 +0000
985@@ -127,7 +127,7 @@
986 _name = 'base.module.record.objects'
987 _description = "Base Module Record Objects"
988
989- def inter_call(self,cr,uid,data,context=None):
990+ def inter_call(self, cr, uid, data, context=None):
991 res=base_module_save._create_module(self, cr, uid, data, context)
992 mod_obj = self.pool.get('ir.model.data')
993 model_data_ids = mod_obj.search(cr, uid,[('model', '=', 'ir.ui.view'), ('name', '=', 'module_create_form_view')], context=context)
994
995=== modified file 'base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py'
996--- base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py 2012-08-06 16:28:17 +0000
997+++ base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py 2012-10-02 11:29:53 +0000
998@@ -42,11 +42,11 @@
999
1000 class DomApiGeneral:
1001 """General DOM API utilities."""
1002- def __init__(self,content_string="",file=""):
1003+ def __init__(self, content_string="", file=""):
1004 self.content_string = content_string
1005 self.re_digits = re.compile(r"(.*?\d)(pt|cm|mm|inch|in)")
1006
1007- def _unitTuple(self,string):
1008+ def _unitTuple(self, string):
1009 """Split values and units to a tuple."""
1010 temp = self.re_digits.findall(string)
1011 if not temp:
1012@@ -54,13 +54,15 @@
1013 else:
1014 return (temp[0])
1015
1016- def stringPercentToFloat(self,string):
1017+ def stringPercentToFloat(self, string):
1018 temp = string.replace("""%""","")
1019 return float(temp)/100
1020
1021- def findChildrenByName(self,parent,name,attr_dict={}):
1022+ def findChildrenByName(self, parent, name, attr_dict=None):
1023 """Helper functions. Does not work recursively.
1024 Optional: also test for certain attribute/value pairs."""
1025+ if attr_dict is None:
1026+ attr_dict = {}
1027 children = []
1028 for c in parent.childNodes:
1029 if c.nodeType == c.ELEMENT_NODE and c.nodeName == name:
1030@@ -70,7 +72,7 @@
1031 else:
1032 return self._selectForAttributes(nodelist=children,attr_dict=attr_dict)
1033
1034- def _selectForAttributes(self,nodelist,attr_dict):
1035+ def _selectForAttributes(self, nodelist, attr_dict):
1036 "Helper function."""
1037 selected_nodes = []
1038 for n in nodelist:
1039@@ -83,7 +85,7 @@
1040 selected_nodes.append(n)
1041 return selected_nodes
1042
1043- def _stringToTuple(self,s):
1044+ def _stringToTuple(self, s):
1045 """Helper function."""
1046 try:
1047 temp = string.split(s,",")
1048@@ -91,13 +93,13 @@
1049 except:
1050 return None
1051
1052- def _tupleToString(self,t):
1053+ def _tupleToString(self, t):
1054 try:
1055 return self.openOfficeStringUtf8("%s,%s" % (t[0],t[1]))
1056 except:
1057 return None
1058
1059- def _lengthToFloat(self,value):
1060+ def _lengthToFloat(self, value):
1061 v = value
1062 if not self.re_digits.search(v):
1063 return v
1064@@ -113,7 +115,7 @@
1065 except:
1066 return v
1067
1068- def openOfficeStringUtf8(self,string):
1069+ def openOfficeStringUtf8(self, string):
1070 if type(string) == unicode:
1071 return string.encode("utf-8")
1072 tempstring = unicode(string,"cp1252").encode("utf-8")
1073@@ -121,7 +123,7 @@
1074
1075 class DomApi(DomApiGeneral):
1076 """This class provides a DOM-API for XML-Files from an SXW-Archive."""
1077- def __init__(self,xml_content,xml_styles):
1078+ def __init__(self, xml_content, xml_styles):
1079 DomApiGeneral.__init__(self)
1080 self.content_dom = xml.dom.minidom.parseString(xml_content)
1081 self.styles_dom = xml.dom.minidom.parseString(xml_styles)
1082@@ -145,7 +147,7 @@
1083 for s in self.style_dict.keys():
1084 self.style_properties_dict[s] = self.getStylePropertiesDict(s)
1085
1086- def updateWithPercents(self,dict,updatedict):
1087+ def updateWithPercents(self, dict, updatedict):
1088 """Sometimes you find values like "115%" in the style hierarchy."""
1089 if not updatedict:
1090 # no style hierarchies for this style? =>
1091@@ -244,7 +246,7 @@
1092 def toxml(self):
1093 return self.content_dom.toxml(encoding="utf-8")
1094
1095- def getStylePropertiesDict(self,style_name):
1096+ def getStylePropertiesDict(self, style_name):
1097 res = {}
1098
1099 if self.style_dict[style_name].hasAttribute("style:parent-style-name"):
1100@@ -265,7 +267,7 @@
1101 self.save_pict = save_pict
1102 self.images = {}
1103
1104- def oo_read(self,fname):
1105+ def oo_read(self, fname):
1106 z = zipfile.ZipFile(fname,"r")
1107 content = z.read('content.xml')
1108 style = z.read('styles.xml')
1109@@ -281,7 +283,7 @@
1110 z.close()
1111 return content,style
1112
1113- def oo_replace(self,content):
1114+ def oo_replace(self, content):
1115 regex = [
1116 (r"<para[^>]*/>", ""),
1117 (r"<para(.*)>(.*?)<text:line-break[^>]*/>", "<para$1>$2</para><para$1>"),
1118@@ -290,7 +292,7 @@
1119 content = re.sub(key, val, content)
1120 return content
1121
1122- def unpackNormalize(self,sourcefile):
1123+ def unpackNormalize(self, sourcefile):
1124 c,s = self.oo_read(sourcefile)
1125 c = self.oo_replace(c)
1126 dom = DomApi(c,s)
1127
1128=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/About.py'
1129--- base_report_designer/plugin/openerp_report_designer/bin/script/About.py 2011-12-19 16:54:40 +0000
1130+++ base_report_designer/plugin/openerp_report_designer/bin/script/About.py 2012-10-02 11:29:53 +0000
1131@@ -52,7 +52,7 @@
1132 from lib.gui import *
1133
1134 class About(unohelper.Base, XJobExecutor):
1135- def __init__(self,ctx):
1136+ def __init__(self, ctx):
1137 self.ctx = ctx
1138 self.module = "openerp_report"
1139 self.version = "0.1"
1140
1141=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/AddAttachment.py'
1142--- base_report_designer/plugin/openerp_report_designer/bin/script/AddAttachment.py 2012-08-06 16:28:17 +0000
1143+++ base_report_designer/plugin/openerp_report_designer/bin/script/AddAttachment.py 2012-10-02 11:29:53 +0000
1144@@ -64,7 +64,7 @@
1145 'PDF' : 'pdf',
1146 'OpenOffice': 'sxw',
1147 }
1148- def __init__(self,ctx):
1149+ def __init__(self, ctx):
1150 self.ctx = ctx
1151 self.module = "openerp_report"
1152 self.version = "0.1"
1153@@ -132,7 +132,7 @@
1154 self.win.addButton('btnCancel', -2 - 27 , -5 , 30 , 15, 'Cancel' ,actionListenerProc = self.btnCancel_clicked )
1155 self.win.doModalDialog("lstResourceType", self.Kind.keys()[0])
1156
1157- def btnSearch_clicked( self, oActionEvent ):
1158+ def btnSearch_clicked(self, oActionEvent):
1159 modelSelectedItem = self.win.getListBoxSelectedItem("lstmodel")
1160 if modelSelectedItem == "":
1161 return
1162@@ -151,7 +151,7 @@
1163 for result in self.aSearchResult:
1164 self.lstResource.addItem(result[1],result[0])
1165
1166- def _send_attachment( self, name, data, res_model, res_id ):
1167+ def _send_attachment(self, name, data, res_model, res_id):
1168 desktop = getDesktop()
1169 oDoc2 = desktop.getCurrentComponent()
1170 docinfo = oDoc2.getDocumentInfo()
1171@@ -166,7 +166,7 @@
1172
1173 return self.sock.execute( database, uid, self.password, 'ir.attachment', 'create', params )
1174
1175- def send_attachment( self, model, resource_id ):
1176+ def send_attachment(self, model, resource_id):
1177 desktop = getDesktop()
1178 oDoc2 = desktop.getCurrentComponent()
1179 docinfo = oDoc2.getDocumentInfo()
1180@@ -187,7 +187,7 @@
1181 data = read_data_from_file( get_absolute_file_path( url ) )
1182 return self._send_attachment( os.path.basename( url ), data, model, resource_id )
1183
1184- def btnOkWithoutInformation_clicked( self, oActionEvent ):
1185+ def btnOkWithoutInformation_clicked(self, oActionEvent):
1186 desktop = getDesktop()
1187 oDoc2 = desktop.getCurrentComponent()
1188 docinfo = oDoc2.getDocumentInfo()
1189@@ -199,7 +199,7 @@
1190 res = self.send_attachment( docinfo.getUserFieldValue(3), docinfo.getUserFieldValue(2) )
1191 self.win.endExecute()
1192
1193- def btnOkWithInformation_clicked(self,oActionEvent):
1194+ def btnOkWithInformation_clicked(self, oActionEvent):
1195 if self.win.getListBoxSelectedItem("lstResourceType") == "":
1196 ErrorDialog( "You have to select a resource type.", "", "Selection Error." )
1197 return
1198@@ -221,7 +221,7 @@
1199 res = self.send_attachment( self.dModel[self.win.getListBoxSelectedItem('lstmodel')], resourceid )
1200 self.win.endExecute()
1201
1202- def btnCancel_clicked( self, oActionEvent ):
1203+ def btnCancel_clicked(self, oActionEvent):
1204 self.win.endExecute()
1205
1206 def doc2pdf(self, strFile):
1207@@ -262,7 +262,7 @@
1208 # Can be None if len(strFilterSubName) <= 0
1209 return filename
1210
1211- def _MakePropertyValue(self, cName = "", uValue = u"" ):
1212+ def _MakePropertyValue(self, cName="", uValue=u""):
1213 oPropertyValue = createUnoStruct( "com.sun.star.beans.PropertyValue" )
1214 if cName:
1215 oPropertyValue.Name = cName
1216
1217=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/Change.py'
1218--- base_report_designer/plugin/openerp_report_designer/bin/script/Change.py 2012-07-25 11:55:11 +0000
1219+++ base_report_designer/plugin/openerp_report_designer/bin/script/Change.py 2012-10-02 11:29:53 +0000
1220@@ -59,7 +59,7 @@
1221 database="test"
1222
1223 class Change( unohelper.Base, XJobExecutor ):
1224- def __init__(self,ctx):
1225+ def __init__(self, ctx):
1226 self.ctx = ctx
1227 self.module = "openerp_report"
1228 self.version = "0.1"
1229@@ -107,7 +107,7 @@
1230 self.lstProtocol.addItem(i,self.lstProtocol.getItemCount() )
1231 self.win.doModalDialog( "lstProtocol", protocol)
1232
1233- def btnNext_clicked(self,oActionEvent):
1234+ def btnNext_clicked(self, oActionEvent):
1235 global url
1236 aVal=''
1237 #aVal= Fetature used
1238
1239=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/ConvertBracesToField.py'
1240--- base_report_designer/plugin/openerp_report_designer/bin/script/ConvertBracesToField.py 2011-12-19 16:54:40 +0000
1241+++ base_report_designer/plugin/openerp_report_designer/bin/script/ConvertBracesToField.py 2012-10-02 11:29:53 +0000
1242@@ -3,31 +3,31 @@
1243 # Portions of this file are under the following copyright and license:
1244 #
1245 #
1246-# Copyright (c) 2003-2004 Danny Brewer
1247-# d29583@groovegarden.com
1248-#
1249-# This library is free software; you can redistribute it and/or
1250-# modify it under the terms of the GNU Lesser General Public
1251-# License as published by the Free Software Foundation; either
1252-# version 2.1 of the License, or (at your option) any later version.
1253-#
1254-# This library is distributed in the hope that it will be useful,
1255-# but WITHOUT ANY WARRANTY; without even the implied warranty of
1256-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1257-# Lesser General Public License for more details.
1258-#
1259-# You should have received a copy of the GNU Lesser General Public
1260-# License along with this library; if not, write to the Free Software
1261-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1262-#
1263-# See: http://www.gnu.org/licenses/lgpl.html
1264-#
1265-#
1266+# Copyright (c) 2003-2004 Danny Brewer
1267+# d29583@groovegarden.com
1268+#
1269+# This library is free software; you can redistribute it and/or
1270+# modify it under the terms of the GNU Lesser General Public
1271+# License as published by the Free Software Foundation; either
1272+# version 2.1 of the License, or (at your option) any later version.
1273+#
1274+# This library is distributed in the hope that it will be useful,
1275+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1276+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1277+# Lesser General Public License for more details.
1278+#
1279+# You should have received a copy of the GNU Lesser General Public
1280+# License along with this library; if not, write to the Free Software
1281+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1282+#
1283+# See: http://www.gnu.org/licenses/lgpl.html
1284+#
1285+#
1286 # and other portions are under the following copyright and license:
1287 #
1288 #
1289 # OpenERP, Open Source Management Solution>..
1290-# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
1291+# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
1292 #
1293 # This program is free software: you can redistribute it and/or modify
1294 # it under the terms of the GNU Affero General Public License as published by
1295@@ -63,7 +63,7 @@
1296
1297 class ConvertBracesToField( unohelper.Base, XJobExecutor ):
1298
1299- def __init__(self,ctx):
1300+ def __init__(self, ctx):
1301
1302 self.ctx = ctx
1303 self.module = "openerp_report"
1304@@ -198,7 +198,7 @@
1305 info = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback))
1306 self.logobj.log_write('ConvertBraceToField', LOG_ERROR, info)
1307
1308- def getRes(self,sock,sObject,sVar):
1309+ def getRes(self, sock, sObject, sVar):
1310 desktop=getDesktop()
1311 doc =desktop.getCurrentComponent()
1312 docinfo=doc.getDocumentInfo()
1313@@ -215,7 +215,9 @@
1314 sObject = self.getRes(sock,res[myval]['relation'], sVar[sVar.find("/")+1:])
1315 return sObject
1316
1317- def getBraces(self,aReportSyntex=[]):
1318+ def getBraces(self, aReportSyntex=None):
1319+ if aReportSyntex is None:
1320+ aReportSyntex = []
1321 desktop=getDesktop()
1322 doc = desktop.getCurrentComponent()
1323 aSearchString=[]
1324
1325=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py'
1326--- base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py 2011-12-19 16:54:40 +0000
1327+++ base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py 2012-10-02 11:29:53 +0000
1328@@ -57,7 +57,7 @@
1329 uid = 3
1330
1331 class ConvertFieldsToBraces( unohelper.Base, XJobExecutor ):
1332- def __init__(self,ctx):
1333+ def __init__(self, ctx):
1334 self.ctx = ctx
1335 self.module = "openerp_report"
1336 self.version = "0.1"
1337
1338=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/ExportToRML.py'
1339--- base_report_designer/plugin/openerp_report_designer/bin/script/ExportToRML.py 2012-08-06 16:28:17 +0000
1340+++ base_report_designer/plugin/openerp_report_designer/bin/script/ExportToRML.py 2012-10-02 11:29:53 +0000
1341@@ -67,7 +67,7 @@
1342
1343
1344 class ExportToRML( unohelper.Base, XJobExecutor ):
1345- def __init__(self,ctx):
1346+ def __init__(self, ctx):
1347 self.ctx = ctx
1348 self.module = "openerp_report"
1349 self.version = "0.1"
1350
1351=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/Expression.py'
1352--- base_report_designer/plugin/openerp_report_designer/bin/script/Expression.py 2012-07-25 11:55:11 +0000
1353+++ base_report_designer/plugin/openerp_report_designer/bin/script/Expression.py 2012-10-02 11:29:53 +0000
1354@@ -57,7 +57,7 @@
1355 uid = 3
1356
1357 class Expression(unohelper.Base, XJobExecutor ):
1358- def __init__(self,sExpression="",sName="", bFromModify=False):
1359+ def __init__(self, sExpression="", sName="", bFromModify=False):
1360 LoginTest()
1361 if not loginstatus and __name__=="package":
1362 exit(1)
1363@@ -75,7 +75,7 @@
1364 self.win.doModalDialog("",None)
1365
1366
1367- def btnOk_clicked( self, oActionEvent ):
1368+ def btnOk_clicked(self, oActionEvent):
1369 desktop=getDesktop()
1370 doc = desktop.getCurrentComponent()
1371 text = doc.Text
1372@@ -105,7 +105,7 @@
1373 else:
1374 ErrorDialog("Please fill appropriate data in Name field or in Expression field.")
1375
1376- def btnCancel_clicked( self, oActionEvent ):
1377+ def btnCancel_clicked(self, oActionEvent):
1378 self.win.endExecute()
1379
1380 if __name__<>"package" and __name__=="__main__":
1381
1382=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/Fields.py'
1383--- base_report_designer/plugin/openerp_report_designer/bin/script/Fields.py 2012-07-25 12:53:32 +0000
1384+++ base_report_designer/plugin/openerp_report_designer/bin/script/Fields.py 2012-10-02 11:29:53 +0000
1385@@ -64,7 +64,7 @@
1386
1387
1388 class Fields(unohelper.Base, XJobExecutor ):
1389- def __init__(self,sVariable="",sFields="",sDisplayName="",bFromModify=False):
1390+ def __init__(self, sVariable="", sFields="", sDisplayName="", bFromModify=False):
1391 LoginTest()
1392 if not loginstatus and __name__=="package":
1393 exit(1)
1394@@ -177,7 +177,7 @@
1395 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")
1396 self.win.endExecute()
1397
1398- def lstbox_selected(self,oItemEvent):
1399+ def lstbox_selected(self, oItemEvent):
1400 try:
1401
1402 desktop=getDesktop()
1403@@ -200,7 +200,7 @@
1404 if self.bModify:
1405 self.win.setEditText("txtUName",self.sGDisplayName)
1406
1407- def getRes(self,sock ,sObject,sVar):
1408+ def getRes(self, sock, sObject, sVar):
1409 desktop=getDesktop()
1410 doc =desktop.getCurrentComponent()
1411 docinfo=doc.getDocumentInfo()
1412@@ -219,7 +219,7 @@
1413 else:
1414 return sObject
1415
1416- def cmbVariable_selected(self,oItemEvent):
1417+ def cmbVariable_selected(self, oItemEvent):
1418 if self.count > 0 :
1419 try:
1420 desktop=getDesktop()
1421@@ -246,7 +246,7 @@
1422 info = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback))
1423 self.logobj.log_write('Fields', LOG_ERROR, info)
1424
1425- def btnOk_clicked( self, oActionEvent ):
1426+ def btnOk_clicked(self, oActionEvent):
1427 desktop=getDesktop()
1428 doc = desktop.getCurrentComponent()
1429 cursor = doc.getCurrentController().getViewCursor()
1430@@ -281,7 +281,7 @@
1431 else:
1432 ErrorDialog("Please fill appropriate data in Name field \nor select particular value from the list of fields.")
1433
1434- def btnCancel_clicked( self, oActionEvent ):
1435+ def btnCancel_clicked(self, oActionEvent):
1436 self.win.endExecute()
1437
1438 if __name__<>"package" and __name__=="__main__":
1439
1440=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py'
1441--- base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py 2012-08-07 11:06:16 +0000
1442+++ base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py 2012-10-02 11:29:53 +0000
1443@@ -65,7 +65,7 @@
1444 uid = 3
1445
1446 class ModifyExistingReport(unohelper.Base, XJobExecutor):
1447- def __init__(self,ctx):
1448+ def __init__(self, ctx):
1449 self.ctx = ctx
1450 self.module = "openerp_report"
1451 self.version = "0.1"
1452@@ -177,10 +177,10 @@
1453
1454 self.win.endExecute()
1455
1456- def btnCancel_clicked( self, oActionEvent ):
1457+ def btnCancel_clicked(self, oActionEvent):
1458 self.win.endExecute()
1459
1460- def btnDelete_clicked( self, oActionEvent ):
1461+ def btnDelete_clicked(self, oActionEvent):
1462 desktop=getDesktop()
1463 doc = desktop.getCurrentComponent()
1464 docinfo=doc.getDocumentInfo()
1465
1466=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py'
1467--- base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py 2011-12-19 16:54:40 +0000
1468+++ base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py 2012-10-02 11:29:53 +0000
1469@@ -66,7 +66,7 @@
1470 #
1471 #
1472 class NewReport(unohelper.Base, XJobExecutor):
1473- def __init__(self,ctx):
1474+ def __init__(self, ctx):
1475 self.ctx = ctx
1476 self.module = "openerp_report"
1477 self.version = "0.1"
1478@@ -99,7 +99,7 @@
1479 self.win.addButton('btnCancel',-2 - 70 - 5 ,-5, 35,15,'Cancel' ,actionListenerProc = self.btnCancel_clicked )
1480 self.win.doModalDialog("",None)
1481
1482- def btnOk_clicked(self,oActionEvent):
1483+ def btnOk_clicked(self, oActionEvent):
1484 desktop=getDesktop()
1485 doc = desktop.getCurrentComponent()
1486 docinfo=doc.getDocumentInfo()
1487@@ -107,7 +107,7 @@
1488 self.logobj.log_write('Module Name',LOG_INFO, ':Module use in creating a report %s using database %s' % (self.aModuleName[self.lstModule.getSelectedItemPos()], database))
1489 self.win.endExecute()
1490
1491- def btnCancel_clicked( self, oActionEvent ):
1492+ def btnCancel_clicked(self, oActionEvent):
1493 self.win.endExecute()
1494
1495 if __name__<>"package" and __name__=="__main__":
1496
1497=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/Repeatln.py'
1498--- base_report_designer/plugin/openerp_report_designer/bin/script/Repeatln.py 2012-07-25 11:55:11 +0000
1499+++ base_report_designer/plugin/openerp_report_designer/bin/script/Repeatln.py 2012-10-02 11:29:53 +0000
1500@@ -64,7 +64,7 @@
1501
1502 #class RepeatIn:
1503 class RepeatIn( unohelper.Base, XJobExecutor ):
1504- def __init__(self,sObject="",sVariable="",sFields="",sDisplayName="",bFromModify=False):
1505+ def __init__(self, sObject="", sVariable="", sFields="", sDisplayName="", bFromModify=False):
1506 # Interface Design
1507 LoginTest()
1508 self.logobj=Logger()
1509@@ -204,7 +204,7 @@
1510 ErrorDialog("Please Select Appropriate module" ,"Create new report from: \nOpenERP -> Open a New Report")
1511 self.win.endExecute()
1512
1513- def lstbox_selected(self,oItemEvent):
1514+ def lstbox_selected(self, oItemEvent):
1515 sItem=self.win.getListBoxSelectedItem("lstFields")
1516 sMain=self.aListRepeatIn[self.win.getListBoxSelectedItemPos("lstFields")]
1517
1518@@ -215,7 +215,7 @@
1519 self.win.setEditText("txtName",sMain[sMain.rfind("/")+1:])
1520 self.win.setEditText("txtUName","|-."+sItem[sItem.rfind("/")+1:]+".-|")
1521
1522- def cmbVariable_selected(self,oItemEvent):
1523+ def cmbVariable_selected(self, oItemEvent):
1524
1525 if self.count > 0 :
1526
1527@@ -290,7 +290,7 @@
1528 else:
1529 ErrorDialog("Please fill appropriate data in Object Field or Name field \nor select particular value from the list of fields.")
1530
1531- def btnCancel_clicked( self, oActionEvent ):
1532+ def btnCancel_clicked(self, oActionEvent):
1533 self.win.endExecute()
1534
1535 if __name__<>"package" and __name__=="__main__":
1536
1537=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/SendToServer.py'
1538--- base_report_designer/plugin/openerp_report_designer/bin/script/SendToServer.py 2012-08-07 11:06:16 +0000
1539+++ base_report_designer/plugin/openerp_report_designer/bin/script/SendToServer.py 2012-10-02 11:29:53 +0000
1540@@ -72,7 +72,7 @@
1541 'HTML' : 'html'
1542 }
1543
1544- def __init__(self,ctx):
1545+ def __init__(self, ctx):
1546 self.ctx = ctx
1547 self.module = "openerp_report"
1548 self.version = "0.1"
1549@@ -136,10 +136,10 @@
1550
1551 self.win.doModalDialog("lstResourceType", self.Kind.keys()[0])
1552
1553- def lstbox_selected(self,oItemEvent):
1554+ def lstbox_selected(self, oItemEvent):
1555 pass
1556
1557- def btnCancel_clicked( self, oActionEvent ):
1558+ def btnCancel_clicked(self, oActionEvent):
1559 self.win.endExecute()
1560
1561 def btnOk_clicked(self, oActionEvent):
1562@@ -221,7 +221,7 @@
1563 id=self.sock.execute(database, uid, self.password, 'ir.actions.report.xml' ,'create', params)
1564 return id
1565
1566- def getInverseFieldsRecord(self,nVal):
1567+ def getInverseFieldsRecord(self, nVal):
1568 desktop=getDesktop()
1569 doc = desktop.getCurrentComponent()
1570 count=0
1571
1572=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py'
1573--- base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py 2012-08-07 11:06:16 +0000
1574+++ base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py 2012-10-02 11:29:53 +0000
1575@@ -59,7 +59,7 @@
1576 database="test"
1577
1578 class ServerParameter( unohelper.Base, XJobExecutor ):
1579- def __init__(self, aVal= None, sURL=""):
1580+ def __init__(self, aVal=None, sURL=""):
1581 self.module = "openerp_report"
1582 self.version = "0.1"
1583 desktop=getDesktop()
1584@@ -116,8 +116,7 @@
1585
1586 #self.win.doModalDialog("lstDatabase",docinfo.getUserFieldValue(2))
1587
1588- def btnOk_clicked(self,oActionEvent):
1589-
1590+ def btnOk_clicked(self, oActionEvent):
1591 sLogin=self.win.getEditText("txtLoginName")
1592 sPassword=self.win.getEditText("txtPassword")
1593 global url
1594@@ -157,11 +156,10 @@
1595 self.logobj.log_write('successful login',LOG_INFO, ': successful login from %s using database %s' % (sLogin, sDatabase))
1596 self.win.endExecute()
1597
1598-
1599- def btnCancel_clicked( self, oActionEvent ):
1600+ def btnCancel_clicked(self, oActionEvent):
1601 self.win.endExecute()
1602
1603- def btnPrevious_clicked(self,oActionEvent):
1604+ def btnPrevious_clicked(self, oActionEvent):
1605 self.win.endExecute()
1606 Change(None)
1607 self.win.endExecute()
1608@@ -172,5 +170,4 @@
1609 elif __name__=="package":
1610 g_ImplementationHelper.addImplementation( ServerParameter, "org.openoffice.openerp.report.serverparam", ("com.sun.star.task.Job",),)
1611
1612-
1613 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
1614
1615=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/Translation.py'
1616--- base_report_designer/plugin/openerp_report_designer/bin/script/Translation.py 2012-08-06 16:28:17 +0000
1617+++ base_report_designer/plugin/openerp_report_designer/bin/script/Translation.py 2012-10-02 11:29:53 +0000
1618@@ -61,7 +61,7 @@
1619
1620
1621 class AddLang(unohelper.Base, XJobExecutor ):
1622- def __init__(self,sVariable="",sFields="",sDisplayName="",bFromModify=False):
1623+ def __init__(self, sVariable="", sFields="", sDisplayName="", bFromModify=False):
1624 LoginTest()
1625 if not loginstatus and __name__=="package":
1626 exit(1)
1627@@ -157,7 +157,7 @@
1628 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")
1629 self.win.endExecute()
1630
1631- def lstbox_selected(self,oItemEvent):
1632+ def lstbox_selected(self, oItemEvent):
1633 try:
1634
1635 desktop=getDesktop()
1636@@ -183,7 +183,7 @@
1637 if self.bModify:
1638 self.win.setEditText("txtUName",self.sGDisplayName)
1639
1640- def getRes(self,sock ,sObject,sVar):
1641+ def getRes(self, sock, sObject, sVar):
1642 desktop=getDesktop()
1643 doc =desktop.getCurrentComponent()
1644 docinfo=doc.getDocumentInfo()
1645@@ -203,7 +203,7 @@
1646 return sObject
1647
1648
1649- def cmbVariable_selected(self,oItemEvent):
1650+ def cmbVariable_selected(self, oItemEvent):
1651 if self.count > 0 :
1652 try:
1653 desktop=getDesktop()
1654@@ -229,7 +229,7 @@
1655 except:
1656 import traceback;traceback.print_exc()
1657
1658- def btnOk_clicked( self, oActionEvent ):
1659+ def btnOk_clicked(self, oActionEvent):
1660 self.bOkay = True
1661 desktop=getDesktop()
1662 doc = desktop.getCurrentComponent()
1663@@ -263,7 +263,7 @@
1664 else:
1665 ErrorDialog("Please fill appropriate data in name field \nor select particular value from the list of fields.")
1666
1667- def btnCancel_clicked( self, oActionEvent ):
1668+ def btnCancel_clicked(self, oActionEvent):
1669 self.win.endExecute()
1670
1671
1672
1673=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/lib/error.py'
1674--- base_report_designer/plugin/openerp_report_designer/bin/script/lib/error.py 2011-12-19 16:54:40 +0000
1675+++ base_report_designer/plugin/openerp_report_designer/bin/script/lib/error.py 2012-10-02 11:29:53 +0000
1676@@ -48,7 +48,7 @@
1677 if __name__<>"package":
1678 from gui import *
1679 class ErrorDialog:
1680- def __init__(self,sErrorMsg, sErrorHelpMsg="",sTitle="Error Message"):
1681+ def __init__(self, sErrorMsg, sErrorHelpMsg="", sTitle="Error Message"):
1682 self.win = DBModalDialog(50, 50, 150, 90, sTitle)
1683 self.win.addFixedText("lblErrMsg", 5, 5, 190, 25, sErrorMsg)
1684 self.win.addFixedText("lblErrHelpMsg", 5, 30, 190, 25, sErrorHelpMsg)
1685
1686=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/lib/functions.py'
1687--- base_report_designer/plugin/openerp_report_designer/bin/script/lib/functions.py 2011-12-19 16:54:40 +0000
1688+++ base_report_designer/plugin/openerp_report_designer/bin/script/lib/functions.py 2012-10-02 11:29:53 +0000
1689@@ -59,7 +59,13 @@
1690 database="test"
1691 uid = 1
1692
1693-def genTree(object,aList,insField,host,level=3, ending=[], ending_excl=[], recur=[], root='', actualroot=""):
1694+def genTree(object, aList, insField, host, level=3, ending=None, ending_excl=None, recur=None, root='', actualroot=""):
1695+ if ending is None:
1696+ ending = []
1697+ if ending_excl is None:
1698+ ending_excl = []
1699+ if recur is None:
1700+ recur = []
1701 try:
1702 global url
1703 sock=RPCSession(url)
1704@@ -79,7 +85,7 @@
1705 info = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback))
1706 obj.log_write('Function', LOG_ERROR, info)
1707
1708-def VariableScope(oTcur,insVariable,aObjectList,aComponentAdd,aItemList,sTableName=""):
1709+def VariableScope(oTcur, insVariable, aObjectList, aComponentAdd, aItemList, sTableName=""):
1710 if sTableName.find(".") != -1:
1711 for i in range(len(aItemList)):
1712 if aComponentAdd[i]==sTableName:
1713@@ -96,7 +102,7 @@
1714 if aObjectList[j][:aObjectList[j].find("(")] == sLVal and sLVal!="":
1715 insVariable.append(aObjectList[j])
1716
1717-def getList(aObjectList,host,count):
1718+def getList(aObjectList, host, count):
1719 desktop=getDesktop()
1720 doc =desktop.getCurrentComponent()
1721 docinfo=doc.getDocumentInfo()
1722@@ -128,7 +134,7 @@
1723 else:
1724 aObjectList.append("List of " + docinfo.getUserFieldValue(3))
1725
1726-def getRelation(sRelName, sItem, sObjName, aObjectList, host ):
1727+def getRelation(sRelName, sItem, sObjName, aObjectList, host):
1728 global url
1729 sock=RPCSession(url)
1730 global passwd
1731@@ -143,7 +149,7 @@
1732 getRelation(res[k]['relation'], sItem[sItem.find(".")+1:], sObjName,aObjectList,host)
1733
1734
1735-def getPath(sPath,sMain):
1736+def getPath(sPath, sMain):
1737 desktop=getDesktop()
1738 doc =desktop.getCurrentComponent()
1739 oParEnum = doc.getTextFields().createEnumeration()
1740@@ -161,7 +167,7 @@
1741 getPath(sPath, sMain)
1742 return sPath
1743
1744-def EnumDocument(aItemList,aComponentAdd):
1745+def EnumDocument(aItemList, aComponentAdd):
1746 desktop = getDesktop()
1747 parent=""
1748 bFlag = False
1749@@ -183,7 +189,7 @@
1750 aItemList.append( templist )
1751 aComponentAdd.append( parent )
1752
1753-def getChildTable(oPar,aItemList,aComponentAdd,sTableName=""):
1754+def getChildTable(oPar, aItemList, aComponentAdd, sTableName=""):
1755 sNames = oPar.getCellNames()
1756 bEmptyTableFlag=True
1757 for val in sNames:
1758@@ -229,7 +235,7 @@
1759 aComponentAdd.append(sTableName+"."+oPar.Name)
1760 return 0
1761
1762-def getRecersiveSection(oCurrentSection,aSectionList):
1763+def getRecersiveSection(oCurrentSection, aSectionList):
1764 desktop=getDesktop()
1765 doc =desktop.getCurrentComponent()
1766 oParEnum=doc.getText().createEnumeration()
1767
1768=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/lib/logreport.py'
1769--- base_report_designer/plugin/openerp_report_designer/bin/script/lib/logreport.py 2012-06-22 06:48:54 +0000
1770+++ base_report_designer/plugin/openerp_report_designer/bin/script/lib/logreport.py 2012-10-02 11:29:53 +0000
1771@@ -39,11 +39,10 @@
1772 _logger.setLevel(logging.INFO)
1773
1774 class Logger(object):
1775- def log_write(self,name,level,msg):
1776+ def log_write(self, name, level, msg):
1777 getattr(_logger,level)(msg)
1778
1779 def shutdown(self):
1780 logging.shutdown()
1781
1782-
1783 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
1784
1785=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/lib/rpc.py'
1786--- base_report_designer/plugin/openerp_report_designer/bin/script/lib/rpc.py 2011-12-19 16:54:40 +0000
1787+++ base_report_designer/plugin/openerp_report_designer/bin/script/lib/rpc.py 2012-10-02 11:29:53 +0000
1788@@ -52,7 +52,7 @@
1789
1790
1791 class RPCSession(object):
1792- def __init__(self,url):
1793+ def __init__(self, url):
1794
1795 m = re.match('^(http[s]?://|socket://)([\w.\-]+):(\d{1,5})$', url or '')
1796
1797@@ -152,7 +152,7 @@
1798
1799 return res
1800
1801- def execute(self, sDatabase,UID,sPassword,obj, method, *args):
1802+ def execute(self, sDatabase, UID, sPassword, obj, method, *args):
1803 global rpc_url
1804
1805 sock = xmlrpclib.ServerProxy(rpc_url + 'object')
1806
1807=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/lib/tools.py'
1808--- base_report_designer/plugin/openerp_report_designer/bin/script/lib/tools.py 2011-12-19 16:54:40 +0000
1809+++ base_report_designer/plugin/openerp_report_designer/bin/script/lib/tools.py 2012-10-02 11:29:53 +0000
1810@@ -21,19 +21,19 @@
1811 ##############################################################################
1812 import urllib
1813
1814-def get_absolute_file_path( url ):
1815+def get_absolute_file_path(url):
1816 url_unquoted = urllib.unquote(url)
1817 return os.name == 'nt' and url_unquoted[1:] or url_unquoted
1818
1819 # This function reads the content of a file and return it to the caller
1820-def read_data_from_file( filename ):
1821+def read_data_from_file(filename):
1822 fp = file( filename, "rb" )
1823 data = fp.read()
1824 fp.close()
1825 return data
1826
1827 # This function writes the content to a file
1828-def write_data_to_file( filename, data ):
1829+def write_data_to_file(filename, data):
1830 fp = file( filename, 'wb' )
1831 fp.write( data )
1832 fp.close()
1833
1834=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/modify.py'
1835--- base_report_designer/plugin/openerp_report_designer/bin/script/modify.py 2012-08-06 16:28:17 +0000
1836+++ base_report_designer/plugin/openerp_report_designer/bin/script/modify.py 2012-10-02 11:29:53 +0000
1837@@ -61,7 +61,7 @@
1838 uid = 3
1839
1840 class modify(unohelper.Base, XJobExecutor ):
1841- def __init__( self, ctx ):
1842+ def __init__(self, ctx):
1843 self.ctx = ctx
1844 self.module = "openerp_report"
1845 self.version = "0.1"
1846
1847=== modified file 'base_report_designer/plugin/openerp_report_designer/test/test_fields.py'
1848--- base_report_designer/plugin/openerp_report_designer/test/test_fields.py 2011-12-19 16:54:40 +0000
1849+++ base_report_designer/plugin/openerp_report_designer/test/test_fields.py 2012-10-02 11:29:53 +0000
1850@@ -10,7 +10,13 @@
1851
1852 sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object')
1853
1854-def get(object, level=3, ending=[], ending_excl=[], recur=[], root=''):
1855+def get(object, level=3, ending=None, ending_excl=None, recur=None, root=''):
1856+ if ending is None:
1857+ ending = []
1858+ if ending_excl is None:
1859+ ending_excl = []
1860+ if recur is None:
1861+ recur = []
1862 res = sock.execute('terp', 3, 'admin', 'account.invoice', 'fields_get')
1863 key = res.keys()
1864 key.sort()
1865
1866=== modified file 'base_vat/__init__.py'
1867--- base_vat/__init__.py 2011-12-19 16:54:40 +0000
1868+++ base_vat/__init__.py 2012-10-02 11:29:53 +0000
1869@@ -22,4 +22,4 @@
1870 import res_company
1871 import base_vat
1872
1873-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
1874\ No newline at end of file
1875+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
1876
1877=== modified file 'base_vat/res_company.py'
1878--- base_vat/res_company.py 2011-11-28 16:40:14 +0000
1879+++ base_vat/res_company.py 2012-10-02 11:29:53 +0000
1880@@ -29,4 +29,4 @@
1881 "rather than via a simple format validation (checksum)."),
1882 }
1883
1884-
1885\ No newline at end of file
1886+
1887
1888=== modified file 'caldav/caldav_node.py'
1889--- caldav/caldav_node.py 2012-07-25 12:05:41 +0000
1890+++ caldav/caldav_node.py 2012-10-02 11:29:53 +0000
1891@@ -43,7 +43,7 @@
1892 DAV_M_NS = dict_merge2(nodes.node_dir.DAV_M_NS,
1893 { "http://calendarserver.org/ns/" : '_get_dav', } )
1894
1895- def _file_get(self,cr, nodename=False):
1896+ def _file_get(self, cr, nodename=False):
1897 return []
1898
1899 def _child_get(self, cr, name=False, parent_id=False, domain=None):
1900@@ -100,7 +100,7 @@
1901 DAV_M_NS = dict_merge2(nodes.node_res_obj.DAV_M_NS,
1902 { "http://calendarserver.org/ns/" : '_get_dav', } )
1903
1904- def _file_get(self,cr, nodename=False):
1905+ def _file_get(self, cr, nodename=False):
1906 return []
1907
1908 def _child_get(self, cr, name=False, parent_id=False, domain=None):
1909@@ -181,7 +181,7 @@
1910
1911 http_options = { 'DAV': ['calendar-access'] }
1912
1913- def __init__(self,path, parent, context, calendar):
1914+ def __init__(self, path, parent, context, calendar):
1915 super(node_calendar,self).__init__(path, parent,context)
1916 self.calendar_id = calendar.id
1917 self.mimetype = 'application/x-directory'
1918@@ -271,7 +271,7 @@
1919 def children(self, cr, domain=None):
1920 return self._child_get(cr, domain=domain)
1921
1922- def child(self,cr, name, domain=None):
1923+ def child(self, cr, name, domain=None):
1924 res = self._child_get(cr, name, domain=domain)
1925 if res:
1926 return res[0]
1927@@ -353,16 +353,16 @@
1928 return None
1929
1930
1931- def set_data(self, cr, data, fil_obj = None):
1932+ def set_data(self, cr, data, fil_obj=None):
1933 uid = self.context.uid
1934 calendar_obj = self.context._dirobj.pool.get('basic.calendar')
1935 res = calendar_obj.import_cal(cr, uid, data, self.calendar_id)
1936 return res
1937
1938- def get_data_len(self, cr, fil_obj = None):
1939+ def get_data_len(self, cr, fil_obj=None):
1940 return self.content_length
1941
1942- def _get_ttag(self,cr):
1943+ def _get_ttag(self, cr):
1944 return 'calendar-%d' % (self.calendar_id,)
1945
1946 def rmcol(self, cr):
1947@@ -441,7 +441,7 @@
1948
1949 http_options = { 'DAV': ['calendar-access'] }
1950
1951- def __init__(self,path, parent, context, res_obj, res_model=None, res_id=None):
1952+ def __init__(self, path, parent, context, res_obj, res_model=None, res_id=None):
1953 super(res_node_calendar,self).__init__(path, parent, context)
1954 self.mimetype = 'text/calendar'
1955 self.create_date = parent.create_date
1956@@ -474,10 +474,10 @@
1957 def _get_caldav_calendar_data(self, cr):
1958 return self.get_data(cr)
1959
1960- def get_data_len(self, cr, fil_obj = None):
1961+ def get_data_len(self, cr, fil_obj=None):
1962 return self.content_length
1963
1964- def set_data(self, cr, data, fil_obj = None):
1965+ def set_data(self, cr, data, fil_obj=None):
1966 uid = self.context.uid
1967 context = self.context.context.copy()
1968 context.update(self.dctx)
1969@@ -486,7 +486,7 @@
1970 res = calendar_obj.import_cal(cr, uid, data, self.calendar_id, context=context)
1971 return res
1972
1973- def _get_ttag(self,cr):
1974+ def _get_ttag(self, cr):
1975 res = False
1976 if self.model and self.res_id:
1977 res = '%s_%d' % (self.model, self.res_id)
1978
1979=== modified file 'crm/crm.py'
1980--- crm/crm.py 2012-09-24 12:51:39 +0000
1981+++ crm/crm.py 2012-10-02 11:29:53 +0000
1982@@ -58,7 +58,7 @@
1983
1984 class crm_case_stage(osv.osv):
1985 """ Model for case stages. This models the main stages of a document
1986- management flow. Main CRM objects (leads, opportunities, project
1987+ management flow. Main CRM objects (leads, opportunities, project
1988 issues, ...) will now use only stages, instead of state and stages.
1989 Stages are for example used to display the kanban view of records.
1990 """
1991@@ -126,11 +126,11 @@
1992 'note': fields.text('Description'),
1993 'working_hours': fields.float('Working Hours', digits=(16,2 )),
1994 'stage_ids': fields.many2many('crm.case.stage', 'section_stage_rel', 'section_id', 'stage_id', 'Stages'),
1995- 'alias_id': fields.many2one('mail.alias', 'Alias', ondelete="cascade", required=True,
1996+ 'alias_id': fields.many2one('mail.alias', 'Alias', ondelete="cascade", required=True,
1997 help="The email address associated with this team. New emails received will automatically "
1998 "create new leads assigned to the team."),
1999 }
2000-
2001+
2002 def _get_stage_common(self, cr, uid, context):
2003 ids = self.pool.get('crm.case.stage').search(cr, uid, [('case_default','=',1)], context=context)
2004 return ids
2005@@ -165,12 +165,12 @@
2006 name = record['parent_id'][1] + ' / ' + name
2007 res.append((record['id'], name))
2008 return res
2009-
2010+
2011 def create(self, cr, uid, vals, context=None):
2012 mail_alias = self.pool.get('mail.alias')
2013 if not vals.get('alias_id'):
2014 vals.pop('alias_name', None) # prevent errors during copy()
2015- alias_id = mail_alias.create_unique_alias(cr, uid,
2016+ alias_id = mail_alias.create_unique_alias(cr, uid,
2017 {'alias_name': vals['name']},
2018 model_name="crm.lead",
2019 context=context)
2020@@ -178,7 +178,7 @@
2021 res = super(crm_case_section, self).create(cr, uid, vals, context)
2022 mail_alias.write(cr, uid, [vals['alias_id']], {'alias_defaults': {'section_id': res, 'type':'lead'}}, context)
2023 return res
2024-
2025+
2026 def unlink(self, cr, uid, ids, context=None):
2027 # Cascade-delete mail aliases as well, as they should not exist without the sales team.
2028 mail_alias = self.pool.get('mail.alias')
2029@@ -217,7 +217,6 @@
2030 'section_id': fields.many2one('crm.case.section', 'Sales Team'),
2031 }
2032
2033-
2034 def _links_get(self, cr, uid, context=None):
2035 """Gets links value for reference field"""
2036 obj = self.pool.get('res.request.link')
2037
2038=== modified file 'crm/crm_lead.py'
2039--- crm/crm_lead.py 2012-09-28 09:53:31 +0000
2040+++ crm/crm_lead.py 2012-10-02 11:29:53 +0000
2041@@ -311,7 +311,6 @@
2042 }
2043 return {'value' : values}
2044
2045-
2046 def _check(self, cr, uid, ids=False, context=None):
2047 """ Override of the base.stage method.
2048 Function called by the scheduler to process cases for date actions
2049@@ -801,7 +800,7 @@
2050 if section_id:
2051 vals.setdefault('message_follower_ids', [])
2052 vals['message_follower_ids'] += [(4, follower.id) for follower in section_id.message_follower_ids]
2053- return super(crm_lead,self).write(cr, uid, ids, vals, context)
2054+ return super(crm_lead,self).write(cr, uid, ids, vals, context)
2055
2056 # ----------------------------------------
2057 # Mail Gateway
2058
2059=== modified file 'crm_claim/crm_claim.py'
2060--- crm_claim/crm_claim.py 2012-09-10 04:17:26 +0000
2061+++ crm_claim/crm_claim.py 2012-10-02 11:29:53 +0000
2062@@ -35,7 +35,7 @@
2063
2064 class crm_claim_stage(osv.osv):
2065 """ Model for claim stages. This models the main stages of a claim
2066- management flow. Main CRM objects (leads, opportunities, project
2067+ management flow. Main CRM objects (leads, opportunities, project
2068 issues, ...) will now use only stages, instead of state and stages.
2069 Stages are for example used to display the kanban view of records.
2070 """
2071@@ -104,7 +104,7 @@
2072 'email_from': fields.char('Email', size=128, help="These people will receive email."),
2073 'partner_phone': fields.char('Phone', size=32),
2074 'stage_id': fields.many2one ('crm.claim.stage', 'Stage',
2075- domain="['|', ('section_ids', '=', section_id), ('case_default', '=', True)]"),
2076+ domain="['|', ('section_ids', '=', section_id), ('case_default', '=', True)]"),
2077 'cause': fields.text('Root Cause'),
2078 'state': fields.related('stage_id', 'state', type="selection", store=True,
2079 selection=crm.AVAILABLE_STATES, string="State", readonly=True,
2080
2081=== modified file 'crm_helpdesk/crm_helpdesk.py'
2082--- crm_helpdesk/crm_helpdesk.py 2012-09-17 10:11:09 +0000
2083+++ crm_helpdesk/crm_helpdesk.py 2012-10-02 11:29:53 +0000
2084@@ -69,9 +69,9 @@
2085 'probability': fields.float('Probability (%)'),
2086 'categ_id': fields.many2one('crm.case.categ', 'Category', \
2087 domain="['|',('section_id','=',False),('section_id','=',section_id),\
2088- ('object_id.model', '=', 'crm.helpdesk')]"),
2089- 'duration': fields.float('Duration', states={'done': [('readonly', True)]}),
2090- 'state': fields.selection(crm.AVAILABLE_STATES, 'Status', size=16, readonly=True,
2091+ ('object_id.model', '=', 'crm.helpdesk')]"),
2092+ 'duration': fields.float('Duration', states={'done': [('readonly', True)]}),
2093+ 'state': fields.selection(crm.AVAILABLE_STATES, 'Status', size=16, readonly=True,
2094 help='The state is set to \'Draft\', when a case is created.\
2095 \nIf the case is in progress the state is set to \'Open\'.\
2096 \nWhen the case is over, the state is set to \'Done\'.\
2097@@ -139,9 +139,9 @@
2098
2099 return super(crm_helpdesk,self).message_update(cr, uid, ids, msg, update_vals=update_vals, context=context)
2100
2101- # ******************************
2102+ # ---------------------------------------------------
2103 # OpenChatter
2104- # ******************************
2105+ # ---------------------------------------------------
2106
2107 def case_get_note_msg_prefix(self, cr, uid, id, context=None):
2108 """ override of default base_state method. """
2109@@ -152,5 +152,4 @@
2110 self.message_post(cr, uid, ids, body=msg, context=context)
2111 return True
2112
2113-
2114 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2115
2116=== modified file 'crm_profiling/crm_profiling.py'
2117--- crm_profiling/crm_profiling.py 2012-07-12 05:50:38 +0000
2118+++ crm_profiling/crm_profiling.py 2012-10-02 11:29:53 +0000
2119@@ -77,7 +77,7 @@
2120 return ids_to_check
2121
2122
2123-def test_prof(cr, uid, seg_id, pid, answers_ids = []):
2124+def test_prof(cr, uid, seg_id, pid, answers_ids=None):
2125
2126 """ return True if the partner pid fetch the segmentation rule seg_id
2127 @param cr: the current row, from the database cursor,
2128
2129=== modified file 'document/content_index.py'
2130--- document/content_index.py 2012-08-06 17:08:41 +0000
2131+++ document/content_index.py 2012-10-02 11:29:53 +0000
2132@@ -51,7 +51,7 @@
2133 return mts[0]
2134 return None
2135
2136- def indexContent(self, content, filename=None, realfile = None):
2137+ def indexContent(self, content, filename=None, realfile=None):
2138 """ Use either content or the real file, to index.
2139 Some parsers will work better with the actual
2140 content, others parse a file easier. Try the
2141@@ -95,16 +95,15 @@
2142
2143 raise NhException('No appropriate method to index file.')
2144
2145- def _doIndexContent(self,content):
2146+ def _doIndexContent(self, content):
2147 raise NhException("Content cannot be handled here.")
2148
2149- def _doIndexFile(self,fpath):
2150+ def _doIndexFile(self, fpath):
2151 raise NhException("Content cannot be handled here.")
2152
2153 def __repr__(self):
2154 return "<indexer %s.%s>" %(self.__module__, self.__class__.__name__)
2155
2156-
2157 def mime_match(mime, mdict):
2158 if mdict.has_key(mime):
2159 return (mime, mdict[mime])
2160@@ -136,7 +135,7 @@
2161 if not f:
2162 raise Exception("Your indexer should at least support a mimetype or extension.")
2163
2164- def doIndex(self, content, filename=None, content_type=None, realfname = None, debug=False):
2165+ def doIndex(self, content, filename=None, content_type=None, realfname=None, debug=False):
2166 fobj = None
2167 fname = None
2168 mime = None
2169
2170=== modified file 'document/document.py'
2171--- document/document.py 2012-09-24 16:26:45 +0000
2172+++ document/document.py 2012-10-02 11:29:53 +0000
2173@@ -149,7 +149,7 @@
2174 _sql_constraints = [
2175 # filename_uniq is not possible in pure SQL
2176 ]
2177- def _check_duplication(self, cr, uid, vals, ids=[], op='create'):
2178+ def _check_duplication(self, cr, uid, vals, ids=None, op='create'):
2179 name = vals.get('name', False)
2180 parent_id = vals.get('parent_id', False)
2181 res_model = vals.get('res_model', False)
2182
2183=== modified file 'document/document_directory.py'
2184--- document/document_directory.py 2012-09-24 16:26:45 +0000
2185+++ document/document_directory.py 2012-10-02 11:29:53 +0000
2186@@ -221,7 +221,7 @@
2187 pass
2188 return res
2189
2190- def _locate_child(self, cr, uid, root_id, uri,nparent, ncontext):
2191+ def _locate_child(self, cr, uid, root_id, uri, nparent, ncontext):
2192 """ try to locate the node in uri,
2193 Return a tuple (node_dir, remaining_path)
2194 """
2195@@ -234,7 +234,7 @@
2196 default.update(name=_("%s (copy)") % (name))
2197 return super(document_directory,self).copy(cr, uid, id, default, context=context)
2198
2199- def _check_duplication(self, cr, uid, vals, ids=[], op='create'):
2200+ def _check_duplication(self, cr, uid, vals, ids=None, op='create'):
2201 name=vals.get('name',False)
2202 parent_id=vals.get('parent_id',False)
2203 ressource_parent_type_id=vals.get('ressource_parent_type_id',False)
2204
2205=== modified file 'document/nodes.py'
2206--- document/nodes.py 2012-08-06 17:08:41 +0000
2207+++ document/nodes.py 2012-10-02 11:29:53 +0000
2208@@ -103,7 +103,7 @@
2209 def get(self, name, default=None):
2210 return self.context.get(name, default)
2211
2212- def get_uri(self, cr, uri):
2213+ def get_uri(self, cr, uri):
2214 """ Although this fn passes back to doc.dir, it is needed since
2215 it is a potential caching point.
2216 """
2217@@ -252,7 +252,7 @@
2218 print "node_class.children()"
2219 return [] #stub
2220
2221- def child(self,cr, name, domain=None):
2222+ def child(self, cr, name, domain=None):
2223 print "node_class.child()"
2224 return None
2225
2226@@ -270,7 +270,7 @@
2227 print "node_class.path_get()"
2228 return False
2229
2230- def get_data(self,cr):
2231+ def get_data(self, cr):
2232 raise TypeError('No data for %s.'% self.type)
2233
2234 def open_data(self, cr, mode):
2235@@ -287,10 +287,10 @@
2236 """
2237 raise TypeError('No data for %s.' % self.type)
2238
2239- def _get_storage(self,cr):
2240+ def _get_storage(self, cr):
2241 raise RuntimeError("No storage for base class.")
2242
2243- def get_etag(self,cr):
2244+ def get_etag(self, cr):
2245 """ Get a tag, unique per object + modification.
2246
2247 see. http://tools.ietf.org/html/rfc2616#section-13.3.3 """
2248@@ -434,7 +434,9 @@
2249
2250 """
2251 our_type = 'database'
2252- def __init__(self, path=[], parent=False, context=None):
2253+ def __init__(self, path=None, parent=False, context=None):
2254+ if path is None:
2255+ path = []
2256 super(node_database,self).__init__(path, parent, context)
2257 self.unixperms = 040750
2258 self.uidperms = 5
2259@@ -477,11 +479,11 @@
2260
2261 return res
2262
2263- def _file_get(self,cr, nodename=False):
2264+ def _file_get(self, cr, nodename=False):
2265 res = []
2266 return res
2267
2268- def _get_ttag(self,cr):
2269+ def _get_ttag(self, cr):
2270 return 'db-%s' % cr.dbname
2271
2272 def mkdosname(company_name, default='noname'):
2273@@ -666,7 +668,6 @@
2274
2275 return dirobj.create(cr, uid, val)
2276
2277-
2278 def create_child(self, cr, path, data=None):
2279 """ API function to create a child file object and node
2280 Return the node_* created
2281@@ -693,7 +694,7 @@
2282 fnode.set_data(cr, data, fil)
2283 return fnode
2284
2285- def _get_ttag(self,cr):
2286+ def _get_ttag(self, cr):
2287 return 'dir-%d' % self.dir_id
2288
2289 def move_to(self, cr, ndir_node, new_name=False, fil_obj=None, ndir_obj=None, in_write=False):
2290@@ -802,7 +803,7 @@
2291 def children(self, cr, domain=None):
2292 return self._child_get(cr, domain=domain)
2293
2294- def child(self,cr, name, domain=None):
2295+ def child(self, cr, name, domain=None):
2296 res = self._child_get(cr, name, domain=domain)
2297 if res:
2298 return res[0]
2299@@ -878,7 +879,7 @@
2300 res.append(self.res_obj_class(res_name, self.dir_id, self, self.context, self.res_model, bo))
2301 return res
2302
2303- def _get_ttag(self,cr):
2304+ def _get_ttag(self, cr):
2305 return 'rdir-%d' % self.dir_id
2306
2307 class node_res_obj(node_class):
2308@@ -889,7 +890,7 @@
2309 node_dirs (with limited domain).
2310 """
2311 our_type = 'collection'
2312- def __init__(self, path, dir_id, parent, context, res_model, res_bo, res_id = None):
2313+ def __init__(self, path, dir_id, parent, context, res_model, res_bo, res_id=None):
2314 super(node_res_obj,self).__init__(path, parent,context)
2315 assert parent
2316 #todo: more info from dirr
2317@@ -958,7 +959,7 @@
2318 return res[0]
2319 return None
2320
2321- def _file_get(self,cr, nodename=False):
2322+ def _file_get(self, cr, nodename=False):
2323 res = []
2324 is_allowed = self.check_perms((nodename and 1) or 5)
2325 if not is_allowed:
2326@@ -1160,7 +1161,7 @@
2327 fnode.set_data(cr, data, fil)
2328 return fnode
2329
2330- def _get_ttag(self,cr):
2331+ def _get_ttag(self, cr):
2332 return 'rodir-%d-%d' % (self.dir_id, self.res_id)
2333
2334 node_res_dir.res_obj_class = node_res_obj
2335@@ -1210,7 +1211,6 @@
2336 return False
2337 return self.file_id == other.file_id
2338
2339-
2340 def open_data(self, cr, mode):
2341 stor = self.storage_id
2342 assert stor, "No storage for file #%s." % self.file_id
2343@@ -1262,7 +1262,7 @@
2344 else:
2345 self.path = dirpath[0]
2346
2347- def get_data(self, cr, fil_obj = None):
2348+ def get_data(self, cr, fil_obj=None):
2349 """ Retrieve the data for some file.
2350 fil_obj may optionally be specified, and should be a browse object
2351 for the file. This is useful when the caller has already initiated
2352@@ -1278,14 +1278,14 @@
2353 stobj = self.context._dirobj.pool.get('document.storage')
2354 return stobj.get_data(cr, self.context.uid,stor, self,self.context.context, fil_obj)
2355
2356- def get_data_len(self, cr, fil_obj = None):
2357+ def get_data_len(self, cr, fil_obj=None):
2358 # TODO: verify with the storage object!
2359 bin_size = self.context.context.get('bin_size', False)
2360 if bin_size and not self.content_length:
2361 self.content_length = fil_obj.db_datas
2362 return self.content_length
2363
2364- def set_data(self, cr, data, fil_obj = None):
2365+ def set_data(self, cr, data, fil_obj=None):
2366 """ Store data at some file.
2367 fil_obj may optionally be specified, and should be a browse object
2368 for the file. This is useful when the caller has already initiated
2369@@ -1299,7 +1299,7 @@
2370 stobj = self.context._dirobj.pool.get('document.storage')
2371 return stobj.set_data(cr, self.context.uid,stor, self, data, self.context.context, fil_obj)
2372
2373- def _get_ttag(self,cr):
2374+ def _get_ttag(self, cr):
2375 return 'file-%d' % self.file_id
2376
2377 def move_to(self, cr, ndir_node, new_name=False, fil_obj=None, ndir_obj=None, in_write=False):
2378@@ -1362,7 +1362,7 @@
2379
2380 class node_content(node_class):
2381 our_type = 'content'
2382- def __init__(self, path, parent, context, cnt, dctx = None, act_id=None):
2383+ def __init__(self, path, parent, context, cnt, dctx=None, act_id=None):
2384 super(node_content,self).__init__(path, parent,context)
2385 self.cnt_id = cnt.id
2386 self.create_date = False
2387@@ -1382,7 +1382,7 @@
2388 self.dctx.update(dctx)
2389 self.act_id = act_id
2390
2391- def fill_fields(self, cr, dctx = None):
2392+ def fill_fields(self, cr, dctx=None):
2393 """ Try to read the object and fill missing fields, like mimetype,
2394 dates etc.
2395 This function must be different from the constructor, because
2396@@ -1395,8 +1395,7 @@
2397 if res and res[0][0]:
2398 self.mimetype = str(res[0][0])
2399
2400-
2401- def get_data(self, cr, fil_obj = None):
2402+ def get_data(self, cr, fil_obj=None):
2403 cntobj = self.context._dirobj.pool.get('document.directory.content')
2404 if not self.check_perms(4):
2405 raise IOError(errno.EPERM, "Permission denied.")
2406@@ -1426,7 +1425,7 @@
2407
2408 return nodefd_content(self, cr, mode, ctx)
2409
2410- def get_data_len(self, cr, fil_obj = None):
2411+ def get_data_len(self, cr, fil_obj=None):
2412 # FIXME : here, we actually generate the content twice!!
2413 # we should have cached the generated content, but it is
2414 # not advisable to do keep it in memory, until we have a cache
2415@@ -1435,7 +1434,7 @@
2416 self.get_data(cr,fil_obj)
2417 return self.content_length
2418
2419- def set_data(self, cr, data, fil_obj = None):
2420+ def set_data(self, cr, data, fil_obj=None):
2421 cntobj = self.context._dirobj.pool.get('document.directory.content')
2422 if not self.check_perms(2):
2423 raise IOError(errno.EPERM, "Permission denied.")
2424@@ -1444,7 +1443,7 @@
2425 ctx.update(self.dctx)
2426 return cntobj.process_write(cr, self.context.uid, self, data, ctx)
2427
2428- def _get_ttag(self,cr):
2429+ def _get_ttag(self, cr):
2430 return 'cnt-%d%s' % (self.cnt_id,(self.act_id and ('-' + str(self.act_id))) or '')
2431
2432 def get_dav_resourcetype(self, cr):
2433@@ -1558,5 +1557,4 @@
2434 cr.close()
2435 StringIO.close(self)
2436
2437-#eof
2438 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2439
2440=== modified file 'document/odt2txt.py' (properties changed: +x to -x)
2441--- document/odt2txt.py 2011-09-22 09:55:31 +0000
2442+++ document/odt2txt.py 2012-10-02 11:29:53 +0000
2443@@ -24,11 +24,11 @@
2444 import StringIO
2445
2446 class OpenDocumentTextFile :
2447- def __init__ (self, filepath) :
2448+ def __init__ (self, filepath):
2449 zip = zipfile.ZipFile(filepath)
2450 self.content = xml.dom.minidom.parseString(zip.read("content.xml"))
2451
2452- def toString (self) :
2453+ def toString (self):
2454 """ Converts the document to a string. """
2455 buffer = u""
2456 for val in ["text:p", "text:h", "text:list"]:
2457@@ -36,7 +36,7 @@
2458 buffer += self.textToString(paragraph) + "\n"
2459 return buffer
2460
2461- def textToString(self, element) :
2462+ def textToString(self, element):
2463 buffer = u""
2464 for node in element.childNodes :
2465 if node.nodeType == xml.dom.Node.TEXT_NODE :
2466
2467=== modified file 'document/std_index.py'
2468--- document/std_index.py 2012-07-25 10:33:34 +0000
2469+++ document/std_index.py 2012-10-02 11:29:53 +0000
2470@@ -39,7 +39,7 @@
2471 except UnicodeError:
2472 return s
2473
2474-def textToString(element) :
2475+def textToString(element):
2476 buffer = u""
2477 for node in element.childNodes :
2478 if node.nodeType == xml.dom.Node.TEXT_NODE :
2479@@ -56,7 +56,7 @@
2480 def _getExtensions(self):
2481 return ['.txt', '.py']
2482
2483- def _doIndexContent(self,content):
2484+ def _doIndexContent(self, content):
2485 return content
2486
2487 cntIndex.register(TxtIndex())
2488@@ -68,7 +68,7 @@
2489 def _getExtensions(self):
2490 return ['.pptx']
2491
2492- def _doIndexFile(self,fname):
2493+ def _doIndexFile(self, fname):
2494 def toString () :
2495 """ Converts the document to a string. """
2496 buffer = u""
2497@@ -96,7 +96,7 @@
2498 def _getExtensions(self):
2499 return ['.doc']
2500
2501- def _doIndexFile(self,fname):
2502+ def _doIndexFile(self, fname):
2503 try:
2504 pop = Popen(['antiword', fname], shell=False, stdout=PIPE)
2505 (data, _) = pop.communicate()
2506@@ -116,7 +116,7 @@
2507 def _getExtensions(self):
2508 return ['.docx']
2509
2510- def _doIndexFile(self,fname):
2511+ def _doIndexFile(self, fname):
2512 zip = zipfile.ZipFile(fname)
2513 content = xml.dom.minidom.parseString(zip.read("word/document.xml"))
2514 def toString () :
2515@@ -141,7 +141,7 @@
2516 def _getExtensions(self):
2517 return ['.xlsx']
2518
2519- def _doIndexFile(self,fname):
2520+ def _doIndexFile(self, fname):
2521 zip = zipfile.ZipFile(fname)
2522 content = xml.dom.minidom.parseString(zip.read("xl/sharedStrings.xml"))
2523 def toString () :
2524@@ -165,7 +165,7 @@
2525 def _getExtensions(self):
2526 return ['.pdf']
2527
2528- def _doIndexFile(self,fname):
2529+ def _doIndexFile(self, fname):
2530 pop = Popen(['pdftotext', '-enc', 'UTF-8', '-nopgbrk', fname, '-'], shell=False, stdout=PIPE)
2531 (data, _) = pop.communicate()
2532 return _to_unicode(data)
2533@@ -181,7 +181,7 @@
2534 return []
2535 #return ['.png','.jpg','.gif','.jpeg','.bmp','.tiff']
2536
2537- def _doIndexContent(self,content):
2538+ def _doIndexContent(self, content):
2539 return 'image'
2540
2541
2542
2543=== modified file 'document_webdav/document_webdav.py'
2544--- document_webdav/document_webdav.py 2012-08-06 17:08:41 +0000
2545+++ document_webdav/document_webdav.py 2012-10-02 11:29:53 +0000
2546@@ -57,7 +57,7 @@
2547 # TODO group
2548 return
2549
2550- def _locate_child(self, cr, uid, root_id, uri,nparent, ncontext):
2551+ def _locate_child(self, cr, uid, root_id, uri, nparent, ncontext):
2552 """ try to locate the node in uri,
2553 Return a tuple (node_dir, remaining_path)
2554 """
2555
2556=== modified file 'document_webdav/redirect.py'
2557--- document_webdav/redirect.py 2012-06-22 06:48:39 +0000
2558+++ document_webdav/redirect.py 2012-10-02 11:29:53 +0000
2559@@ -30,7 +30,7 @@
2560 _HTTP_OPTIONS = { 'Allow': ['OPTIONS', 'GET', 'HEAD', 'PROPFIND'] }
2561 redirect_paths = {}
2562
2563- def __init__(self,request, client_address, server):
2564+ def __init__(self, request, client_address, server):
2565 HTTPHandler.__init__(self,request,client_address,server)
2566
2567 def send_head(self):
2568
2569=== modified file 'document_webdav/test_davclient.py' (properties changed: +x to -x)
2570--- document_webdav/test_davclient.py 2012-08-31 13:51:36 +0000
2571+++ document_webdav/test_davclient.py 2012-10-02 11:29:53 +0000
2572@@ -683,7 +683,7 @@
2573 assert d2 == d, "Data does not match"
2574 return ctype, rrange, d
2575
2576- def gd_put(self, path, body=None, srcpath=None, mime=None, noclobber=False, ):
2577+ def gd_put(self, path, body=None, srcpath=None, mime=None, noclobber=False):
2578 """ HTTP PUT
2579 @param noclobber will prevent overwritting a resource (If-None-Match)
2580 @param mime will set the content-type
2581@@ -705,5 +705,4 @@
2582 etag = m.getheader('ETag')
2583 return etag or True
2584
2585-#eof
2586 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2587
2588=== modified file 'document_webdav/webdav.py'
2589--- document_webdav/webdav.py 2012-07-13 05:29:57 +0000
2590+++ document_webdav/webdav.py 2012-10-02 11:29:53 +0000
2591@@ -236,7 +236,7 @@
2592 return re
2593
2594
2595-def mk_propname_response(self,uri,propnames,doc):
2596+def mk_propname_response(self, uri, propnames, doc):
2597 """ make a new <prop> result element for a PROPNAME request
2598
2599 This will simply format the propnames list.
2600
2601=== modified file 'document_webdav/webdav_server.py'
2602--- document_webdav/webdav_server.py 2012-08-06 17:08:41 +0000
2603+++ document_webdav/webdav_server.py 2012-10-02 11:29:53 +0000
2604@@ -81,7 +81,7 @@
2605 'DELETE', 'TRACE', 'REPORT', ]
2606 }
2607
2608- def get_userinfo(self,user,pw):
2609+ def get_userinfo(self, user, pw):
2610 return False
2611
2612 def _log(self, message):
2613@@ -167,7 +167,7 @@
2614 self.close_connection = 1
2615 DAVRequestHandler.send_header(self, key, value)
2616
2617- def send_body(self, DATA, code = None, msg = None, desc = None, ctype='application/octet-stream', headers=None):
2618+ def send_body(self, DATA, code=None, msg=None, desc=None, ctype='application/octet-stream', headers=None):
2619 if headers and 'Connection' in headers:
2620 pass
2621 elif self.request_version in ('HTTP/1.0', 'HTTP/0.9'):
2622@@ -441,10 +441,10 @@
2623 def __init__(self, parent):
2624 self.parent = parent
2625
2626- def get_propnames(self,uri):
2627+ def get_propnames(self, uri):
2628 return self.PROPS
2629
2630- def get_prop(self,uri,ns,propname):
2631+ def get_prop(self, uri, ns, propname):
2632 if self.M_NS.has_key(ns):
2633 prefix=self.M_NS[ns]
2634 else:
2635@@ -460,10 +460,10 @@
2636 def get_data(self, uri, range=None):
2637 raise DAV_NotFound
2638
2639- def _get_dav_creationdate(self,uri):
2640+ def _get_dav_creationdate(self, uri):
2641 return time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())
2642
2643- def _get_dav_getlastmodified(self,uri):
2644+ def _get_dav_getlastmodified(self, uri):
2645 return time.strftime("%a, %d %b %Y %H:%M:%S GMT", time.gmtime())
2646
2647 def _get_dav_displayname(self, uri):
2648
2649=== modified file 'email_template/html2text.py' (properties changed: +x to -x)
2650--- email_template/html2text.py 2011-12-19 16:54:40 +0000
2651+++ email_template/html2text.py 2012-10-02 11:29:53 +0000
2652@@ -41,13 +41,13 @@
2653 if k.startswith("&#") and k.endswith(";"): return int(k[2:-1]) # not in latin-1
2654 return ord(codecs.latin_1_decode(k)[0])
2655
2656-unifiable = {'rsquo':"'", 'lsquo':"'", 'rdquo':'"', 'ldquo':'"',
2657+unifiable = {'rsquo':"'", 'lsquo':"'", 'rdquo':'"', 'ldquo':'"',
2658 'copy':'(C)', 'mdash':'--', 'nbsp':' ', 'rarr':'->', 'larr':'<-', 'middot':'*',
2659 'ndash':'-', 'oelig':'oe', 'aelig':'ae',
2660-'agrave':'a', 'aacute':'a', 'acirc':'a', 'atilde':'a', 'auml':'a', 'aring':'a',
2661-'egrave':'e', 'eacute':'e', 'ecirc':'e', 'euml':'e',
2662+'agrave':'a', 'aacute':'a', 'acirc':'a', 'atilde':'a', 'auml':'a', 'aring':'a',
2663+'egrave':'e', 'eacute':'e', 'ecirc':'e', 'euml':'e',
2664 'igrave':'i', 'iacute':'i', 'icirc':'i', 'iuml':'i',
2665-'ograve':'o', 'oacute':'o', 'ocirc':'o', 'otilde':'o', 'ouml':'o',
2666+'ograve':'o', 'oacute':'o', 'ocirc':'o', 'otilde':'o', 'ouml':'o',
2667 'ugrave':'u', 'uacute':'u', 'ucirc':'u', 'uuml':'u'}
2668
2669 unifiable_n = {}
2670@@ -60,7 +60,7 @@
2671 c = int(name[1:], 16)
2672 else:
2673 c = int(name)
2674-
2675+
2676 if not UNICODE_SNOB and c in unifiable_n.keys():
2677 return unifiable_n[c]
2678 else:
2679@@ -76,14 +76,14 @@
2680
2681 def replaceEntities(s):
2682 s = s.group(1)
2683- if s[0] == "#":
2684+ if s[0] == "#":
2685 return charref(s[1:])
2686 else: return entityref(s)
2687
2688 r_unescape = re.compile(r"&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));")
2689 def unescape(s):
2690 return r_unescape.sub(replaceEntities, s)
2691-
2692+
2693 def fixattrs(attrs):
2694 # Fix bug in sgmllib.py
2695 if not attrs: return attrs
2696@@ -105,7 +105,7 @@
2697 """Wrap all paragraphs in the provided text."""
2698 if not BODY_WIDTH:
2699 return text
2700-
2701+
2702 assert wrap, "Requires Python 2.3."
2703 result = ''
2704 newlines = 0
2705@@ -136,7 +136,7 @@
2706 class _html2text(sgmllib.SGMLParser):
2707 def __init__(self, out=sys.stdout.write, baseurl=''):
2708 sgmllib.SGMLParser.__init__(self)
2709-
2710+
2711 if out is None: self.out = self.outtextf
2712 else: self.out = out
2713 self.outtext = u''
2714@@ -157,43 +157,43 @@
2715 self.abbr_data = None # last inner HTML (for abbr being defined)
2716 self.abbr_list = {} # stack of abbreviations to write later
2717 self.baseurl = baseurl
2718-
2719- def outtextf(self, s):
2720+
2721+ def outtextf(self, s):
2722 self.outtext += s
2723-
2724+
2725 def close(self):
2726 sgmllib.SGMLParser.close(self)
2727-
2728+
2729 self.pbr()
2730 self.o('', 0, 'end')
2731-
2732+
2733 return self.outtext
2734-
2735+
2736 def handle_charref(self, c):
2737 self.o(charref(c))
2738
2739 def handle_entityref(self, c):
2740 self.o(entityref(c))
2741-
2742+
2743 def unknown_starttag(self, tag, attrs):
2744 self.handle_tag(tag, attrs, 1)
2745-
2746+
2747 def unknown_endtag(self, tag):
2748 self.handle_tag(tag, None, 0)
2749-
2750+
2751 def previousIndex(self, attrs):
2752 """ returns the index of certain set of attributes (of a link) in the
2753 self.a list
2754-
2755+
2756 If the set of attributes is not found, returns None
2757 """
2758 if not attrs.has_key('href'): return None
2759-
2760+
2761 i = -1
2762 for a in self.a:
2763 i += 1
2764 match = 0
2765-
2766+
2767 if a.has_key('href') and a['href'] == attrs['href']:
2768 if a.has_key('title') or attrs.has_key('title'):
2769 if (a.has_key('title') and attrs.has_key('title') and
2770@@ -206,13 +206,13 @@
2771
2772 def handle_tag(self, tag, attrs, start):
2773 attrs = fixattrs(attrs)
2774-
2775+
2776 if hn(tag):
2777 self.p()
2778 if start: self.o(hn(tag)*"#" + ' ')
2779
2780 if tag in ['p', 'div']: self.p()
2781-
2782+
2783 if tag == "br" and start: self.o(" \n")
2784
2785 if tag == "hr" and start:
2786@@ -220,21 +220,21 @@
2787 self.o("* * *")
2788 self.p()
2789
2790- if tag in ["head", "style", 'script']:
2791+ if tag in ["head", "style", 'script']:
2792 if start: self.quiet += 1
2793 else: self.quiet -= 1
2794
2795 if tag in ["body"]:
2796 self.quiet = 0 # sites like 9rules.com never close <head>
2797-
2798+
2799 if tag == "blockquote":
2800- if start:
2801+ if start:
2802 self.p(); self.o('> ', 0, 1); self.start = 1
2803 self.blockquote += 1
2804 else:
2805 self.blockquote -= 1
2806 self.p()
2807-
2808+
2809 if tag in ['em', 'i', 'u']: self.o("_")
2810 if tag in ['strong', 'b']: self.o("**")
2811 if tag == "code" and not self.pre: self.o('`') #TODO: `` `this` ``
2812@@ -243,7 +243,7 @@
2813 attrsD = {}
2814 for (x, y) in attrs: attrsD[x] = y
2815 attrs = attrsD
2816-
2817+
2818 self.abbr_title = None
2819 self.abbr_data = ''
2820 if attrs.has_key('title'):
2821@@ -253,13 +253,13 @@
2822 self.abbr_list[self.abbr_data] = self.abbr_title
2823 self.abbr_title = None
2824 self.abbr_data = ''
2825-
2826+
2827 if tag == "a":
2828 if start:
2829 attrsD = {}
2830 for (x, y) in attrs: attrsD[x] = y
2831 attrs = attrsD
2832- if attrs.has_key('href') and not (SKIP_INTERNAL_LINKS and attrs['href'].startswith('#')):
2833+ if attrs.has_key('href') and not (SKIP_INTERNAL_LINKS and attrs['href'].startswith('#')):
2834 self.astack.append(attrs)
2835 self.o("[")
2836 else:
2837@@ -277,7 +277,7 @@
2838 a['outcount'] = self.outcount
2839 self.a.append(a)
2840 self.o("][" + `a['count']` + "]")
2841-
2842+
2843 if tag == "img" and start:
2844 attrsD = {}
2845 for (x, y) in attrs: attrsD[x] = y
2846@@ -296,20 +296,20 @@
2847 self.o("![")
2848 self.o(alt)
2849 self.o("]["+`attrs['count']`+"]")
2850-
2851+
2852 if tag == 'dl' and start: self.p()
2853 if tag == 'dt' and not start: self.pbr()
2854 if tag == 'dd' and start: self.o(' ')
2855 if tag == 'dd' and not start: self.pbr()
2856-
2857+
2858 if tag in ["ol", "ul"]:
2859 if start:
2860 self.list.append({'name':tag, 'num':0})
2861 else:
2862 if self.list: self.list.pop()
2863-
2864+
2865 self.p()
2866-
2867+
2868 if tag == 'li':
2869 if start:
2870 self.pbr()
2871@@ -323,10 +323,10 @@
2872 self.start = 1
2873 else:
2874 self.pbr()
2875-
2876+
2877 if tag in ["table", "tr"] and start: self.p()
2878 if tag == 'td': self.pbr()
2879-
2880+
2881 if tag == "pre":
2882 if start:
2883 self.startpre = 1
2884@@ -334,34 +334,35 @@
2885 else:
2886 self.pre = 0
2887 self.p()
2888-
2889+
2890 def pbr(self):
2891 if self.p_p == 0: self.p_p = 1
2892
2893- def p(self): self.p_p = 2
2894-
2895+ def p(self):
2896+ self.p_p = 2
2897+
2898 def o(self, data, puredata=0, force=0):
2899 if self.abbr_data is not None: self.abbr_data += data
2900-
2901- if not self.quiet:
2902+
2903+ if not self.quiet:
2904 if puredata and not self.pre:
2905 data = re.sub('\s+', ' ', data)
2906 if data and data[0] == ' ':
2907 self.space = 1
2908 data = data[1:]
2909 if not data and not force: return
2910-
2911+
2912 if self.startpre:
2913 #self.out(" :") #TODO: not output when already one there
2914 self.startpre = 0
2915-
2916+
2917 bq = (">" * self.blockquote)
2918 if not (force and data and data[0] == ">") and self.blockquote: bq += " "
2919-
2920+
2921 if self.pre:
2922 bq += " "
2923 data = data.replace("\n", "\n"+bq)
2924-
2925+
2926 if self.start:
2927 self.space = 0
2928 self.p_p = 0
2929@@ -377,7 +378,7 @@
2930 if self.p_p:
2931 self.out(('\n'+bq)*self.p_p)
2932 self.space = 0
2933-
2934+
2935 if self.space:
2936 if not self.lastWasNL: self.out(' ')
2937 self.space = 0
2938@@ -388,7 +389,7 @@
2939 newa = []
2940 for link in self.a:
2941 if self.outcount > link['outcount']:
2942- self.out(" ["+`link['count']`+"]: " + urlparse.urljoin(self.baseurl, link['href']))
2943+ self.out(" ["+`link['count']`+"]: " + urlparse.urljoin(self.baseurl, link['href']))
2944 if link.has_key('title'): self.out(" ("+link['title']+")")
2945 self.out("\n")
2946 else:
2947@@ -397,7 +398,7 @@
2948 if self.a != newa: self.out("\n") # Don't need an extra line when nothing was done.
2949
2950 self.a = newa
2951-
2952+
2953 if self.abbr_list and force == "end":
2954 for abbr, definition in self.abbr_list.items():
2955 self.out(" *[" + abbr + "]: " + definition + "\n")
2956@@ -410,8 +411,9 @@
2957 def handle_data(self, data):
2958 if r'\/script>' in data: self.quiet -= 1
2959 self.o(data, 1)
2960-
2961- def unknown_decl(self, data): pass
2962+
2963+ def unknown_decl(self, data):
2964+ pass
2965
2966 def wrapwrite(text): sys.stdout.write(text.encode('utf8'))
2967
2968
2969=== modified file 'event/event.py'
2970--- event/event.py 2012-09-17 16:33:01 +0000
2971+++ event/event.py 2012-10-02 11:29:53 +0000
2972@@ -223,6 +223,7 @@
2973 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'event.event', context=c),
2974 'user_id': lambda obj, cr, uid, context: uid,
2975 }
2976+
2977 def subscribe_to_event(self, cr, uid, ids, context=None):
2978 register_pool = self.pool.get('event.registration')
2979 user_pool = self.pool.get('res.users')
2980@@ -252,6 +253,7 @@
2981 _constraints = [
2982 (_check_closing_date, 'Error ! Closing Date cannot be set before Beginning Date.', ['date_end']),
2983 ]
2984+
2985 def onchange_event_type(self, cr, uid, ids, type_event, context=None):
2986 if type_event:
2987 type_info = self.pool.get('event.type').browse(cr,uid,type_event,context)
2988@@ -347,7 +349,6 @@
2989 'phone': fields.char('Phone', size=64),
2990 'name': fields.char('Name', size=128, select=True),
2991 }
2992-
2993 _defaults = {
2994 'nb_register': 1,
2995 'state': 'draft',
2996
2997=== modified file 'event/report/__init__.py'
2998--- event/report/__init__.py 2011-01-14 00:11:01 +0000
2999+++ event/report/__init__.py 2012-10-02 11:29:53 +0000
3000@@ -21,4 +21,4 @@
3001
3002 import report_event_registration
3003
3004-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3005\ No newline at end of file
3006+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3007
3008=== modified file 'event/wizard/event_confirm.py'
3009--- event/wizard/event_confirm.py 2011-01-14 00:11:01 +0000
3010+++ event/wizard/event_confirm.py 2012-10-02 11:29:53 +0000
3011@@ -34,4 +34,4 @@
3012
3013 event_confirm()
3014
3015-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3016\ No newline at end of file
3017+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3018
3019=== modified file 'event_moodle/event_moodle.py'
3020--- event_moodle/event_moodle.py 2012-09-26 07:45:27 +0000
3021+++ event_moodle/event_moodle.py 2012-10-02 11:29:53 +0000
3022@@ -127,7 +127,7 @@
3023 passwd = passwd + '+'
3024 return passwd
3025
3026- def check_email(self,email):
3027+ def check_email(self, email):
3028
3029 """
3030 check if email is correct
3031
3032=== modified file 'event_project/event_project.py'
3033--- event_project/event_project.py 2011-01-14 00:11:01 +0000
3034+++ event_project/event_project.py 2012-10-02 11:29:53 +0000
3035@@ -55,4 +55,4 @@
3036
3037 event()
3038
3039-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3040\ No newline at end of file
3041+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3042
3043=== modified file 'event_project/wizard/event_project_retro.py'
3044--- event_project/wizard/event_project_retro.py 2011-01-14 00:11:01 +0000
3045+++ event_project/wizard/event_project_retro.py 2012-10-02 11:29:53 +0000
3046@@ -80,4 +80,4 @@
3047
3048 event_project()
3049
3050-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3051\ No newline at end of file
3052+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3053
3054=== modified file 'hr_attendance/wizard/hr_attendance_bymonth.py'
3055--- hr_attendance/wizard/hr_attendance_bymonth.py 2011-12-16 05:52:38 +0000
3056+++ hr_attendance/wizard/hr_attendance_bymonth.py 2012-10-02 11:29:53 +0000
3057@@ -50,4 +50,4 @@
3058
3059 hr_attendance_bymonth()
3060
3061-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3062\ No newline at end of file
3063+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3064
3065=== modified file 'hr_attendance/wizard/hr_attendance_byweek.py'
3066--- hr_attendance/wizard/hr_attendance_byweek.py 2011-01-14 00:11:01 +0000
3067+++ hr_attendance/wizard/hr_attendance_byweek.py 2012-10-02 11:29:53 +0000
3068@@ -48,4 +48,4 @@
3069
3070 hr_attendance_byweek()
3071
3072-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3073\ No newline at end of file
3074+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3075
3076=== modified file 'hr_attendance/wizard/hr_attendance_error.py'
3077--- hr_attendance/wizard/hr_attendance_error.py 2012-07-25 12:13:54 +0000
3078+++ hr_attendance/wizard/hr_attendance_error.py 2012-10-02 11:29:53 +0000
3079@@ -66,4 +66,4 @@
3080
3081 hr_attendance_error()
3082
3083-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3084\ No newline at end of file
3085+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3086
3087=== modified file 'hr_evaluation/hr_evaluation.py'
3088--- hr_evaluation/hr_evaluation.py 2012-09-27 04:10:11 +0000
3089+++ hr_evaluation/hr_evaluation.py 2012-10-02 11:29:53 +0000
3090@@ -43,6 +43,7 @@
3091 'month_next': 12,
3092 'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'account.account', context=c),
3093 }
3094+
3095 hr_evaluation_plan()
3096
3097 class hr_evaluation_plan_phase(osv.osv):
3098@@ -95,6 +96,7 @@
3099
3100 '''),
3101 }
3102+
3103 hr_evaluation_plan_phase()
3104
3105 class hr_employee(osv.osv):
3106@@ -210,8 +212,6 @@
3107 elif phase.action == "self":
3108 children = [evaluation.employee_id]
3109 for child in children:
3110-# if not child.user_id:
3111-# continue
3112
3113 int_id = hr_eval_inter_obj.create(cr, uid, {
3114 'evaluation_id': evaluation.id,
3115@@ -250,7 +250,7 @@
3116 raise osv.except_osv(_('Warning!'),_("You cannot change state, because some appraisal(s) are in waiting answer or draft state."))
3117 return True
3118
3119- def button_done(self,cr, uid, ids, context=None):
3120+ def button_done(self, cr, uid, ids, context=None):
3121 self.write(cr, uid, ids,{'state':'done', 'date_close': time.strftime('%Y-%m-%d')}, context=context)
3122 return True
3123
3124
3125=== modified file 'hr_payroll/report/report_contribution_register.py'
3126--- hr_payroll/report/report_contribution_register.py 2011-06-29 09:20:32 +0000
3127+++ hr_payroll/report/report_contribution_register.py 2012-10-02 11:29:53 +0000
3128@@ -72,4 +72,4 @@
3129
3130 report_sxw.report_sxw('report.contribution.register.lines', 'hr.contribution.register', 'hr_payroll/report/report_contribution_register.rml', parser=contribution_register_report)
3131
3132-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3133\ No newline at end of file
3134+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3135
3136=== modified file 'hr_payroll/report/report_payslip.py'
3137--- hr_payroll/report/report_payslip.py 2011-12-19 16:54:40 +0000
3138+++ hr_payroll/report/report_payslip.py 2012-10-02 11:29:53 +0000
3139@@ -46,4 +46,4 @@
3140
3141 report_sxw.report_sxw('report.payslip', 'hr.payslip', 'hr_payroll/report/report_payslip.rml', parser=payslip_report)
3142
3143-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3144\ No newline at end of file
3145+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3146
3147=== modified file 'hr_payroll/report/report_payslip_details.py'
3148--- hr_payroll/report/report_payslip_details.py 2012-07-19 12:03:11 +0000
3149+++ hr_payroll/report/report_payslip_details.py 2012-10-02 11:29:53 +0000
3150@@ -116,4 +116,4 @@
3151
3152 report_sxw.report_sxw('report.paylip.details', 'hr.payslip', 'hr_payroll/report/report_payslip_details.rml', parser=payslip_details_report)
3153
3154-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3155\ No newline at end of file
3156+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3157
3158=== modified file 'hr_payroll_account/__init__.py'
3159--- hr_payroll_account/__init__.py 2011-09-15 05:45:39 +0000
3160+++ hr_payroll_account/__init__.py 2012-10-02 11:29:53 +0000
3161@@ -23,4 +23,4 @@
3162 import hr_payroll_account
3163 import wizard
3164
3165-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3166\ No newline at end of file
3167+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3168
3169=== modified file 'hr_payroll_account/wizard/__init__.py'
3170--- hr_payroll_account/wizard/__init__.py 2011-09-15 05:45:39 +0000
3171+++ hr_payroll_account/wizard/__init__.py 2012-10-02 11:29:53 +0000
3172@@ -22,4 +22,4 @@
3173
3174 import hr_payroll_payslips_by_employees
3175
3176-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3177\ No newline at end of file
3178+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3179
3180=== modified file 'hr_payroll_account/wizard/hr_payroll_payslips_by_employees.py'
3181--- hr_payroll_account/wizard/hr_payroll_payslips_by_employees.py 2012-08-16 10:42:15 +0000
3182+++ hr_payroll_account/wizard/hr_payroll_payslips_by_employees.py 2012-10-02 11:29:53 +0000
3183@@ -38,4 +38,4 @@
3184
3185 hr_payslip_employees()
3186
3187-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3188\ No newline at end of file
3189+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3190
3191=== modified file 'hr_recruitment/hr_recruitment.py'
3192--- hr_recruitment/hr_recruitment.py 2012-09-16 15:18:26 +0000
3193+++ hr_recruitment/hr_recruitment.py 2012-10-02 11:29:53 +0000
3194@@ -243,7 +243,7 @@
3195 'stage_id': _read_group_stage_ids
3196 }
3197
3198- def onchange_job(self,cr, uid, ids, job, context=None):
3199+ def onchange_job(self, cr, uid, ids, job, context=None):
3200 result = {}
3201
3202 if job:
3203@@ -494,7 +494,6 @@
3204 message = _("Applicant has been <b>created</b>.")
3205 return self.message_post(cr, uid, ids, body=message, context=context)
3206
3207-
3208 class hr_job(osv.osv):
3209 _inherit = "hr.job"
3210 _name = "hr.job"
3211@@ -505,7 +504,6 @@
3212 help="Email alias for this job position. New emails will automatically "
3213 "create new applicants for this job position."),
3214 }
3215-
3216 _defaults = {
3217 'alias_domain': False, # always hide alias during creation
3218 }
3219@@ -548,12 +546,12 @@
3220 datas['model'] = 'survey.print'
3221 context.update({'response_id': [0], 'response_no': 0,})
3222 return {
3223- 'type': 'ir.actions.report.xml',
3224- 'report_name': 'survey.form',
3225- 'datas': datas,
3226- 'context' : context,
3227- 'nodestroy':True,
3228- }
3229+ 'type': 'ir.actions.report.xml',
3230+ 'report_name': 'survey.form',
3231+ 'datas': datas,
3232+ 'context' : context,
3233+ 'nodestroy':True,
3234+ }
3235
3236 class applicant_category(osv.osv):
3237 """ Category of applicant """
3238
3239=== modified file 'hr_recruitment/wizard/hr_recruitment_create_partner_job.py'
3240--- hr_recruitment/wizard/hr_recruitment_create_partner_job.py 2012-08-07 11:31:37 +0000
3241+++ hr_recruitment/wizard/hr_recruitment_create_partner_job.py 2012-10-02 11:29:53 +0000
3242@@ -29,7 +29,7 @@
3243 'close': fields.boolean('Close job request'),
3244 }
3245
3246- def view_init(self, cr , uid , fields_list, context=None):
3247+ def view_init(self, cr, uid, fields_list, context=None):
3248 case_obj = self.pool.get('hr.applicant')
3249 if context is None:
3250 context = {}
3251
3252=== modified file 'hr_recruitment/wizard/hr_recruitment_employee_hired.py'
3253--- hr_recruitment/wizard/hr_recruitment_employee_hired.py 2011-11-17 10:53:01 +0000
3254+++ hr_recruitment/wizard/hr_recruitment_employee_hired.py 2012-10-02 11:29:53 +0000
3255@@ -26,7 +26,7 @@
3256 _name = 'hired.employee'
3257 _description = 'Create Employee'
3258
3259- def case_close(self, cr, uid,ids, context=None):
3260+ def case_close(self, cr, uid, ids, context=None):
3261 """
3262 @param self: The object pointer
3263 @param cr: the current row, from the database cursor,
3264@@ -39,7 +39,7 @@
3265 self.pool.get('hr.applicant').case_close(cr, uid,context.get('active_ids',[]))
3266 return {}
3267
3268- def case_close_with_emp(self, cr, uid,ids, context=None):
3269+ def case_close_with_emp(self, cr, uid, ids, context=None):
3270 """
3271 @param self: The object pointer
3272 @param cr: the current row, from the database cursor,
3273
3274=== modified file 'hr_timesheet_invoice/hr_timesheet_invoice.py'
3275--- hr_timesheet_invoice/hr_timesheet_invoice.py 2012-09-07 07:31:52 +0000
3276+++ hr_timesheet_invoice/hr_timesheet_invoice.py 2012-10-02 11:29:53 +0000
3277@@ -84,7 +84,7 @@
3278 res['value']['to_invoice'] = ir_model_obj.get_object_reference(cr, uid, 'hr_timesheet_invoice', 'timesheet_invoice_factor1')[1]
3279 return res
3280
3281- def on_change_partner_id(self, cr, uid, ids,partner_id, name, context=None):
3282+ def on_change_partner_id(self, cr, uid, ids, partner_id, name, context=None):
3283 res = super(account_analytic_account,self).on_change_partner_id(cr, uid, ids,partner_id, name, context=context)
3284 part = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
3285 pricelist = part.property_product_pricelist and part.property_product_pricelist.id or False
3286@@ -199,6 +199,7 @@
3287
3288 hr_analytic_timesheet()
3289
3290+
3291 class account_invoice(osv.osv):
3292 _inherit = "account.invoice"
3293
3294@@ -218,6 +219,7 @@
3295
3296 account_invoice()
3297
3298+
3299 class account_move_line(osv.osv):
3300 _inherit = "account.move.line"
3301
3302@@ -234,4 +236,3 @@
3303 account_move_line()
3304
3305 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3306-
3307
3308=== modified file 'hr_timesheet_invoice/report/account_analytic_profit.py'
3309--- hr_timesheet_invoice/report/account_analytic_profit.py 2011-01-14 00:11:01 +0000
3310+++ hr_timesheet_invoice/report/account_analytic_profit.py 2012-10-02 11:29:53 +0000
3311@@ -120,4 +120,4 @@
3312
3313 report_sxw.report_sxw('report.account.analytic.profit', 'account.analytic.line', 'addons/hr_timesheet_invoice/report/account_analytic_profit.rml', parser=account_analytic_profit)
3314
3315-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3316\ No newline at end of file
3317+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3318
3319=== modified file 'hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py'
3320--- hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py 2012-09-29 13:29:07 +0000
3321+++ hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py 2012-10-02 11:29:53 +0000
3322@@ -38,7 +38,7 @@
3323 # 'price': boolean
3324 # 'product': many2one id
3325 # }
3326- def invoice_cost_create(self, cr, uid, ids, data={}, context=None):
3327+ def invoice_cost_create(self, cr, uid, ids, data=None, context=None):
3328 analytic_account_obj = self.pool.get('account.analytic.account')
3329 res_partner_obj = self.pool.get('res.partner')
3330 account_payment_term_obj = self.pool.get('account.payment.term')
3331@@ -52,6 +52,8 @@
3332 invoices = []
3333 if context is None:
3334 context = {}
3335+ if data is None:
3336+ data = {}
3337
3338 account_ids = {}
3339 for line in self.pool.get('account.analytic.line').browse(cr, uid, ids, context=context):
3340@@ -86,14 +88,14 @@
3341 'date_due': date_due,
3342 'fiscal_position': account.partner_id.property_account_position.id
3343 }
3344-
3345+
3346 context2 = context.copy()
3347 context2['lang'] = partner.lang
3348- # set company_id in context, so the correct default journal will be selected
3349+ # set company_id in context, so the correct default journal will be selected
3350 context2['force_company'] = curr_invoice['company_id']
3351- # set force_company in context so the correct product properties are selected (eg. income account)
3352+ # set force_company in context so the correct product properties are selected (eg. income account)
3353 context2['company_id'] = curr_invoice['company_id']
3354-
3355+
3356 last_invoice = invoice_obj.create(cr, uid, curr_invoice, context=context2)
3357 invoices.append(last_invoice)
3358
3359
3360=== modified file 'hr_timesheet_sheet/hr_timesheet_sheet.py'
3361--- hr_timesheet_sheet/hr_timesheet_sheet.py 2012-09-27 19:10:59 +0000
3362+++ hr_timesheet_sheet/hr_timesheet_sheet.py 2012-10-02 11:29:53 +0000
3363@@ -358,7 +358,7 @@
3364 'department_id':fields.many2one('hr.department','Department'),
3365 }
3366
3367- def _default_date_from(self,cr, uid, context=None):
3368+ def _default_date_from(self, cr, uid, context=None):
3369 user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
3370 r = user.company_id and user.company_id.timesheet_range or 'month'
3371 if r=='month':
3372@@ -369,7 +369,7 @@
3373 return time.strftime('%Y-01-01')
3374 return time.strftime('%Y-%m-%d')
3375
3376- def _default_date_to(self,cr, uid, context=None):
3377+ def _default_date_to(self, cr, uid, context=None):
3378 user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
3379 r = user.company_id and user.company_id.timesheet_range or 'month'
3380 if r=='month':
3381
3382=== modified file 'hr_timesheet_sheet/wizard/hr_timesheet_current.py'
3383--- hr_timesheet_sheet/wizard/hr_timesheet_current.py 2012-08-07 11:31:37 +0000
3384+++ hr_timesheet_sheet/wizard/hr_timesheet_current.py 2012-10-02 11:29:53 +0000
3385@@ -61,4 +61,4 @@
3386
3387 hr_timesheet_current_open()
3388
3389-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3390\ No newline at end of file
3391+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3392
3393=== modified file 'idea/idea.py'
3394--- idea/idea.py 2012-08-17 10:03:02 +0000
3395+++ idea/idea.py 2012-10-02 11:29:53 +0000
3396@@ -39,6 +39,7 @@
3397 ('name', 'unique(name)', 'The name of the category must be unique' )
3398 ]
3399 _order = 'name asc'
3400+
3401 idea_category()
3402
3403 class idea_idea(osv.osv):
3404@@ -65,24 +66,24 @@
3405 }
3406 _order = 'name asc'
3407
3408- def idea_cancel(self, cr, uid, ids, context={}):
3409+ def idea_cancel(self, cr, uid, ids, context=None):
3410 self.write(cr, uid, ids, { 'state': 'cancel' })
3411 self.message_post(cr, uid, ids, body=_('Idea canceled.'), context=context)
3412 return True
3413
3414- def idea_open(self, cr, uid, ids, context={}):
3415+ def idea_open(self, cr, uid, ids, context=None):
3416 self.write(cr, uid, ids, { 'state': 'open'})
3417 self.message_post(cr, uid, ids, body=_('Idea accepted.'), context=context)
3418 return True
3419
3420- def idea_close(self, cr, uid, ids, context={}):
3421+ def idea_close(self, cr, uid, ids, context=None):
3422 self.message_post(cr, uid, ids, body=_('Idea done.'), context=context)
3423 self.write(cr, uid, ids, { 'state': 'close' })
3424 return True
3425
3426- def idea_draft(self, cr, uid, ids, context={}):
3427+ def idea_draft(self, cr, uid, ids, context=None):
3428 self.message_post(cr, uid, ids, body=_('Idea reset to draft.'), context=context)
3429 self.write(cr, uid, ids, { 'state': 'draft' })
3430 return True
3431+
3432 idea_idea()
3433-
3434
3435=== modified file 'import_base/import_framework.py'
3436--- import_base/import_framework.py 2012-09-13 09:37:17 +0000
3437+++ import_base/import_framework.py 2012-10-02 11:29:53 +0000
3438@@ -227,7 +227,7 @@
3439 return map
3440
3441
3442- def _fields_mapp(self,dict_sugar, openerp_dict, table):
3443+ def _fields_mapp(self, dict_sugar, openerp_dict, table):
3444 """
3445 call all the mapper and transform data
3446 to be compatible with import_data
3447
3448=== modified file 'import_sugarcrm/import_sugarcrm.py'
3449--- import_sugarcrm/import_sugarcrm.py 2012-09-07 11:44:36 +0000
3450+++ import_sugarcrm/import_sugarcrm.py 2012-10-02 11:29:53 +0000
3451@@ -253,7 +253,7 @@
3452 val['datas_fname'] = Filename
3453 return val
3454
3455- def get_history_mapping(self):
3456+ def get_history_mapping(self):
3457 return {
3458 'model' : 'ir.attachment',
3459 '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],
3460@@ -301,7 +301,7 @@
3461 val['email_from'] = partner_email
3462 return val
3463
3464- def get_crm_claim_mapping(self):
3465+ def get_crm_claim_mapping(self):
3466 return {
3467 'model' : 'crm.claim',
3468 'dependencies' : [self.TABLE_USER, self.TABLE_ACCOUNT, self.TABLE_CONTACT, self.TABLE_LEAD],
3469@@ -602,7 +602,7 @@
3470 partner_contact_email = address.email
3471 return partner_contact_id, partner_contact_email
3472
3473- def import_opp(self, val):
3474+ def import_opp(self, val):
3475 partner_contact_id, partner_contact_email = self.import_opportunity_contact(val)
3476 val['partner_address_id/id'] = partner_contact_id
3477 val['email_from'] = partner_contact_email
3478
3479=== modified file 'l10n_be/__init__.py'
3480--- l10n_be/__init__.py 2012-09-13 09:28:14 +0000
3481+++ l10n_be/__init__.py 2012-10-02 11:29:53 +0000
3482@@ -21,4 +21,4 @@
3483
3484 import wizard
3485
3486-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3487\ No newline at end of file
3488+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3489
3490=== modified file 'l10n_be_coda/l10n_be_coda.py'
3491--- l10n_be_coda/l10n_be_coda.py 2012-09-25 07:32:01 +0000
3492+++ l10n_be_coda/l10n_be_coda.py 2012-10-02 11:29:53 +0000
3493@@ -171,6 +171,7 @@
3494 'parent_id': fields.many2one('account.coda.trans.type', 'Parent'),
3495 'description': fields.text('Description', translate=True),
3496 }
3497+
3498 account_coda_trans_type()
3499
3500 class account_coda_trans_code(osv.osv):
3501@@ -187,6 +188,7 @@
3502 'description': fields.char('Description', size=128, translate=True, select=2),
3503 'comment': fields.text('Comment', translate=True),
3504 }
3505+
3506 account_coda_trans_code()
3507
3508 class account_coda_trans_category(osv.osv):
3509@@ -197,6 +199,7 @@
3510 'category': fields.char('Transaction Category', size=3, required=True),
3511 'description': fields.char('Description', size=256, translate=True),
3512 }
3513+
3514 account_coda_trans_category()
3515
3516 class account_coda_comm_type(osv.osv):
3517@@ -209,14 +212,17 @@
3518 }
3519 _sql_constraints = [
3520 ('code_uniq', 'unique (code)','The Structured Communication Code must be unique !')
3521- ]
3522+ ]
3523+
3524 account_coda_comm_type()
3525
3526 class coda_bank_statement(osv.osv):
3527 _name = 'coda.bank.statement'
3528 _description = 'CODA Bank Statement'
3529
3530- def _default_journal_id(self, cr, uid, context={}):
3531+ def _default_journal_id(self, cr, uid, context=None):
3532+ if context is None:
3533+ context = {}
3534 if context.get('journal_id', False):
3535 return context['journal_id']
3536 return False
3537@@ -232,7 +238,7 @@
3538 res[r] = round(res[r], 2)
3539 return res
3540
3541- def _get_period(self, cr, uid, context={}):
3542+ def _get_period(self, cr, uid, context=None):
3543 periods = self.pool.get('account.period').find(cr, uid)
3544 if periods:
3545 return periods[0]
3546@@ -404,6 +410,7 @@
3547 _columns = {
3548 'coda_statement_line_ids': fields.one2many('coda.bank.statement.line', 'globalisation_id', 'CODA Bank Statement Lines', readonly=True),
3549 }
3550+
3551 account_bank_statement_line_global()
3552
3553 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3554
3555=== modified file 'l10n_be_invoice_bba/invoice.py'
3556--- l10n_be_invoice_bba/invoice.py 2012-07-18 12:26:36 +0000
3557+++ l10n_be_invoice_bba/invoice.py 2012-10-02 11:29:53 +0000
3558@@ -2,9 +2,9 @@
3559 ##############################################################################
3560 #
3561 # OpenERP, Open Source Management Solution
3562-#
3563+#
3564 # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
3565-#
3566+#
3567 # This program is free software: you can redistribute it and/or modify
3568 # it under the terms of the GNU Affero General Public License as
3569 # published by the Free Software Foundation, either version 3 of the
3570@@ -36,23 +36,23 @@
3571 _inherit = 'account.invoice'
3572
3573 def _get_reference_type(self, cursor, user, context=None):
3574- """Add BBA Structured Communication Type and change labels from 'reference' into 'communication' """
3575+ """Add BBA Structured Communication Type and change labels from 'reference' into 'communication' """
3576 res = super(account_invoice, self)._get_reference_type(cursor, user,
3577 context=context)
3578 res[[i for i,x in enumerate(res) if x[0] == 'none'][0]] = ('none', 'Free Communication')
3579 res.append(('bba', 'BBA Structured Communication'))
3580- #l_logger.warning('reference_type = %s' %res )
3581+ #l_logger.warning('reference_type = %s' %res )
3582 return res
3583
3584- def check_bbacomm(self, val):
3585+ def check_bbacomm(self, val):
3586 supported_chars = '0-9+*/ '
3587 pattern = re.compile('[^' + supported_chars + ']')
3588 if pattern.findall(val or ''):
3589- return False
3590+ return False
3591 bbacomm = re.sub('\D', '', val or '')
3592 if len(bbacomm) == 12:
3593 base = int(bbacomm[:10])
3594- mod = base % 97 or 97
3595+ mod = base % 97 or 97
3596 if mod == int(bbacomm[-2:]):
3597 return True
3598 return False
3599@@ -64,29 +64,29 @@
3600 return True
3601
3602 def onchange_partner_id(self, cr, uid, ids, type, partner_id,
3603- date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False):
3604+ date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False):
3605 result = super(account_invoice, self).onchange_partner_id(cr, uid, ids, type, partner_id,
3606 date_invoice, payment_term, partner_bank_id, company_id)
3607 # reference_type = self.default_get(cr, uid, ['reference_type'])['reference_type']
3608 # _logger.warning('partner_id %s' % partner_id)
3609 reference = False
3610 reference_type = 'none'
3611- if partner_id:
3612+ if partner_id:
3613 if (type == 'out_invoice'):
3614 reference_type = self.pool.get('res.partner').browse(cr, uid, partner_id).out_inv_comm_type
3615 if reference_type:
3616 reference = self.generate_bbacomm(cr, uid, ids, type, reference_type, partner_id, '', context={})['value']['reference']
3617- res_update = {
3618+ res_update = {
3619 'reference_type': reference_type or 'none',
3620 'reference': reference,
3621 }
3622 result['value'].update(res_update)
3623- return result
3624+ return result
3625
3626 def generate_bbacomm(self, cr, uid, ids, type, reference_type, partner_id, reference, context=None):
3627 partner_obj = self.pool.get('res.partner')
3628- reference = reference or ''
3629- algorithm = False
3630+ reference = reference or ''
3631+ algorithm = False
3632 if partner_id:
3633 algorithm = partner_obj.browse(cr, uid, partner_id, context=context).out_inv_comm_algorithm
3634 algorithm = algorithm or 'random'
3635@@ -97,7 +97,7 @@
3636 doy = time.strftime('%j')
3637 year = time.strftime('%Y')
3638 seq = '001'
3639- seq_ids = self.search(cr, uid,
3640+ seq_ids = self.search(cr, uid,
3641 [('type', '=', 'out_invoice'), ('reference_type', '=', 'bba'),
3642 ('reference', 'like', '+++%s/%s/%%' % (doy, year))], order='reference')
3643 if seq_ids:
3644@@ -110,7 +110,7 @@
3645 '\nPlease create manually a unique BBA Structured Communication.'))
3646 bbacomm = doy + year + seq
3647 base = int(bbacomm)
3648- mod = base % 97 or 97
3649+ mod = base % 97 or 97
3650 reference = '+++%s/%s/%s%02d+++' % (doy, year, seq, mod)
3651 elif algorithm == 'partner_ref':
3652 if not self.check_bbacomm(reference):
3653@@ -119,13 +119,13 @@
3654 if (len(partner_ref_nr) < 3) or (len(partner_ref_nr) > 7):
3655 raise osv.except_osv(_('Warning!'),
3656 _('The Partner should have a 3-7 digit Reference Number for the generation of BBA Structured Communications!' \
3657- '\nPlease correct the Partner record.'))
3658+ '\nPlease correct the Partner record.'))
3659 else:
3660 partner_ref_nr = partner_ref_nr.ljust(7, '0')
3661 seq = '001'
3662- seq_ids = self.search(cr, uid,
3663+ seq_ids = self.search(cr, uid,
3664 [('type', '=', 'out_invoice'), ('reference_type', '=', 'bba'),
3665- ('reference', 'like', '+++%s/%s/%%' % (partner_ref_nr[:3], partner_ref_nr[3:]))], order='reference')
3666+ ('reference', 'like', '+++%s/%s/%%' % (partner_ref_nr[:3], partner_ref_nr[3:]))], order='reference')
3667 if seq_ids:
3668 prev_seq = int(self.browse(cr, uid, seq_ids[-1]).reference[12:15])
3669 if prev_seq < 999:
3670@@ -133,10 +133,10 @@
3671 else:
3672 raise osv.except_osv(_('Warning!'),
3673 _('The daily maximum of outgoing invoices with an automatically generated BBA Structured Communications has been exceeded!' \
3674- '\nPlease create manually a unique BBA Structured Communication.'))
3675+ '\nPlease create manually a unique BBA Structured Communication.'))
3676 bbacomm = partner_ref_nr + seq
3677 base = int(bbacomm)
3678- mod = base % 97 or 97
3679+ mod = base % 97 or 97
3680 reference = '+++%s/%s/%s%02d+++' % (partner_ref_nr[:3], partner_ref_nr[3:], seq, mod)
3681 elif algorithm == 'random':
3682 if not self.check_bbacomm(reference):
3683@@ -144,67 +144,66 @@
3684 bbacomm = str(base).rjust(7, '0')
3685 base = int(bbacomm)
3686 mod = base % 97 or 97
3687- mod = str(mod).rjust(2, '0')
3688+ mod = str(mod).rjust(2, '0')
3689 reference = '+++%s/%s/%s%s+++' % (bbacomm[:3], bbacomm[3:7], bbacomm[7:], mod)
3690 else:
3691 raise osv.except_osv(_('Error!'),
3692 _("Unsupported Structured Communication Type Algorithm '%s' !" \
3693- "\nPlease contact your OpenERP support channel.") % algorithm)
3694- return {'value': {'reference': reference}}
3695-
3696+ "\nPlease contact your OpenERP support channel.") % algorithm)
3697+ return {'value': {'reference': reference}}
3698+
3699 def create(self, cr, uid, vals, context=None):
3700 if vals.has_key('reference_type'):
3701 reference_type = vals['reference_type']
3702- if reference_type == 'bba':
3703+ if reference_type == 'bba':
3704 if vals.has_key('reference'):
3705 bbacomm = vals['reference']
3706 else:
3707 raise osv.except_osv(_('Warning!'),
3708 _('Empty BBA Structured Communication!' \
3709- '\nPlease fill in a unique BBA Structured Communication.'))
3710+ '\nPlease fill in a unique BBA Structured Communication.'))
3711 if self.check_bbacomm(bbacomm):
3712 reference = re.sub('\D', '', bbacomm)
3713- vals['reference'] = '+++' + reference[0:3] + '/' + reference[3:7] + '/' + reference[7:] + '+++'
3714- same_ids = self.search(cr, uid,
3715+ vals['reference'] = '+++' + reference[0:3] + '/' + reference[3:7] + '/' + reference[7:] + '+++'
3716+ same_ids = self.search(cr, uid,
3717 [('type', '=', 'out_invoice'), ('reference_type', '=', 'bba'),
3718 ('reference', '=', vals['reference'])])
3719 if same_ids:
3720 raise osv.except_osv(_('Warning!'),
3721 _('The BBA Structured Communication has already been used!' \
3722- '\nPlease create manually a unique BBA Structured Communication.'))
3723- return super(account_invoice, self).create(cr, uid, vals, context=context)
3724+ '\nPlease create manually a unique BBA Structured Communication.'))
3725+ return super(account_invoice, self).create(cr, uid, vals, context=context)
3726
3727- def write(self, cr, uid, ids, vals, context={}):
3728+ def write(self, cr, uid, ids, vals, context=None):
3729 if isinstance(ids, (int, long)):
3730 ids = [ids]
3731- for inv in self.browse(cr, uid, ids, context):
3732+ for inv in self.browse(cr, uid, ids, context):
3733 if vals.has_key('reference_type'):
3734 reference_type = vals['reference_type']
3735- else:
3736+ else:
3737 reference_type = inv.reference_type or ''
3738- if reference_type == 'bba':
3739+ if reference_type == 'bba':
3740 if vals.has_key('reference'):
3741 bbacomm = vals['reference']
3742 else:
3743 bbacomm = inv.reference or ''
3744 if self.check_bbacomm(bbacomm):
3745 reference = re.sub('\D', '', bbacomm)
3746- vals['reference'] = '+++' + reference[0:3] + '/' + reference[3:7] + '/' + reference[7:] + '+++'
3747- same_ids = self.search(cr, uid,
3748- [('id', '!=', inv.id), ('type', '=', 'out_invoice'),
3749+ vals['reference'] = '+++' + reference[0:3] + '/' + reference[3:7] + '/' + reference[7:] + '+++'
3750+ same_ids = self.search(cr, uid,
3751+ [('id', '!=', inv.id), ('type', '=', 'out_invoice'),
3752 ('reference_type', '=', 'bba'), ('reference', '=', vals['reference'])])
3753 if same_ids:
3754 raise osv.except_osv(_('Warning!'),
3755 _('The BBA Structured Communication has already been used!' \
3756- '\nPlease create manually a unique BBA Structured Communication.'))
3757- return super(account_invoice, self).write(cr, uid, ids, vals, context)
3758+ '\nPlease create manually a unique BBA Structured Communication.'))
3759+ return super(account_invoice, self).write(cr, uid, ids, vals, context)
3760
3761 _columns = {
3762 'reference': fields.char('Communication', size=64, help="The partner reference of this invoice."),
3763 'reference_type': fields.selection(_get_reference_type, 'Communication Type',
3764 required=True),
3765 }
3766-
3767 _constraints = [
3768 (_check_communication, 'Invalid BBA Structured Communication !', ['Communication']),
3769 ]
3770
3771=== modified file 'l10n_br/l10n_br.py'
3772--- l10n_br/l10n_br.py 2011-10-03 13:32:03 +0000
3773+++ l10n_br/l10n_br.py 2012-10-02 11:29:53 +0000
3774@@ -81,4 +81,4 @@
3775
3776 l10n_br_account_cst()
3777
3778-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3779\ No newline at end of file
3780+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3781
3782=== modified file 'l10n_ch/partner.py'
3783--- l10n_ch/partner.py 2011-09-16 14:32:55 +0000
3784+++ l10n_ch/partner.py 2012-10-02 11:29:53 +0000
3785@@ -30,4 +30,4 @@
3786 }
3787
3788 res_partner()
3789-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3790\ No newline at end of file
3791+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3792
3793=== modified file 'l10n_ch/payment.py'
3794--- l10n_ch/payment.py 2011-01-14 12:41:54 +0000
3795+++ l10n_ch/payment.py 2012-10-02 11:29:53 +0000
3796@@ -24,7 +24,7 @@
3797 class payment_order(osv.osv):
3798 _inherit = 'payment.order'
3799
3800- def get_wizard(self,mode):
3801+ def get_wizard(self, mode):
3802 if mode == 'dta':
3803 return 'l10n_ch', 'action_dta_create'
3804
3805
3806=== modified file 'l10n_ch/report/report_webkit_html.py'
3807--- l10n_ch/report/report_webkit_html.py 2012-08-07 11:06:16 +0000
3808+++ l10n_ch/report/report_webkit_html.py 2012-10-02 11:29:53 +0000
3809@@ -76,7 +76,7 @@
3810 self._check(ids)
3811 return super(l10n_ch_report_webkit_html, self).set_context(objects, data, ids, report_type=report_type)
3812
3813- def police_absolute_path(self, inner_path) :
3814+ def police_absolute_path(self, inner_path):
3815 """Will get the ocrb police absolute path"""
3816 path = addons.get_module_resource(os.path.join('l10n_ch', 'report', inner_path))
3817 return path
3818
3819=== modified file 'l10n_ch/wizard/create_dta.py'
3820--- l10n_ch/wizard/create_dta.py 2012-08-07 11:31:37 +0000
3821+++ l10n_ch/wizard/create_dta.py 2012-10-02 11:29:53 +0000
3822@@ -41,7 +41,7 @@
3823 (u'ä','a'),
3824 ]
3825
3826-def _u2a(text) :
3827+def _u2a(text):
3828 """Tries to convert unicode charactere to asci equivalence"""
3829 if not text : return ""
3830 txt = ""
3831
3832=== modified file 'l10n_fr/l10n_fr.py'
3833--- l10n_fr/l10n_fr.py 2012-04-13 10:39:57 +0000
3834+++ l10n_fr/l10n_fr.py 2012-10-02 11:29:53 +0000
3835@@ -29,7 +29,6 @@
3836 'name': fields.char('Name', size=128),
3837 'line_ids': fields.one2many('l10n.fr.line', 'report_id', 'Lines'),
3838 }
3839-
3840 _sql_constraints = [
3841 ('code_uniq', 'unique (code)','The code report must be unique !')
3842 ]
3843@@ -61,7 +60,4 @@
3844
3845 res_company()
3846
3847-
3848-
3849-
3850 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3851
3852=== modified file 'l10n_fr/report/base_report.py'
3853--- l10n_fr/report/base_report.py 2011-01-14 00:11:01 +0000
3854+++ l10n_fr/report/base_report.py 2012-10-02 11:29:53 +0000
3855@@ -117,4 +117,4 @@
3856 break
3857 self._set_variable(code, sum)
3858
3859-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3860\ No newline at end of file
3861+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3862
3863=== modified file 'l10n_lu/wizard/pdf_ext.py'
3864--- l10n_lu/wizard/pdf_ext.py 2011-01-14 00:11:01 +0000
3865+++ l10n_lu/wizard/pdf_ext.py 2012-10-02 11:29:53 +0000
3866@@ -57,7 +57,7 @@
3867 %%EOF
3868 """
3869
3870-def output_field( f ):
3871+def output_field(f):
3872 return "\xfe\xff" + "".join( [ "\x00"+c for c in f ] )
3873
3874 def extract_keys(lines):
3875
3876=== modified file 'lunch/report/order.py'
3877--- lunch/report/order.py 2011-01-14 00:11:01 +0000
3878+++ lunch/report/order.py 2012-10-02 11:29:53 +0000
3879@@ -26,14 +26,14 @@
3880
3881 class order(report_sxw.rml_parse):
3882
3883- def get_lines(self, user,objects):
3884+ def get_lines(self, user, objects):
3885 lines=[]
3886 for obj in objects:
3887 if user.id==obj.user_id.id:
3888 lines.append(obj)
3889 return lines
3890
3891- def get_total(self, user,objects):
3892+ def get_total(self, user, objects):
3893 lines=[]
3894 for obj in objects:
3895 if user.id==obj.user_id.id:
3896
3897=== modified file 'mail/mail_thread.py'
3898--- mail/mail_thread.py 2012-09-18 15:59:05 +0000
3899+++ mail/mail_thread.py 2012-10-02 11:29:53 +0000
3900@@ -590,7 +590,7 @@
3901 context = context or {}
3902 attachments = attachments or []
3903 assert (not thread_id) or isinstance(thread_id, (int,long)) or \
3904- (isinstance(thread_id, (list, tuple)) and len(thread_id) == 1), "Invalid thread_id"
3905+ (isinstance(thread_id, (list, tuple)) and len(thread_id) == 1), "Invalid thread_id"
3906 if isinstance(thread_id, (list, tuple)):
3907 thread_id = thread_id and thread_id[0]
3908
3909@@ -618,7 +618,7 @@
3910 'parent_id': parent_id,
3911 'attachment_ids': attachment_ids,
3912 })
3913- for x in ('from', 'to', 'cc'): values.pop(x, None) # Avoid warnings
3914+ for x in ('from', 'to', 'cc'): values.pop(x, None) # Avoid warnings
3915 return self.pool.get('mail.message').create(cr, uid, values, context=context)
3916
3917 #------------------------------------------------------
3918
3919=== modified file 'mail/static/scripts/openerp_mailgate.py' (properties changed: +x to -x)
3920=== modified file 'membership/report/__init__.py'
3921--- membership/report/__init__.py 2011-01-14 00:11:01 +0000
3922+++ membership/report/__init__.py 2012-10-02 11:29:53 +0000
3923@@ -20,4 +20,4 @@
3924 ##############################################################################
3925
3926 import report_membership
3927-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3928\ No newline at end of file
3929+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3930
3931=== modified file 'membership/report/report_membership.py'
3932--- membership/report/report_membership.py 2012-05-04 12:13:26 +0000
3933+++ membership/report/report_membership.py 2012-10-02 11:29:53 +0000
3934@@ -141,4 +141,4 @@
3935
3936 report_membership()
3937
3938-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3939\ No newline at end of file
3940+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3941
3942=== modified file 'membership/wizard/__init__.py'
3943--- membership/wizard/__init__.py 2011-01-14 00:11:01 +0000
3944+++ membership/wizard/__init__.py 2012-10-02 11:29:53 +0000
3945@@ -20,4 +20,4 @@
3946 ##############################################################################
3947
3948 import membership_invoice
3949-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3950\ No newline at end of file
3951+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3952
3953=== modified file 'mrp/mrp.py'
3954--- mrp/mrp.py 2012-09-30 12:57:57 +0000
3955+++ mrp/mrp.py 2012-10-02 11:29:53 +0000
3956@@ -274,13 +274,15 @@
3957 return {'value': {'name': prod.name, 'product_uom': prod.uom_id.id}}
3958 return {}
3959
3960- def _bom_find(self, cr, uid, product_id, product_uom, properties=[]):
3961+ def _bom_find(self, cr, uid, product_id, product_uom, properties=None):
3962 """ Finds BoM for particular product and product uom.
3963 @param product_id: Selected product.
3964 @param product_uom: Unit of measure of a product.
3965 @param properties: List of related properties.
3966 @return: False or BoM id.
3967 """
3968+ if properties is None:
3969+ properties = []
3970 cr.execute('select id from mrp_bom where product_id=%s and bom_id is null order by sequence', (product_id,))
3971 ids = map(lambda x: x[0], cr.fetchall())
3972 max_prop = 0
3973@@ -295,7 +297,7 @@
3974 max_prop = prop
3975 return result
3976
3977- def _bom_explode(self, cr, uid, bom, factor, properties=[], addthis=False, level=0, routing_id=False):
3978+ def _bom_explode(self, cr, uid, bom, factor, properties=None, addthis=False, level=0, routing_id=False):
3979 """ Finds Products and Work Centers for related BoM for manufacturing order.
3980 @param bom: BoM of particular product.
3981 @param factor: Factor of product UoM.
3982@@ -609,11 +611,13 @@
3983 self.write(cr, uid, ids, {'state': 'picking_except'})
3984 return True
3985
3986- def action_compute(self, cr, uid, ids, properties=[], context=None):
3987+ def action_compute(self, cr, uid, ids, properties=None, context=None):
3988 """ Computes bills of material of a product.
3989 @param properties: List containing dictionaries of properties.
3990 @return: No. of products.
3991 """
3992+ if properties is None:
3993+ properties = []
3994 results = []
3995 bom_obj = self.pool.get('mrp.bom')
3996 uom_obj = self.pool.get('product.uom')
3997@@ -832,7 +836,7 @@
3998 'product_id': wc.product_id.id,
3999 'unit_amount': wc_line.hour,
4000 'product_uom_id': wc.product_id.id and wc.product_id.uom_id.id or False
4001-
4002+
4003 } )
4004 if wc.costs_journal_id and wc.costs_general_account_id:
4005 value = wc_line.cycle * wc.costs_cycle
4006@@ -849,7 +853,7 @@
4007 'product_id': wc.product_id.id,
4008 'unit_amount': wc_line.cycle,
4009 'product_uom_id': wc.product_id.id and wc.product_id.uom_id.id or False
4010-
4011+
4012 } )
4013 return amount
4014
4015
4016=== modified file 'mrp/procurement.py'
4017--- mrp/procurement.py 2012-08-17 10:03:02 +0000
4018+++ mrp/procurement.py 2012-10-02 11:29:53 +0000
4019@@ -33,7 +33,7 @@
4020 'property_ids': fields.many2many('mrp.property', 'procurement_property_rel', 'procurement_id','property_id', 'Properties'),
4021 }
4022
4023- def check_produce_product(self, cr, uid, procurement, context=[]):
4024+ def check_produce_product(self, cr, uid, procurement, context=None):
4025 """ Finds the bill of material for the product from procurement order.
4026 @return: True or False
4027 """
4028
4029=== modified file 'mrp/report/bom_structure.py'
4030--- mrp/report/bom_structure.py 2011-01-14 00:11:01 +0000
4031+++ mrp/report/bom_structure.py 2012-10-02 11:29:53 +0000
4032@@ -35,7 +35,7 @@
4033 def get_children(self, object, level=0):
4034 result = []
4035
4036- def _get_rec(object,level):
4037+ def _get_rec(object, level):
4038 for l in object:
4039 res = {}
4040 res['name'] = l.name
4041@@ -61,4 +61,4 @@
4042 report_sxw.report_sxw('report.bom.structure','mrp.bom','mrp/report/bom_structure.rml',parser=bom_structure,header='internal')
4043
4044
4045-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4046\ No newline at end of file
4047+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4048
4049=== modified file 'mrp/stock.py'
4050--- mrp/stock.py 2012-02-13 15:27:55 +0000
4051+++ mrp/stock.py 2012-10-02 11:29:53 +0000
4052@@ -102,7 +102,7 @@
4053 wf_service.trg_validate(uid, 'procurement.order', m, 'button_wait_done', cr)
4054 return processed_ids
4055
4056- def action_consume(self, cr, uid, ids, product_qty, location_id=False, context=None):
4057+ def action_consume(self, cr, uid, ids, product_qty, location_id=False, context=None):
4058 """ Consumed product with specific quatity from specific source location.
4059 @param product_qty: Consumed product quantity
4060 @param location_id: Source location
4061
4062=== modified file 'mrp_operations/mrp_operations.py'
4063--- mrp_operations/mrp_operations.py 2012-08-17 10:03:02 +0000
4064+++ mrp_operations/mrp_operations.py 2012-10-02 11:29:53 +0000
4065@@ -422,7 +422,7 @@
4066 pass
4067 return result
4068
4069- def action_compute(self, cr, uid, ids, properties=[], context=None):
4070+ def action_compute(self, cr, uid, ids, properties=None, context=None):
4071 """ Computes bills of material of a product and planned date of work order.
4072 @param properties: List containing dictionaries of properties.
4073 @return: No. of products.
4074
4075=== modified file 'plugin/plugin_handler.py'
4076--- plugin/plugin_handler.py 2012-09-13 08:25:35 +0000
4077+++ plugin/plugin_handler.py 2012-10-02 11:29:53 +0000
4078@@ -6,7 +6,6 @@
4079
4080 from osv import osv, fields
4081
4082-
4083 class plugin_handler(osv.osv_memory):
4084 _name = 'plugin.handler'
4085
4086@@ -37,7 +36,7 @@
4087 @param email: email is a standard RFC2822 email message
4088 @return Dictionary which contain id and the model name of the document linked with the mail
4089 if no document is found the id = 0
4090- (model_name, res_id, url, name_get)
4091+ (model_name, res_id, url, name_get)
4092 """
4093 mail_message_obj = self.pool.get('mail.message')
4094 model = ""
4095@@ -52,7 +51,7 @@
4096 msg_ids = mail_message_obj.search(cr, uid, [('message_id','=', message_id)])
4097 msg_id = len(msg_ids) and msg_ids[0] or False
4098 if not msg_id and parent_id:
4099- msg_id = parent_id
4100+ msg_id = parent_id
4101 if msg_id:
4102 msg = mail_message_obj.browse(cr, uid, msg_id)
4103 res_id = msg.res_id
4104@@ -61,7 +60,6 @@
4105 name = self.pool.get(model).name_get(cr, uid, [res_id])[0][1]
4106 return (model,res_id, url,name)
4107
4108-
4109 def document_type(self, cr, uid, context=None):
4110 """
4111 Return the list of available model to push
4112@@ -74,13 +72,13 @@
4113 doc_dict['res.partner'] = "Partner"
4114 return doc_dict.items()
4115
4116- # Can be used where search record was used
4117+ # Can be used where search record was used
4118 def list_document_get(self, cr, uid, model, name):
4119 """
4120 This function return the result of name_search on the object model
4121- @param model: the name of the model
4122+ @param model: the name of the model
4123 @param : the name of the document
4124- @return : the result of name_search a list of tuple
4125+ @return : the result of name_search a list of tuple
4126 [(id, 'name')]
4127 """
4128 return self.pool.get(model).name_search(cr, uid, name)
4129@@ -89,7 +87,7 @@
4130 """
4131 @param email: email is a standard RFC2822 email message
4132 @param model: On which model the message is pushed
4133- @param thread_id: on which document the message is pushed, if thread_id = 0 a new document is created
4134+ @param thread_id: on which document the message is pushed, if thread_id = 0 a new document is created
4135 @return Dictionary which contain model , url and resource id.
4136 """
4137 mail_message = self.pool.get('mail.message')
4138@@ -97,7 +95,7 @@
4139 msg = self.pool.get('mail.thread').message_parse(cr, uid, email)
4140 message_id = msg.get('message-id')
4141 mail_ids = mail_message.search(cr, uid, [('message_id','=',message_id),('res_id','=',res_id),('model','=',model)])
4142-
4143+
4144 if message_id and mail_ids :
4145 mail_record = mail_message.browse(cr, uid, mail_ids)[0]
4146 res_id = mail_record.res_id
4147@@ -109,11 +107,11 @@
4148 res_id = model_obj.message_process(cr, uid, model, email)
4149 notify = "Mail successfully pushed, a new %s has been created " % model
4150 else:
4151- model_obj.message_post(cr, uid, [res_id],
4152- body= msg.get('body'),
4153- subject= msg.get('subject'),
4154- type= 'email',
4155- parent_id= msg.get('parent_id'),
4156+ model_obj.message_post(cr, uid, [res_id],
4157+ body= msg.get('body'),
4158+ subject= msg.get('subject'),
4159+ type= 'email',
4160+ parent_id= msg.get('parent_id'),
4161 attachments= msg.get('attachments'))
4162 notify = "Mail successfully pushed"
4163 url = self._make_url(cr, uid, res_id, model)
4164@@ -123,7 +121,7 @@
4165 """
4166 @param data : the data use to create the res.partner
4167 [('field_name', value)], field name is required
4168- @param partner_id : On which partner the address is attached
4169+ @param partner_id : On which partner the address is attached
4170 if partner_id = 0 then create a new partner with the same name that the address
4171 @return : the partner_id sended or created, this allow the plugin to open the right partner page
4172 """
4173@@ -138,7 +136,7 @@
4174 return ('res.partner', partner_id, url)
4175
4176 # Specific to outlook rfc822 is not available so we split in arguments headerd,body,attachemnts
4177- def push_message_outlook(self, cr, uid, model, headers,res_id=0 ,body=False, body_html=False, attachments=False):
4178+ def push_message_outlook(self, cr, uid, model, headers, res_id=0, body=False, body_html=False, attachments=False):
4179 # ----------------------------------------
4180 # solution 1
4181 # construct a fake rfc822 from the separated arguement
4182@@ -149,14 +147,14 @@
4183 # solution 2
4184 # use self.pushmessage only with header and body
4185 # add attachemnt yourself after
4186- mail_message = self.pool.get('mail.message')
4187+ mail_message = self.pool.get('mail.message')
4188 ir_attachment_obj = self.pool.get('ir.attachment')
4189 attach_ids = []
4190 msg = self.pool.get('mail.thread').message_parse(cr, uid, headers)
4191- message_id = msg.get('message-id')
4192+ message_id = msg.get('message-id')
4193 push_mail = self.push_message(cr, uid, model, headers, res_id)
4194 res_id = push_mail[1]
4195- model = push_mail[0]
4196+ model = push_mail[0]
4197 for name in attachments.keys():
4198 attachment_ids = ir_attachment_obj.search(cr, uid, [('res_model', '=', model), ('res_id', '=', res_id), ('datas_fname', '=', name)])
4199 if attachment_ids:
4200
4201=== modified file 'point_of_sale/report/account_statement.py'
4202--- point_of_sale/report/account_statement.py 2011-01-14 00:11:01 +0000
4203+++ point_of_sale/report/account_statement.py 2012-10-02 11:29:53 +0000
4204@@ -48,4 +48,4 @@
4205
4206 report_sxw.report_sxw('report.account.statement', 'account.bank.statement', 'addons/statement/report/account_statement.rml', parser=account_statement,header='internal')
4207
4208-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4209\ No newline at end of file
4210+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4211
4212=== modified file 'point_of_sale/report/all_closed_cashbox_of_the_day.py'
4213--- point_of_sale/report/all_closed_cashbox_of_the_day.py 2011-01-14 00:11:01 +0000
4214+++ point_of_sale/report/all_closed_cashbox_of_the_day.py 2012-10-02 11:29:53 +0000
4215@@ -38,13 +38,13 @@
4216 'get_net_total_starting':self._get_net_total_starting,
4217 })
4218
4219- def _get_user(self,line_ids):
4220+ def _get_user(self, line_ids):
4221 sql = "select name from res_users where id = %d"%(line_ids['create_uid'])
4222 self.cr.execute(sql)
4223 user = self.cr.fetchone()
4224 return user[0]
4225
4226- def _get_data(self,user):
4227+ def _get_data(self, user):
4228 data = {}
4229 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,
4230 abs.state,abs.balance_end_real FROM account_bank_statement as abs
4231@@ -57,7 +57,7 @@
4232 data = self.cr.dictfetchall()
4233 return data
4234
4235- def _get_lines(self,statement):
4236+ def _get_lines(self, statement):
4237 data = {}
4238 sql = """ select absl.* from account_bank_statement_line as absl, account_bank_statement as abs
4239 where absl.statement_id = abs.id and abs.id = %d"""%(statement['id'])
4240@@ -65,7 +65,7 @@
4241 data = self.cr.dictfetchall()
4242 return data
4243
4244- def _get_bal(self,data):
4245+ def _get_bal(self, data):
4246 res = {}
4247 sql =""" select sum(pieces*number) as bal from account_cashbox_line where starting_id = %d """%(data['id'])
4248 self.cr.execute(sql)
4249@@ -75,7 +75,7 @@
4250 else:
4251 return False
4252
4253- def _get_sub_total(self,user,data,date):
4254+ def _get_sub_total(self, user, data, date):
4255 res={}
4256 self.cr.execute(""" select sum(absl.amount) from account_bank_statement as abs
4257 LEFT JOIN account_bank_statement_line as absl ON abs.id = absl.statement_id
4258@@ -90,7 +90,7 @@
4259 else:
4260 return False
4261
4262- def _get_partner(self,statement):
4263+ def _get_partner(self, statement):
4264 res = {}
4265 if statement['pos_statement_id']:
4266 sql =""" select rp.name from account_bank_statement_line as absl,res_partner as rp
4267@@ -102,7 +102,7 @@
4268 else:
4269 return 0.00
4270
4271- def _get_net_total_starting(self,user):
4272+ def _get_net_total_starting(self, user):
4273 lst = []
4274 res={}
4275 total_ending_bal = 0.0
4276@@ -124,7 +124,7 @@
4277 lst.append(total_starting_bal)
4278 return lst
4279
4280- def _get_net_total(self,user):
4281+ def _get_net_total(self, user):
4282 res={}
4283 sql = """select sum(absl.amount) as net_total from account_bank_statement as abs
4284 LEFT JOIN account_bank_statement_line as absl ON abs.id = absl.statement_id
4285@@ -137,4 +137,4 @@
4286
4287 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')
4288
4289-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4290\ No newline at end of file
4291+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4292
4293=== modified file 'point_of_sale/report/pos_details.py'
4294--- point_of_sale/report/pos_details.py 2011-12-29 16:58:23 +0000
4295+++ point_of_sale/report/pos_details.py 2012-10-02 11:29:53 +0000
4296@@ -24,7 +24,7 @@
4297
4298 class pos_details(report_sxw.rml_parse):
4299
4300- def _get_invoice(self,inv_id):
4301+ def _get_invoice(self, inv_id):
4302 res={}
4303 if inv_id:
4304 self.cr.execute("select number from account_invoice as ac where id = %s", (inv_id,))
4305@@ -37,7 +37,7 @@
4306 user_obj = self.pool.get('res.users')
4307 return user_obj.search(self.cr, self.uid, [])
4308
4309- def _pos_sales_details(self,form):
4310+ def _pos_sales_details(self, form):
4311 pos_obj = self.pool.get('pos.order')
4312 user_obj = self.pool.get('res.users')
4313 data = []
4314@@ -74,7 +74,7 @@
4315 def _get_sales_total_2(self):
4316 return self.total
4317
4318- def _get_sum_invoice_2(self,form):
4319+ def _get_sum_invoice_2(self, form):
4320 pos_obj = self.pool.get('pos.order')
4321 user_obj = self.pool.get('res.users')
4322 user_ids = form['user_ids'] or self._get_all_users()
4323
4324=== modified file 'point_of_sale/report/pos_details_summary.py'
4325--- point_of_sale/report/pos_details_summary.py 2012-05-12 22:37:43 +0000
4326+++ point_of_sale/report/pos_details_summary.py 2012-10-02 11:29:53 +0000
4327@@ -42,7 +42,7 @@
4328 'getcompany':self.get_company
4329 })
4330
4331- def get_company(self,objects):
4332+ def get_company(self, objects):
4333 comp=[obj.company_id.name for obj in objects]
4334 return '%s' % (comp[0])
4335
4336
4337=== modified file 'point_of_sale/report/pos_lines.py'
4338--- point_of_sale/report/pos_lines.py 2011-01-14 00:11:01 +0000
4339+++ point_of_sale/report/pos_lines.py 2012-10-02 11:29:53 +0000
4340@@ -41,7 +41,7 @@
4341 self.total = tot
4342 return self.total
4343
4344- def __taxes__(self,obj):
4345+ def __taxes__(self, obj):
4346 self.cr.execute ( " Select acct.name from pos_order as po " \
4347 " LEFT JOIN pos_order_line as pol ON po.id = pol.order_id " \
4348 " LEFT JOIN product_taxes_rel as ptr ON pol.product_id = ptr.prod_id " \
4349@@ -52,4 +52,4 @@
4350
4351 report_sxw.report_sxw('report.pos.lines', 'pos.order', 'addons/point_of_sale/report/pos_lines.rml', parser=pos_lines,header='internal')
4352
4353-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4354\ No newline at end of file
4355+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4356
4357=== modified file 'point_of_sale/report/pos_payment_report.py'
4358--- point_of_sale/report/pos_payment_report.py 2011-01-14 00:11:01 +0000
4359+++ point_of_sale/report/pos_payment_report.py 2012-10-02 11:29:53 +0000
4360@@ -33,7 +33,7 @@
4361 'pos_payment_total':self._pos_payment_total,
4362 })
4363
4364- def _pos_payment(self,obj):
4365+ def _pos_payment(self, obj):
4366 data={}
4367 sql = """ select id from pos_order where id = %d"""%(obj.id)
4368 self.cr.execute(sql)
4369@@ -56,9 +56,9 @@
4370 self.total += d['price_unit'] * d['qty']
4371 return data
4372
4373- def _pos_payment_total(self,o):
4374+ def _pos_payment_total(self, o):
4375 return self.total
4376
4377 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')
4378
4379-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4380\ No newline at end of file
4381+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4382
4383=== modified file 'point_of_sale/report/pos_payment_report_user.py'
4384--- point_of_sale/report/pos_payment_report_user.py 2011-01-14 00:11:01 +0000
4385+++ point_of_sale/report/pos_payment_report_user.py 2012-10-02 11:29:53 +0000
4386@@ -33,7 +33,7 @@
4387 'pos_payment_user_total':self.__pos_payment_user__total__,
4388 })
4389
4390- def __pos_payment_user__(self,form):
4391+ def __pos_payment_user__(self, form):
4392 data={}
4393 ids = form['user_id']
4394 sql = "select pt.name,pp.default_code as code,pol.qty,pu.name as uom,pol.discount,pol.price_unit, " \
4395@@ -61,4 +61,4 @@
4396
4397 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')
4398
4399-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4400\ No newline at end of file
4401+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4402
4403=== modified file 'point_of_sale/report/pos_receipt.py'
4404--- point_of_sale/report/pos_receipt.py 2012-03-30 09:08:37 +0000
4405+++ point_of_sale/report/pos_receipt.py 2012-10-02 11:29:53 +0000
4406@@ -74,4 +74,4 @@
4407
4408 report_sxw.report_sxw('report.pos.receipt', 'pos.order', 'addons/point_of_sale/report/pos_receipt.rml', parser=order, header=False)
4409
4410-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4411\ No newline at end of file
4412+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4413
4414=== modified file 'point_of_sale/report/pos_sales_user.py'
4415--- point_of_sale/report/pos_sales_user.py 2012-08-21 08:23:43 +0000
4416+++ point_of_sale/report/pos_sales_user.py 2012-10-02 11:29:53 +0000
4417@@ -33,7 +33,7 @@
4418
4419 })
4420
4421- def _get_data(self,form):
4422+ def _get_data(self, form):
4423 dt1 = form['date_start'] + ' 00:00:00'
4424 dt2 = form['date_end'] + ' 23:59:59'
4425 data={}
4426
4427=== modified file 'point_of_sale/report/pos_sales_user_today.py'
4428--- point_of_sale/report/pos_sales_user_today.py 2011-01-14 00:11:01 +0000
4429+++ point_of_sale/report/pos_sales_user_today.py 2012-10-02 11:29:53 +0000
4430@@ -33,7 +33,7 @@
4431
4432 })
4433
4434- def _get_data(self,form):
4435+ def _get_data(self, form):
4436 data={}
4437 ids = form['user_id']
4438
4439@@ -47,4 +47,4 @@
4440
4441 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')
4442
4443-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4444\ No newline at end of file
4445+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4446
4447=== modified file 'point_of_sale/report/pos_users_product.py'
4448--- point_of_sale/report/pos_users_product.py 2011-01-14 00:11:01 +0000
4449+++ point_of_sale/report/pos_users_product.py 2012-10-02 11:29:53 +0000
4450@@ -60,9 +60,9 @@
4451 data = self.cr.fetchone()
4452 return data[0]
4453
4454- def _get_total(self,o):
4455+ def _get_total(self, o):
4456 return self.total
4457
4458 report_sxw.report_sxw('report.pos.user.product', 'account.bank.statement', 'addons/statement/report/pos_users_product.rml', parser=pos_user_product,header='internal')
4459
4460-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4461\ No newline at end of file
4462+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4463
4464=== modified file 'product/product.py'
4465--- product/product.py 2012-09-26 12:24:35 +0000
4466+++ product/product.py 2012-10-02 11:29:53 +0000
4467@@ -335,7 +335,7 @@
4468 res = False
4469 return res
4470
4471- def onchange_uom(self, cursor, user, ids, uom_id,uom_po_id):
4472+ def onchange_uom(self, cursor, user, ids, uom_id, uom_po_id):
4473 if uom_id:
4474 return {'value': {'uom_po_id': uom_id}}
4475 return {}
4476@@ -594,7 +594,7 @@
4477 self.pool.get('product.template').unlink(cr, uid, unlink_product_tmpl_ids, context=context)
4478 return super(product_product, self).unlink(cr, uid, unlink_ids, context=context)
4479
4480- def onchange_uom(self, cursor, user, ids, uom_id,uom_po_id):
4481+ def onchange_uom(self, cursor, user, ids, uom_id, uom_po_id):
4482 if uom_id and uom_po_id:
4483 uom_obj=self.pool.get('product.uom')
4484 uom=uom_obj.browse(cursor,user,[uom_id])[0]
4485
4486=== modified file 'product/report/product_pricelist.py'
4487--- product/report/product_pricelist.py 2012-07-11 13:06:15 +0000
4488+++ product/report/product_pricelist.py 2012-10-02 11:29:53 +0000
4489@@ -24,6 +24,7 @@
4490 from osv import osv
4491 import pooler
4492 from tools.translate import _
4493+
4494 class product_pricelist(report_sxw.rml_parse):
4495 def __init__(self, cr, uid, name, context):
4496 super(product_pricelist, self).__init__(cr, uid, name, context=context)
4497@@ -39,7 +40,7 @@
4498 'get_titles': self._get_titles,
4499 })
4500
4501- def _get_titles(self,form):
4502+ def _get_titles(self, form):
4503 lst = []
4504 vals = {}
4505 qtys = 1
4506@@ -51,7 +52,7 @@
4507 lst.append(vals)
4508 return lst
4509
4510- def _set_quantity(self,form):
4511+ def _set_quantity(self, form):
4512 for i in range(1,6):
4513 q = 'qty%d'%i
4514 if form[q] >0 and form[q] not in self.quantity:
4515@@ -76,7 +77,7 @@
4516 symbol = pool.get('res.currency').read(self.cr, self.uid, [pricelist['currency_id'][0]], ['symbol'], context=self.localcontext)[0]
4517 return symbol['symbol'] or ''
4518
4519- def _get_categories(self, products,form):
4520+ def _get_categories(self, products, form):
4521 cat_ids=[]
4522 res=[]
4523 self.pricelist = form['price_list']
4524@@ -111,7 +112,7 @@
4525 res.append({'name':cat[1],'products': products})
4526 return res
4527
4528- def _get_price(self,pricelist_id, product_id,qty):
4529+ def _get_price(self, pricelist_id, product_id, qty):
4530 sale_price_digits = self.get_digits(dp='Product Price')
4531 pool = pooler.get_pool(self.cr.dbname)
4532 price_dict = pool.get('product.pricelist').price_get(self.cr, self.uid, [pricelist_id], product_id, qty, context=self.localcontext)
4533@@ -123,5 +124,5 @@
4534 return price
4535
4536 report_sxw.report_sxw('report.product.pricelist','product.product','addons/product/report/product_pricelist.rml',parser=product_pricelist)
4537+
4538 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4539-
4540
4541=== modified file 'product_manufacturer/product_manufacturer.py'
4542--- product_manufacturer/product_manufacturer.py 2011-01-14 00:11:01 +0000
4543+++ product_manufacturer/product_manufacturer.py 2012-10-02 11:29:53 +0000
4544@@ -40,4 +40,4 @@
4545 }
4546 product_attribute()
4547
4548-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4549\ No newline at end of file
4550+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4551
4552=== modified file 'product_visible_discount/__init__.py'
4553--- product_visible_discount/__init__.py 2011-01-14 00:11:01 +0000
4554+++ product_visible_discount/__init__.py 2012-10-02 11:29:53 +0000
4555@@ -20,4 +20,4 @@
4556
4557 import product_visible_discount
4558
4559-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4560\ No newline at end of file
4561+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4562
4563=== modified file 'project/project.py'
4564--- project/project.py 2012-09-29 19:58:25 +0000
4565+++ project/project.py 2012-10-02 11:29:53 +0000
4566@@ -55,7 +55,6 @@
4567 }
4568 _order = 'sequence'
4569
4570-
4571 def short_name(name):
4572 """Keep first word(s) of name to make it small enough
4573 but distinctive"""
4574@@ -191,7 +190,6 @@
4575
4576 # Lambda indirection method to avoid passing a copy of the overridable method when declaring the field
4577 _alias_models = lambda self, *args, **kwargs: self._get_alias_models(*args, **kwargs)
4578-
4579 _columns = {
4580 'complete_name': fields.function(_complete_name, string="Project Name", type='char', size=250),
4581 'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the project without removing it."),
4582@@ -311,11 +309,12 @@
4583 task_obj.duplicate_task(cr, uid, map_task_id, context=context)
4584 return True
4585
4586- def copy(self, cr, uid, id, default={}, context=None):
4587+ def copy(self, cr, uid, id, default=None, context=None):
4588 if context is None:
4589 context = {}
4590+ if default is None:
4591+ default = {}
4592
4593- default = default or {}
4594 context['active_test'] = False
4595 default['state'] = 'open'
4596 default['tasks'] = []
4597@@ -650,12 +649,12 @@
4598 res[task.id]['progress'] = 100.0
4599 return res
4600
4601- def onchange_remaining(self, cr, uid, ids, remaining=0.0, planned = 0.0):
4602+ def onchange_remaining(self, cr, uid, ids, remaining=0.0, planned=0.0):
4603 if remaining and not planned:
4604 return {'value':{'planned_hours': remaining}}
4605 return {}
4606
4607- def onchange_planned(self, cr, uid, ids, planned = 0.0, effective = 0.0):
4608+ def onchange_planned(self, cr, uid, ids, planned=0.0, effective=0.0):
4609 return {'value':{'remaining_hours': planned - effective}}
4610
4611 def onchange_project(self, cr, uid, id, project_id):
4612@@ -686,7 +685,9 @@
4613 #FIXME why there is already the copy and the old one
4614 self.write(cr, uid, new, {'parent_ids':[(6,0,set(parent_ids))], 'child_ids':[(6,0, set(child_ids))]})
4615
4616- def copy_data(self, cr, uid, id, default={}, context=None):
4617+ def copy_data(self, cr, uid, id, default=None, context=None):
4618+ if default is None:
4619+ default = {}
4620 default = default or {}
4621 default.update({'work_ids':[], 'date_start': False, 'date_end': False, 'date_deadline': False})
4622 if not default.get('remaining_hours', False):
4623@@ -699,7 +700,6 @@
4624 default.update({'name':new_name})
4625 return super(task, self).copy_data(cr, uid, id, default, context)
4626
4627-
4628 def _is_template(self, cr, uid, ids, field_name, arg, context=None):
4629 res = {}
4630 for task in self.browse(cr, uid, ids, context=context):
4631@@ -777,7 +777,6 @@
4632 'color': fields.integer('Color Index'),
4633 'user_email': fields.related('user_id', 'email', type='char', string='User Email', readonly=True),
4634 }
4635-
4636 _defaults = {
4637 'stage_id': _get_default_stage_id,
4638 'project_id': _get_default_project_id,
4639@@ -790,7 +789,6 @@
4640 'user_id': lambda obj, cr, uid, context: uid,
4641 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'project.task', context=c),
4642 }
4643-
4644 _order = "priority, sequence, date_start, name, id"
4645
4646 def set_priority(self, cr, uid, ids, priority, *args):
4647@@ -853,9 +851,8 @@
4648 (_check_recursion, 'Error ! You cannot create recursive tasks.', ['parent_ids']),
4649 (_check_dates, 'Error ! Task end-date must be greater then task start-date', ['date_start','date_end'])
4650 ]
4651- #
4652+
4653 # Override view according to the company definition
4654- #
4655 def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
4656 users_obj = self.pool.get('res.users')
4657 if context is None: context = {}
4658@@ -887,9 +884,9 @@
4659 res['fields'][f]['string'] = res['fields'][f]['string'].replace('Hours',tm)
4660 return res
4661
4662- # ****************************************
4663+ # ----------------------------------------
4664 # Case management
4665- # ****************************************
4666+ # ----------------------------------------
4667
4668 def stage_find(self, cr, uid, cases, section_id, domain=[], order='sequence', context=None):
4669 """ Override of the base.stage method
4670@@ -1021,10 +1018,12 @@
4671 new_attachment_ids.append(attachment.copy(cr, uid, attachment_id, default={'res_id': delegated_task_id}, context=context))
4672 return new_attachment_ids
4673
4674- def do_delegate(self, cr, uid, ids, delegate_data={}, context=None):
4675+ def do_delegate(self, cr, uid, ids, delegate_data=None, context=None):
4676 """
4677 Delegate Task to another users.
4678 """
4679+ if delegate_data is None:
4680+ delegate_data = {}
4681 assert delegate_data['user_id'], _("Delegated User should be specified")
4682 delegated_tasks = {}
4683 for task in self.browse(cr, uid, ids, context=context):
4684@@ -1170,7 +1169,7 @@
4685 return result
4686
4687 # ---------------------------------------------------
4688- # mail gateway
4689+ # Mail gateway
4690 # ---------------------------------------------------
4691
4692 def message_new(self, cr, uid, msg, custom_values=None, context=None):
4693
4694=== modified file 'project/wizard/project_task_reevaluate.py'
4695--- project/wizard/project_task_reevaluate.py 2011-12-19 16:54:40 +0000
4696+++ project/wizard/project_task_reevaluate.py 2012-10-02 11:29:53 +0000
4697@@ -26,7 +26,7 @@
4698 class project_task_reevaluate(osv.osv_memory):
4699 _name = 'project.task.reevaluate'
4700
4701- def _get_remaining(self,cr, uid, context=None):
4702+ def _get_remaining(self, cr, uid, context=None):
4703 if context is None:
4704 context = {}
4705 active_id = context.get('active_id', False)
4706
4707=== modified file 'project_gtd/project_gtd.py'
4708--- project_gtd/project_gtd.py 2012-06-27 13:14:12 +0000
4709+++ project_gtd/project_gtd.py 2012-10-02 11:29:53 +0000
4710@@ -67,7 +67,7 @@
4711 default['context_id'] = False
4712 return super(project_task,self).copy_data(cr, uid, id, default, context)
4713
4714- def _get_context(self,cr, uid, context=None):
4715+ def _get_context(self, cr, uid, context=None):
4716 ids = self.pool.get('project.gtd.context').search(cr, uid, [], context=context)
4717 return ids and ids[0] or False
4718
4719
4720=== modified file 'project_gtd/wizard/project_gtd_empty.py'
4721--- project_gtd/wizard/project_gtd_empty.py 2012-08-07 11:31:37 +0000
4722+++ project_gtd/wizard/project_gtd_empty.py 2012-10-02 11:29:53 +0000
4723@@ -30,7 +30,7 @@
4724 'name': fields.char('Name', size=32)
4725 }
4726
4727- def view_init(self, cr , uid , fields_list, context=None):
4728+ def view_init(self, cr, uid, fields_list, context=None):
4729 if context is None:
4730 context = {}
4731 self._empty(cr, uid, context=context)
4732
4733=== modified file 'project_mrp/project_procurement.py'
4734--- project_mrp/project_procurement.py 2012-09-30 10:59:00 +0000
4735+++ project_mrp/project_procurement.py 2012-10-02 11:29:53 +0000
4736@@ -42,7 +42,7 @@
4737 return False
4738 return True
4739
4740- def check_produce_service(self, cr, uid, procurement, context=None):
4741+ def check_produce_service(self, cr, uid, procurement, context=None):
4742 return True
4743
4744 def _convert_qty_company_hours(self, cr, uid, procurement, context=None):
4745
4746=== modified file 'project_timesheet/project_timesheet.py'
4747--- project_timesheet/project_timesheet.py 2012-09-29 20:13:26 +0000
4748+++ project_timesheet/project_timesheet.py 2012-10-02 11:29:53 +0000
4749@@ -225,7 +225,7 @@
4750
4751 return super(task,self).unlink(cr, uid, ids, *args, **kwargs)
4752
4753- def write(self, cr, uid, ids,vals,context=None):
4754+ def write(self, cr, uid, ids, vals, context=None):
4755 if context is None:
4756 context = {}
4757 if vals.get('project_id',False) or vals.get('name',False):
4758
4759=== modified file 'project_timesheet/report/task_report.py'
4760--- project_timesheet/report/task_report.py 2012-07-31 14:47:04 +0000
4761+++ project_timesheet/report/task_report.py 2012-10-02 11:29:53 +0000
4762@@ -29,7 +29,7 @@
4763 _auto = False
4764 _order = "name"
4765
4766- def get_hrs_timesheet(self, cr, uid, ids, name,args,context):
4767+ def get_hrs_timesheet(self, cr, uid, ids, name, args, context):
4768 result = {}
4769 for record in self.browse(cr, uid, ids, context):
4770 last_date = datetime.strptime(record.name, '%Y-%m-%d') + relativedelta(months=1) - relativedelta(days=1)
4771
4772=== modified file 'purchase/purchase.py'
4773--- purchase/purchase.py 2012-09-30 11:40:14 +0000
4774+++ purchase/purchase.py 2012-10-02 11:29:53 +0000
4775@@ -31,9 +31,6 @@
4776 from osv.orm import browse_record, browse_null
4777 from tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT, DATETIME_FORMATS_MAP
4778
4779-#
4780-# Model definition
4781-#
4782 class purchase_order(osv.osv):
4783
4784 def _amount_all(self, cr, uid, ids, field_name, arg, context=None):
4785@@ -239,7 +236,6 @@
4786 else:
4787 raise osv.except_osv(_('Invalid Action!'), _('In order to delete a purchase order, you must cancel it first.'))
4788
4789- # TODO: temporary fix in 5.0, to remove in 5.2 when subflows support
4790 # automatically sending subflow.delete upon deletion
4791 wf_service = netsvc.LocalService("workflow")
4792 for id in unlink_ids:
4793@@ -333,7 +329,7 @@
4794 'view_id': view_id,
4795 'res_id': pick_ids[0]
4796 })
4797-
4798+
4799 action.update({
4800 'context': ctx,
4801 })
4802@@ -380,7 +376,7 @@
4803 for line in po.order_line:
4804 if line.state=='draft':
4805 todo.append(line.id)
4806-# current_name = self.name_get(cr, uid, ids)[0][1]
4807+
4808 self.pool.get('purchase.order.line').action_confirm(cr, uid, todo, context)
4809 for id in ids:
4810 self.write(cr, uid, [id], {'state' : 'confirmed', 'validator' : uid})
4811@@ -491,7 +487,7 @@
4812 self.invoice_done_send_note(cr, uid, ids, context=context)
4813 return True
4814
4815- def has_stockable_product(self,cr, uid, ids, *args):
4816+ def has_stockable_product(self, cr, uid, ids, *args):
4817 for order in self.browse(cr, uid, ids):
4818 for order_line in order.order_line:
4819 if order_line.product_id and order_line.product_id.product_tmpl_id.type in ('product', 'consu'):
4820@@ -596,7 +592,7 @@
4821 wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
4822 return [picking_id]
4823
4824- def action_picking_create(self,cr, uid, ids, context=None):
4825+ def action_picking_create(self, cr, uid, ids, context=None):
4826 picking_ids = []
4827 for order in self.browse(cr, uid, ids):
4828 picking_ids.extend(self._create_pickings(cr, uid, order, order.order_line, None, context=context))
4829@@ -665,7 +661,7 @@
4830 list_key.sort()
4831 return tuple(list_key)
4832
4833- # compute what the new orders should contain
4834+ # Compute what the new orders should contain
4835
4836 new_orders = {}
4837
4838@@ -1098,4 +1094,5 @@
4839 return super(mail_mail, self)._postprocess_sent_message(cr, uid, mail=mail, context=context)
4840
4841 mail_mail()
4842+
4843 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4844
4845=== modified file 'purchase/wizard/purchase_order_group.py'
4846--- purchase/wizard/purchase_order_group.py 2012-08-07 11:34:14 +0000
4847+++ purchase/wizard/purchase_order_group.py 2012-10-02 11:29:53 +0000
4848@@ -88,4 +88,4 @@
4849
4850 purchase_order_group()
4851
4852-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4853\ No newline at end of file
4854+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4855
4856=== modified file 'purchase_requisition/purchase_requisition.py'
4857--- purchase_requisition/purchase_requisition.py 2012-09-29 09:07:50 +0000
4858+++ purchase_requisition/purchase_requisition.py 2012-10-02 11:29:53 +0000
4859@@ -207,7 +207,7 @@
4860 'company_id': fields.related('requisition_id','company_id',type='many2one',relation='res.company',string='Company', store=True, readonly=True),
4861 }
4862
4863- def onchange_product_id(self, cr, uid, ids, product_id,product_uom_id, context=None):
4864+ def onchange_product_id(self, cr, uid, ids, product_id, product_uom_id, context=None):
4865 """ Changes UoM and name if product_id changes.
4866 @param name: Name of the field
4867 @param product_id: Changed product_id
4868
4869=== modified file 'report_webkit/ir_report.py'
4870--- report_webkit/ir_report.py 2011-12-19 16:54:40 +0000
4871+++ report_webkit/ir_report.py 2012-10-02 11:29:53 +0000
4872@@ -35,7 +35,7 @@
4873 from report.report_sxw import rml_parse
4874
4875 def register_report(name, model, tmpl_path, parser=rml_parse):
4876- "Register the report into the services"
4877+ """Register the report into the services"""
4878 name = 'report.%s' % name
4879 if netsvc.Service._services.get(name, False):
4880 service = netsvc.Service._services[name]
4881
4882=== modified file 'report_webkit/report_helper.py'
4883--- report_webkit/report_helper.py 2011-12-19 16:54:40 +0000
4884+++ report_webkit/report_helper.py 2012-10-02 11:29:53 +0000
4885@@ -75,7 +75,7 @@
4886 head = header_obj.browse(self.cursor, self.uid, header_img_id)
4887 return (head.img, head.type)
4888
4889- def embed_logo_by_name(self, name, width=0, height=0) :
4890+ def embed_logo_by_name(self, name, width=0, height=0):
4891 """Return HTML embedded logo by name"""
4892 img, type = self.get_logo_by_name(name)
4893 return self.embed_image(type, img, width, height)
4894
4895=== modified file 'resource/faces/task.py'
4896--- resource/faces/task.py 2012-07-25 12:49:45 +0000
4897+++ resource/faces/task.py 2012-10-02 11:29:53 +0000
4898@@ -567,7 +567,8 @@
4899 return result
4900 #@-node:_cmp
4901 #@+node:__getattr__
4902- def __getattr__(self, name): return getattr(self._value, name)
4903+ def __getattr__(self, name):
4904+ return getattr(self._value, name)
4905 #@-node:__getattr__
4906 #@+node:__getitem__
4907 def __getitem__(self, slice):
4908
4909=== modified file 'resource/resource.py'
4910--- resource/resource.py 2012-09-24 16:26:45 +0000
4911+++ resource/resource.py 2012-10-02 11:29:53 +0000
4912@@ -438,7 +438,7 @@
4913 (check_dates, 'Error! leave start-date must be lower then leave end-date.', ['date_from', 'date_to'])
4914 ]
4915
4916- def onchange_resource(self,cr, uid, ids, resource, context=None):
4917+ def onchange_resource(self, cr, uid, ids, resource, context=None):
4918 result = {}
4919 if resource:
4920 resource_pool = self.pool.get('resource.resource')
4921
4922=== modified file 'sale/report/__init__.py'
4923--- sale/report/__init__.py 2011-01-14 00:11:01 +0000
4924+++ sale/report/__init__.py 2012-10-02 11:29:53 +0000
4925@@ -22,4 +22,4 @@
4926 import sale_order
4927 import sale_report
4928
4929-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4930\ No newline at end of file
4931+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4932
4933=== modified file 'sale/sale.py'
4934--- sale/sale.py 2012-09-30 11:40:14 +0000
4935+++ sale/sale.py 2012-10-02 11:29:53 +0000
4936@@ -253,7 +253,7 @@
4937
4938 return osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
4939
4940- def onchange_pricelist_id(self, cr, uid, ids, pricelist_id, order_lines, context={}):
4941+ def onchange_pricelist_id(self, cr, uid, ids, pricelist_id, order_lines, context=None):
4942 if (not pricelist_id) or (not order_lines):
4943 return {}
4944 warning = {
4945@@ -262,7 +262,6 @@
4946 }
4947 return {'warning': warning}
4948
4949-
4950 def onchange_partner_id(self, cr, uid, ids, part):
4951 if not part:
4952 return {'value': {'partner_invoice_id': False, 'partner_shipping_id': False, 'payment_term': False, 'fiscal_position': False}}
4953@@ -437,7 +436,9 @@
4954 return False
4955 return True
4956
4957- def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed', 'done', 'exception'], date_inv = False, context=None):
4958+ def action_invoice_create(self, cr, uid, ids, grouped=False, states=None, date_inv = False, context=None):
4959+ if states is None:
4960+ states = ['confirmed', 'done', 'exception']
4961 res = False
4962 invoices = {}
4963 invoice_ids = []
4964@@ -648,7 +649,7 @@
4965 def cancel_send_note(self, cr, uid, ids, context=None):
4966 for obj in self.browse(cr, uid, ids, context=context):
4967 self.message_post(cr, uid, [obj.id], body=_("Sale Order for <em>%s</em> <b>cancelled</b>.") % (obj.partner_id.name), context=context)
4968-
4969+
4970 def done_send_note(self, cr, uid, ids, context=None):
4971 for obj in self.browse(cr, uid, ids, context=context):
4972 self.message_post(cr, uid, [obj.id], body=_("Sale Order for <em>%s</em> set to <b>Done</b>") % (obj.partner_id.name), context=context)
4973@@ -874,12 +875,12 @@
4974 context_partner = {'lang': lang, 'partner_id': partner_id}
4975
4976 if not product:
4977- return {'value': {'th_weight': 0,
4978+ return {'value': {'th_weight': 0,
4979 'product_uos_qty': qty}, 'domain': {'product_uom': [],
4980 'product_uos': []}}
4981 if not date_order:
4982 date_order = time.strftime(DEFAULT_SERVER_DATE_FORMAT)
4983-#
4984+
4985 result = {}
4986 warning_msgs = {}
4987 product_obj = product_obj.browse(cr, uid, product, context=context)
4988@@ -995,6 +996,7 @@
4989 wf_service = netsvc.LocalService("workflow")
4990 wf_service.trg_validate(uid, 'sale.order', context.get('default_res_id', False), 'quotation_sent', cr)
4991 return super(mail_compose_message, self).send_mail(cr, uid, ids, context=context)
4992+
4993 mail_compose_message()
4994
4995 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4996
4997=== modified file 'sale/wizard/__init__.py'
4998--- sale/wizard/__init__.py 2012-09-20 13:12:29 +0000
4999+++ sale/wizard/__init__.py 2012-10-02 11:29:53 +0000
5000@@ -23,4 +23,4 @@
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: