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