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

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account/account.py'
--- account/account.py 2012-09-30 12:46:54 +0000
+++ account/account.py 2012-10-02 11:29:53 +0000
@@ -595,12 +595,15 @@
595 res.append((record['id'], name))595 res.append((record['id'], name))
596 return res596 return res
597597
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):
599 if default is None:
600 default = {}
601 else:
602 default = default.copy()
603 if done_list is None:
604 done_list = []
599 account = self.browse(cr, uid, id, context=context)605 account = self.browse(cr, uid, id, context=context)
600 new_child_ids = []606 new_child_ids = []
601 if not default:
602 default = {}
603 default = default.copy()
604 default.update(code=_("%s (copy)") % (account['code'] or ''))607 default.update(code=_("%s (copy)") % (account['code'] or ''))
605 if not local:608 if not local:
606 done_list = []609 done_list = []
@@ -777,11 +780,14 @@
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']),
778 ]781 ]
779782
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):
784 if default is None:
785 default = {}
786 else:
787 default = default.copy()
788 if done_list is None:
789 done_list = []
781 journal = self.browse(cr, uid, id, context=context)790 journal = self.browse(cr, uid, id, context=context)
782 if not default:
783 default = {}
784 default = default.copy()
785 default.update(791 default.update(
786 code=_("%s (copy)") % (journal['code'] or ''),792 code=_("%s (copy)") % (journal['code'] or ''),
787 name=_("%s (copy)") % (journal['name'] or ''),793 name=_("%s (copy)") % (journal['name'] or ''),
@@ -1178,7 +1184,7 @@
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),
1179 }1185 }
11801186
1181 def copy(self, cr, uid, id, default={}, context=None):1187 def copy(self, cr, uid, id, default=None, context=None):
1182 default.update({1188 default.update({
1183 'period_ids': [],1189 'period_ids': [],
1184 'end_journal_period_id': False1190 'end_journal_period_id': False
@@ -1437,9 +1443,15 @@
1437 result = super(account_move, self).create(cr, uid, vals, context)1443 result = super(account_move, self).create(cr, uid, vals, context)
1438 return result1444 return result
14391445
1440 def copy(self, cr, uid, id, default={}, context=None):1446 def copy(self, cr, uid, id, default=None, context=None):
1447 if context is None:
1448 default = {}
1449 else:
1450 default = default.copy()
1441 if context is None:1451 if context is None:
1442 context = {}1452 context = {}
1453 else:
1454 context = context.copy()
1443 default.update({1455 default.update({
1444 'state':'draft',1456 'state':'draft',
1445 'name':'/',1457 'name':'/',
@@ -2269,7 +2281,10 @@
2269 _defaults = {2281 _defaults = {
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'),
2271 }2283 }
2272 def generate(self, cr, uid, ids, datas={}, context=None):2284
2285 def generate(self, cr, uid, ids, data=None, context=None):
2286 if data is None:
2287 data = {}
2273 move_ids = []2288 move_ids = []
2274 entry = {}2289 entry = {}
2275 account_move_obj = self.pool.get('account.move')2290 account_move_obj = self.pool.get('account.move')
@@ -2280,8 +2295,8 @@
2280 if context is None:2295 if context is None:
2281 context = {}2296 context = {}
22822297
2283 if datas.get('date', False):2298 if data.get('date', False):
2284 context.update({'date': datas['date']})2299 context.update({'date': data['date']})
22852300
2286 move_date = context.get('date', time.strftime('%Y-%m-%d'))2301 move_date = context.get('date', time.strftime('%Y-%m-%d'))
2287 move_date = datetime.strptime(move_date,"%Y-%m-%d")2302 move_date = datetime.strptime(move_date,"%Y-%m-%d")
@@ -2467,10 +2482,10 @@
2467 all_moves = []2482 all_moves = []
2468 obj_model = self.pool.get('account.model')2483 obj_model = self.pool.get('account.model')
2469 for line in self.browse(cr, uid, ids, context=context):2484 for line in self.browse(cr, uid, ids, context=context):
2470 datas = {2485 data = {
2471 'date': line.date,2486 'date': line.date,
2472 }2487 }
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)
2474 tocheck[line.subscription_id.id] = True2489 tocheck[line.subscription_id.id] = True
2475 self.write(cr, uid, [line.id], {'move_id':move_ids[0]})2490 self.write(cr, uid, [line.id], {'move_id':move_ids[0]})
2476 all_moves.extend(move_ids)2491 all_moves.extend(move_ids)
@@ -3236,7 +3251,7 @@
3236 property_obj.create(cr, uid, vals, context=context)3251 property_obj.create(cr, uid, vals, context=context)
3237 return True3252 return True
32383253
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):
3240 '''3255 '''
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.
32423257
@@ -3254,6 +3269,12 @@
3254 * a last identical containing the mapping of tax code templates and tax codes3269 * a last identical containing the mapping of tax code templates and tax codes
3255 :rtype: tuple(dict, dict, dict)3270 :rtype: tuple(dict, dict, dict)
3256 '''3271 '''
3272 if acc_ref is None:
3273 acc_ref = {}
3274 if taxes_ref is None:
3275 taxes_ref = {}
3276 if tax_code_ref is None:
3277 tax_code_ref = {}
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)
3258 if template.parent_id:3279 if template.parent_id:
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)
@@ -3266,7 +3287,7 @@
3266 tax_code_ref.update(tmp3)3287 tax_code_ref.update(tmp3)
3267 return acc_ref, taxes_ref, tax_code_ref3288 return acc_ref, taxes_ref, tax_code_ref
32683289
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):
3270 '''3291 '''
3271 This function generates all the objects from the templates3292 This function generates all the objects from the templates
32723293
@@ -3284,6 +3305,12 @@
3284 * a last identical containing the mapping of tax code templates and tax codes3305 * a last identical containing the mapping of tax code templates and tax codes
3285 :rtype: tuple(dict, dict, dict)3306 :rtype: tuple(dict, dict, dict)
3286 '''3307 '''
3308 if account_ref is None:
3309 account_ref = {}
3310 if taxes_ref is None:
3311 taxes_ref = {}
3312 if tax_code_ref is None:
3313 tax_code_ref = {}
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)
3288 obj_tax_code_template = self.pool.get('account.tax.code.template')3315 obj_tax_code_template = self.pool.get('account.tax.code.template')
3289 obj_acc_tax = self.pool.get('account.tax')3316 obj_acc_tax = self.pool.get('account.tax')
32903317
=== modified file 'account/account_bank.py'
--- account/account_bank.py 2012-09-13 11:46:09 +0000
+++ account/account_bank.py 2012-10-02 11:29:53 +0000
@@ -29,12 +29,12 @@
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,
30 string="Currency", help="Currency of the related account journal."),30 string="Currency", help="Currency of the related account journal."),
31 }31 }
32 def create(self, cr, uid, data, context={}):32 def create(self, cr, uid, data, context=None):
33 result = super(bank, self).create(cr, uid, data, context=context)33 result = super(bank, self).create(cr, uid, data, context=context)
34 self.post_write(cr, uid, [result], context=context)34 self.post_write(cr, uid, [result], context=context)
35 return result35 return result
3636
37 def write(self, cr, uid, ids, data, context={}):37 def write(self, cr, uid, ids, data, context=None):
38 result = super(bank, self).write(cr, uid, ids, data, context=context)38 result = super(bank, self).write(cr, uid, ids, data, context=context)
39 self.post_write(cr, uid, ids, context=context)39 self.post_write(cr, uid, ids, context=context)
40 return result40 return result
@@ -53,7 +53,7 @@
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 ''
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)
5555
56 def post_write(self, cr, uid, ids, context={}):56 def post_write(self, cr, uid, ids, context=None):
57 if isinstance(ids, (int, long)):57 if isinstance(ids, (int, long)):
58 ids = [ids]58 ids = [ids]
5959
6060
=== modified file 'account/account_move_line.py'
--- account/account_move_line.py 2012-09-29 12:34:49 +0000
+++ account/account_move_line.py 2012-10-02 11:29:53 +0000
@@ -1105,7 +1105,7 @@
1105 'has been confirmed.') % res[2])1105 'has been confirmed.') % res[2])
1106 return res1106 return res
11071107
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):
1109 # Function remove move rencocile ids related with moves1109 # Function remove move rencocile ids related with moves
1110 obj_move_line = self.pool.get('account.move.line')1110 obj_move_line = self.pool.get('account.move.line')
1111 obj_move_rec = self.pool.get('account.move.reconcile')1111 obj_move_rec = self.pool.get('account.move.reconcile')
11121112
=== modified file 'account/project/wizard/account_analytic_chart.py'
--- account/project/wizard/account_analytic_chart.py 2011-01-14 00:11:01 +0000
+++ account/project/wizard/account_analytic_chart.py 2012-10-02 11:29:53 +0000
@@ -47,4 +47,4 @@
47 return result47 return result
4848
49account_analytic_chart()49account_analytic_chart()
50# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
51\ No newline at end of file50\ No newline at end of file
51# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
5252
=== modified file 'account/project/wizard/account_analytic_inverted_balance_report.py'
--- account/project/wizard/account_analytic_inverted_balance_report.py 2011-04-29 08:49:48 +0000
+++ account/project/wizard/account_analytic_inverted_balance_report.py 2012-10-02 11:29:53 +0000
@@ -52,4 +52,4 @@
52 }52 }
5353
54account_analytic_inverted_balance()54account_analytic_inverted_balance()
55# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
56\ No newline at end of file55\ No newline at end of file
56# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
5757
=== modified file 'account/project/wizard/project_account_analytic_line.py'
--- account/project/wizard/project_account_analytic_line.py 2011-05-02 12:16:02 +0000
+++ account/project/wizard/project_account_analytic_line.py 2012-10-02 11:29:53 +0000
@@ -55,4 +55,4 @@
5555
56project_account_analytic_line()56project_account_analytic_line()
5757
58# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
59\ No newline at end of file58\ No newline at end of file
59# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
6060
=== modified file 'account/report/account_balance.py'
--- account/report/account_balance.py 2011-06-08 10:04:27 +0000
+++ account/report/account_balance.py 2012-10-02 11:29:53 +0000
@@ -68,7 +68,7 @@
68 return self.pool.get('account.account').browse(self.cr, self.uid, data['form']['id']).company_id.name68 return self.pool.get('account.account').browse(self.cr, self.uid, data['form']['id']).company_id.name
69 return super(account_balance ,self)._get_account(data)69 return super(account_balance ,self)._get_account(data)
7070
71 def lines(self, form, ids=[], done=None):#, level=1):71 def lines(self, form, ids=None, done=None):
72 def _process_child(accounts, disp_acc, parent):72 def _process_child(accounts, disp_acc, parent):
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]
74 currency_obj = self.pool.get('res.currency')74 currency_obj = self.pool.get('res.currency')
7575
=== modified file 'account/report/account_central_journal.py'
--- account/report/account_central_journal.py 2011-01-14 00:11:01 +0000
+++ account/report/account_central_journal.py 2012-10-02 11:29:53 +0000
@@ -105,4 +105,4 @@
105105
106report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/account_central_journal.rml', parser=journal_print, header='internal')106report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/account_central_journal.rml', parser=journal_print, header='internal')
107107
108# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
109\ No newline at end of file108\ No newline at end of file
109# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
110110
=== modified file 'account/report/account_general_journal.py'
--- account/report/account_general_journal.py 2011-01-14 00:11:01 +0000
+++ account/report/account_general_journal.py 2012-10-02 11:29:53 +0000
@@ -158,4 +158,4 @@
158158
159report_sxw.report_sxw('report.account.general.journal', 'account.journal.period', 'addons/account/report/general_journal.rml', parser=journal_print, header='internal')159report_sxw.report_sxw('report.account.general.journal', 'account.journal.period', 'addons/account/report/general_journal.rml', parser=journal_print, header='internal')
160160
161# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
162\ No newline at end of file161\ No newline at end of file
162# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
163163
=== modified file 'account/report/account_report.py'
--- account/report/account_report.py 2012-06-05 11:53:52 +0000
+++ account/report/account_report.py 2012-10-02 11:29:53 +0000
@@ -284,4 +284,4 @@
284 )""")284 )""")
285report_account_sales()285report_account_sales()
286286
287# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
288\ No newline at end of file287\ No newline at end of file
288# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
289289
=== modified file 'account/report/account_tax_report.py'
--- account/report/account_tax_report.py 2012-02-03 16:26:19 +0000
+++ account/report/account_tax_report.py 2012-10-02 11:29:53 +0000
@@ -160,7 +160,7 @@
160 i+=1160 i+=1
161 return res161 return res
162162
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):
164 obj_tc = self.pool.get('account.tax.code')164 obj_tc = self.pool.get('account.tax.code')
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)
166166
@@ -171,7 +171,11 @@
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)
172 return res172 return res
173173
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):
175 if account_list is None:
176 account_list = []
177 if period_list is None:
178 period_list = []
175 res = []179 res = []
176 obj_tc = self.pool.get('account.tax.code')180 obj_tc = self.pool.get('account.tax.code')
177 for account in account_list:181 for account in account_list:
178182
=== modified file 'account/res_currency.py'
--- account/res_currency.py 2012-03-30 13:30:01 +0000
+++ account/res_currency.py 2012-10-02 11:29:53 +0000
@@ -45,4 +45,3 @@
45res_currency_account()45res_currency_account()
4646
47# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:47# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
48
4948
=== modified file 'account/wizard/account_invoice_state.py'
--- account/wizard/account_invoice_state.py 2012-08-06 15:44:10 +0000
+++ account/wizard/account_invoice_state.py 2012-10-02 11:29:53 +0000
@@ -71,4 +71,4 @@
7171
72account_invoice_cancel()72account_invoice_cancel()
7373
74# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
75\ No newline at end of file74\ No newline at end of file
75# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
7676
=== modified file 'account/wizard/account_journal_select.py'
--- account/wizard/account_journal_select.py 2011-01-14 00:11:01 +0000
+++ account/wizard/account_journal_select.py 2012-10-02 11:29:53 +0000
@@ -47,4 +47,4 @@
4747
48account_journal_select()48account_journal_select()
4949
50# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
51\ No newline at end of file50\ No newline at end of file
51# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
5252
=== modified file 'account/wizard/account_move_bank_reconcile.py'
--- account/wizard/account_move_bank_reconcile.py 2012-07-25 07:33:57 +0000
+++ account/wizard/account_move_bank_reconcile.py 2012-10-02 11:29:53 +0000
@@ -61,4 +61,4 @@
6161
62account_move_bank_reconcile()62account_move_bank_reconcile()
6363
64# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
65\ No newline at end of file64\ No newline at end of file
65# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
6666
=== modified file 'account/wizard/account_move_journal.py'
--- account/wizard/account_move_journal.py 2012-09-18 13:27:27 +0000
+++ account/wizard/account_move_journal.py 2012-10-02 11:29:53 +0000
@@ -38,7 +38,7 @@
38 _defaults = {38 _defaults = {
39 'target_move': 'all'39 'target_move': 'all'
40 }40 }
41 def _get_period(self, cr, uid, context={}):41 def _get_period(self, cr, uid, context=None):
42 """42 """
43 Return default account period value43 Return default account period value
44 """44 """
4545
=== modified file 'account/wizard/account_move_line_reconcile_select.py'
--- account/wizard/account_move_line_reconcile_select.py 2011-02-15 12:13:39 +0000
+++ account/wizard/account_move_line_reconcile_select.py 2012-10-02 11:29:53 +0000
@@ -52,4 +52,4 @@
5252
53account_move_line_reconcile_select()53account_move_line_reconcile_select()
5454
55# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
56\ No newline at end of file55\ No newline at end of file
56# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
5757
=== modified file 'account/wizard/account_move_line_select.py'
--- account/wizard/account_move_line_select.py 2011-01-14 00:11:01 +0000
+++ account/wizard/account_move_line_select.py 2012-10-02 11:29:53 +0000
@@ -69,4 +69,4 @@
6969
70account_move_line_select()70account_move_line_select()
7171
72# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
73\ No newline at end of file72\ No newline at end of file
73# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
7474
=== modified file 'account/wizard/account_move_line_unreconcile_select.py'
--- account/wizard/account_move_line_unreconcile_select.py 2011-02-15 12:13:39 +0000
+++ account/wizard/account_move_line_unreconcile_select.py 2012-10-02 11:29:53 +0000
@@ -41,4 +41,4 @@
4141
42account_move_line_unreconcile_select()42account_move_line_unreconcile_select()
4343
44# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
45\ No newline at end of file44\ No newline at end of file
45# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4646
=== modified file 'account/wizard/account_reconcile.py'
--- account/wizard/account_reconcile.py 2012-09-29 09:14:16 +0000
+++ account/wizard/account_reconcile.py 2012-10-02 11:29:53 +0000
@@ -160,4 +160,4 @@
160160
161account_move_line_reconcile_writeoff()161account_move_line_reconcile_writeoff()
162162
163# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
164\ No newline at end of file163\ No newline at end of file
164# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
165165
=== modified file 'account/wizard/account_state_open.py'
--- account/wizard/account_state_open.py 2012-07-25 07:33:57 +0000
+++ account/wizard/account_state_open.py 2012-10-02 11:29:53 +0000
@@ -41,4 +41,4 @@
4141
42account_state_open()42account_state_open()
4343
44# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
45\ No newline at end of file44\ No newline at end of file
45# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4646
=== modified file 'account/wizard/account_subscription_generate.py'
--- account/wizard/account_subscription_generate.py 2012-06-25 13:33:53 +0000
+++ account/wizard/account_subscription_generate.py 2012-10-02 11:29:53 +0000
@@ -50,4 +50,4 @@
5050
51account_subscription_generate()51account_subscription_generate()
5252
53# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
54\ No newline at end of file53\ No newline at end of file
54# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
5555
=== modified file 'account/wizard/account_unreconcile.py'
--- account/wizard/account_unreconcile.py 2011-01-14 00:11:01 +0000
+++ account/wizard/account_unreconcile.py 2012-10-02 11:29:53 +0000
@@ -50,4 +50,4 @@
5050
51account_unreconcile_reconcile()51account_unreconcile_reconcile()
5252
53# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
54\ No newline at end of file53\ No newline at end of file
54# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
5555
=== modified file 'account_analytic_plans/report/crossovered_analytic.py'
--- account_analytic_plans/report/crossovered_analytic.py 2012-06-13 09:13:22 +0000
+++ account_analytic_plans/report/crossovered_analytic.py 2012-10-02 11:29:53 +0000
@@ -34,7 +34,7 @@
34 })34 })
35 self.base_amount = 0.0035 self.base_amount = 0.00
3636
37 def find_children(self,ref_ids):37 def find_children(self, ref_ids):
38 to_return_ids = []38 to_return_ids = []
39 final_list = []39 final_list = []
40 parent_list = []40 parent_list = []
@@ -53,7 +53,7 @@
53 final_list.extend(set_list)53 final_list.extend(set_list)
54 return final_list #to_return_ids[0]54 return final_list #to_return_ids[0]
5555
56 def set_account(self,cats):56 def set_account(self, cats):
57 lst = []57 lst = []
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)
59 for cat in category:59 for cat in category:
@@ -62,7 +62,7 @@
62 lst.extend(self.set_account(cat['child_ids']))62 lst.extend(self.set_account(cat['child_ids']))
63 return lst63 return lst
6464
65 def _ref_lines(self,form):65 def _ref_lines(self, form):
66 result = []66 result = []
67 res = {}67 res = {}
68 acc_pool = self.pool.get('account.analytic.account')68 acc_pool = self.pool.get('account.analytic.account')
@@ -112,7 +112,9 @@
112 result.append(res)112 result.append(res)
113 return result113 return result
114114
115 def _lines(self, form, ids={}):115 def _lines(self, form, ids=None):
116 if ids is None:
117 ids = {}
116 if not ids:118 if not ids:
117 ids = self.ids119 ids = self.ids
118120
119121
=== modified file 'account_anglo_saxon/__init__.py'
--- account_anglo_saxon/__init__.py 2011-01-14 00:11:01 +0000
+++ account_anglo_saxon/__init__.py 2012-10-02 11:29:53 +0000
@@ -23,4 +23,4 @@
23import purchase23import purchase
24import invoice24import invoice
2525
26# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
27\ No newline at end of file26\ No newline at end of file
27# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2828
=== removed file 'account_anglo_saxon/sale.py'
--- account_anglo_saxon/sale.py 2011-01-14 00:11:01 +0000
+++ account_anglo_saxon/sale.py 1970-01-01 00:00:00 +0000
@@ -1,43 +0,0 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from osv import fields, osv
23
24#class sale_order_line(osv.osv):
25# _name = 'sale.order.line'
26# _description = 'Sale Order line'
27# _inherit = 'sale.order.line'
28#
29# def invoice_line_create(self, cr, uid, ids, context={}):
30# line_ids = super('sale_order_line',self).invoice_line_create(cr, uid, ids, context)
31# invoice_line_obj = self.pool.get('account.invoice.line')
32# for line in invoice_line_obj.browse(cr, uid, line_ids):
33# if line.product_id:
34# a = line.product_id.product_tmpl_id.property_stock_account_output and line.product_id.product_tmpl_id.property_stock_account_output.id
35# if not a:
36# a = line.product_id.categ_id.property_stock_account_output_categ and line.product_id.categ_id.property_stock_account_output_categ.id
37# if a:
38# a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, a)
39# invoice_line_obj.write(cr, uid, line.id, {'account_id':a})
40#
41#sale_order_line()
42
43# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
440
=== modified file 'account_asset/account_asset.py'
--- account_asset/account_asset.py 2012-09-29 13:21:28 +0000
+++ account_asset/account_asset.py 2012-10-02 11:29:53 +0000
@@ -75,7 +75,7 @@
75 _name = 'account.asset.asset'75 _name = 'account.asset.asset'
76 _description = 'Asset'76 _description = 'Asset'
7777
78 def _get_period(self, cr, uid, context={}):78 def _get_period(self, cr, uid, context=None):
79 periods = self.pool.get('account.period').find(cr, uid)79 periods = self.pool.get('account.period').find(cr, uid)
80 if periods:80 if periods:
81 return periods[0]81 return periods[0]
@@ -176,7 +176,9 @@
176 year = depreciation_date.year176 year = depreciation_date.year
177 return True177 return True
178178
179 def validate(self, cr, uid, ids, context={}):179 def validate(self, cr, uid, ids, context=None):
180 if context is None:
181 context = {}
180 return self.write(cr, uid, ids, {182 return self.write(cr, uid, ids, {
181 'state':'open'183 'state':'open'
182 }, context)184 }, context)
@@ -304,7 +306,7 @@
304 default.update({'depreciation_line_ids': [], 'state': 'draft'})306 default.update({'depreciation_line_ids': [], 'state': 'draft'})
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)
306308
307 def _compute_entries(self, cr, uid, ids, period_id, context={}):309 def _compute_entries(self, cr, uid, ids, period_id, context=None):
308 result = []310 result = []
309 period_obj = self.pool.get('account.period')311 period_obj = self.pool.get('account.period')
310 depreciation_obj = self.pool.get('account.asset.depreciation.line')312 depreciation_obj = self.pool.get('account.asset.depreciation.line')
311313
=== modified file 'account_budget/report/analytic_account_budget_report.py'
--- account_budget/report/analytic_account_budget_report.py 2011-01-14 00:11:01 +0000
+++ account_budget/report/analytic_account_budget_report.py 2012-10-02 11:29:53 +0000
@@ -35,7 +35,9 @@
35 })35 })
36 self.context = context36 self.context = context
3737
38 def funct(self, object, form, ids={}, done=None, level=1):38 def funct(self, object, form, ids=None, done=None, level=1):
39 if ids is None:
40 ids = {}
39 if not ids:41 if not ids:
40 ids = self.ids42 ids = self.ids
41 if not done:43 if not done:
@@ -153,7 +155,7 @@
153 tot['perc'] = float(tot['prac'] / tot['theo']) * 100155 tot['perc'] = float(tot['prac'] / tot['theo']) * 100
154 return result156 return result
155157
156 def funct_total(self,form):158 def funct_total(self, form):
157 result = []159 result = []
158 res = {}160 res = {}
159 res = {161 res = {
@@ -167,4 +169,4 @@
167169
168report_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')170report_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')
169171
170# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
171\ No newline at end of file172\ No newline at end of file
173# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
172174
=== modified file 'account_budget/report/budget_report.py'
--- account_budget/report/budget_report.py 2011-04-15 06:09:42 +0000
+++ account_budget/report/budget_report.py 2012-10-02 11:29:53 +0000
@@ -34,7 +34,9 @@
34 })34 })
35 self.context = context35 self.context = context
3636
37 def funct(self, object, form, ids={}, done=None, level=1):37 def funct(self, object, form, ids=None, done=None, level=1):
38 if ids is None:
39 ids = {}
38 if not ids:40 if not ids:
39 ids = self.ids41 ids = self.ids
40 if not done:42 if not done:
4143
=== modified file 'account_budget/report/crossovered_budget_report.py'
--- account_budget/report/crossovered_budget_report.py 2011-04-15 06:09:42 +0000
+++ account_budget/report/crossovered_budget_report.py 2012-10-02 11:29:53 +0000
@@ -37,7 +37,9 @@
37 })37 })
38 self.context = context38 self.context = context
3939
40 def funct(self, object, form, ids={}, done=None, level=1):40 def funct(self, object, form, ids=None, done=None, level=1):
41 if ids is None:
42 ids = {}
41 if not ids:43 if not ids:
42 ids = self.ids44 ids = self.ids
43 if not done:45 if not done:
4446
=== modified file 'account_budget/wizard/account_budget_analytic.py'
--- account_budget/wizard/account_budget_analytic.py 2011-04-29 08:49:48 +0000
+++ account_budget/wizard/account_budget_analytic.py 2012-10-02 11:29:53 +0000
@@ -52,4 +52,4 @@
5252
53account_budget_analytic()53account_budget_analytic()
5454
55# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
56\ No newline at end of file55\ No newline at end of file
56# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
5757
=== modified file 'account_budget/wizard/account_budget_crossovered_report.py'
--- account_budget/wizard/account_budget_crossovered_report.py 2011-04-29 08:49:48 +0000
+++ account_budget/wizard/account_budget_crossovered_report.py 2012-10-02 11:29:53 +0000
@@ -53,4 +53,4 @@
5353
54account_budget_crossvered_report()54account_budget_crossvered_report()
5555
56# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
57\ No newline at end of file56\ No newline at end of file
57# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
5858
=== modified file 'account_budget/wizard/account_budget_report.py'
--- account_budget/wizard/account_budget_report.py 2011-04-29 08:49:48 +0000
+++ account_budget/wizard/account_budget_report.py 2012-10-02 11:29:53 +0000
@@ -54,4 +54,4 @@
5454
55account_budget_report()55account_budget_report()
5656
57# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
58\ No newline at end of file57\ No newline at end of file
58# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
5959
=== modified file 'account_followup/__init__.py'
--- account_followup/__init__.py 2012-09-17 15:10:31 +0000
+++ account_followup/__init__.py 2012-10-02 11:29:53 +0000
@@ -23,4 +23,4 @@
23import wizard23import wizard
24import report24import report
2525
26# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
27\ No newline at end of file26\ No newline at end of file
27# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2828
=== modified file 'account_followup/wizard/__init__.py'
--- account_followup/wizard/__init__.py 2011-01-14 00:11:01 +0000
+++ account_followup/wizard/__init__.py 2012-10-02 11:29:53 +0000
@@ -21,4 +21,4 @@
2121
22import account_followup_print22import account_followup_print
2323
24# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
25\ No newline at end of file24\ No newline at end of file
25# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2626
=== modified file 'account_followup/wizard/account_followup_print.py'
--- account_followup/wizard/account_followup_print.py 2012-09-05 15:14:51 +0000
+++ account_followup/wizard/account_followup_print.py 2012-10-02 11:29:53 +0000
@@ -209,7 +209,7 @@
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}
210 return {'partner_ids': partner_list, 'to_update': to_update}210 return {'partner_ids': partner_list, 'to_update': to_update}
211211
212 def do_mail(self ,cr, uid, ids, context=None):212 def do_mail(self, cr, uid, ids, context=None):
213 mod_obj = self.pool.get('ir.model.data')213 mod_obj = self.pool.get('ir.model.data')
214 move_obj = self.pool.get('account.move.line')214 move_obj = self.pool.get('account.move.line')
215 user_obj = self.pool.get('res.users')215 user_obj = self.pool.get('res.users')
216216
=== modified file 'account_payment/__init__.py'
--- account_payment/__init__.py 2011-01-14 00:11:01 +0000
+++ account_payment/__init__.py 2012-10-02 11:29:53 +0000
@@ -29,4 +29,4 @@
29import account_invoice29import account_invoice
30import report30import report
3131
32# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
33\ No newline at end of file32\ No newline at end of file
33# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3434
=== modified file 'account_payment/account_invoice.py'
--- account_payment/account_invoice.py 2011-07-01 23:41:24 +0000
+++ account_payment/account_invoice.py 2012-10-02 11:29:53 +0000
@@ -50,4 +50,4 @@
5050
51Invoice()51Invoice()
5252
53# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
54\ No newline at end of file53\ No newline at end of file
54# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
5555
=== modified file 'account_payment/account_move_line.py'
--- account_payment/account_move_line.py 2012-08-07 11:31:37 +0000
+++ account_payment/account_move_line.py 2012-10-02 11:29:53 +0000
@@ -26,7 +26,7 @@
26class account_move_line(osv.osv):26class account_move_line(osv.osv):
27 _inherit = "account.move.line"27 _inherit = "account.move.line"
2828
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):
30 """ Return the amount still to pay regarding all the payemnt orders30 """ Return the amount still to pay regarding all the payemnt orders
31 (excepting cancelled orders)"""31 (excepting cancelled orders)"""
32 if not ids:32 if not ids:
@@ -117,4 +117,4 @@
117117
118account_move_line()118account_move_line()
119119
120# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
121\ No newline at end of file120\ No newline at end of file
121# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
122122
=== modified file 'account_payment/account_payment.py'
--- account_payment/account_payment.py 2012-07-25 11:39:00 +0000
+++ account_payment/account_payment.py 2012-10-02 11:29:53 +0000
@@ -139,7 +139,9 @@
139 wf_service.trg_validate(uid, 'payment.order', ids[0], 'done', cr)139 wf_service.trg_validate(uid, 'payment.order', ids[0], 'done', cr)
140 return True140 return True
141141
142 def copy(self, cr, uid, id, default={}, context=None):142 def copy(self, cr, uid, id, default=None, context=None):
143 if default is None:
144 default = {}
143 default.update({145 default.update({
144 'state': 'draft',146 'state': 'draft',
145 'line_ids': [],147 'line_ids': [],
146148
=== modified file 'account_payment/report/__init__.py'
--- account_payment/report/__init__.py 2011-01-14 00:11:01 +0000
+++ account_payment/report/__init__.py 2012-10-02 11:29:53 +0000
@@ -20,4 +20,4 @@
20##############################################################################20##############################################################################
2121
22import payment_order22import payment_order
23# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
24\ No newline at end of file23\ No newline at end of file
24# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2525
=== modified file 'account_payment/report/payment_order.py'
--- account_payment/report/payment_order.py 2011-01-14 00:11:01 +0000
+++ account_payment/report/payment_order.py 2012-10-02 11:29:53 +0000
@@ -77,7 +77,7 @@
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)
78 return user.company_id and user.company_id.currency_id and user.company_id.currency_id.symbol or False78 return user.company_id and user.company_id.currency_id and user.company_id.currency_id.symbol or False
7979
80 def _get_account_name(self,bank_id):80 def _get_account_name(self, bank_id):
81 if bank_id:81 if bank_id:
82 pool = pooler.get_pool(self.cr.dbname)82 pool = pooler.get_pool(self.cr.dbname)
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])
@@ -87,4 +87,4 @@
8787
88report_sxw.report_sxw('report.payment.order', 'payment.order', 'addons/account_payment/report/payment_order.rml', parser=payment_order, header="external")88report_sxw.report_sxw('report.payment.order', 'payment.order', 'addons/account_payment/report/payment_order.rml', parser=payment_order, header="external")
8989
90# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
91\ No newline at end of file90\ No newline at end of file
91# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
9292
=== modified file 'account_payment/wizard/__init__.py'
--- account_payment/wizard/__init__.py 2011-01-14 00:11:01 +0000
+++ account_payment/wizard/__init__.py 2012-10-02 11:29:53 +0000
@@ -23,4 +23,4 @@
23import account_payment_populate_statement23import account_payment_populate_statement
24import account_payment_pay24import account_payment_pay
2525
26# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
27\ No newline at end of file26\ No newline at end of file
27# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2828
=== modified file 'account_payment/wizard/account_payment_pay.py'
--- account_payment/wizard/account_payment_pay.py 2012-01-31 13:36:57 +0000
+++ account_payment/wizard/account_payment_pay.py 2012-10-02 11:29:53 +0000
@@ -56,4 +56,4 @@
5656
57account_payment_make_payment()57account_payment_make_payment()
5858
59# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
60\ No newline at end of file59\ No newline at end of file
60# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
6161
=== modified file 'account_payment/wizard/account_payment_populate_statement.py'
--- account_payment/wizard/account_payment_populate_statement.py 2012-01-31 13:36:57 +0000
+++ account_payment/wizard/account_payment_populate_statement.py 2012-10-02 11:29:53 +0000
@@ -120,4 +120,4 @@
120120
121account_payment_populate_statement()121account_payment_populate_statement()
122122
123# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
124\ No newline at end of file123\ No newline at end of file
124# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
125125
=== modified file 'account_sequence/__init__.py'
--- account_sequence/__init__.py 2011-01-14 00:11:01 +0000
+++ account_sequence/__init__.py 2012-10-02 11:29:53 +0000
@@ -22,4 +22,4 @@
22import account_sequence22import account_sequence
23import account_sequence_installer23import account_sequence_installer
2424
25# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
26\ No newline at end of file25\ No newline at end of file
26# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2727
=== modified file 'account_voucher/__init__.py'
--- account_voucher/__init__.py 2011-10-16 01:28:00 +0000
+++ account_voucher/__init__.py 2012-10-02 11:29:53 +0000
@@ -24,4 +24,4 @@
24import report24import report
25import wizard25import wizard
2626
27# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
28\ No newline at end of file27\ No newline at end of file
28# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2929
=== modified file 'account_voucher/account_voucher.py'
--- account_voucher/account_voucher.py 2012-09-30 11:20:34 +0000
+++ account_voucher/account_voucher.py 2012-10-02 11:29:53 +0000
@@ -849,7 +849,7 @@
849 res['account_id'] = account_id849 res['account_id'] = account_id
850 return {'value':res}850 return {'value':res}
851851
852 def _sel_context(self, cr, uid, voucher_id,context=None):852 def _sel_context(self, cr, uid, voucher_id, context=None):
853 """853 """
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.
855855
@@ -1275,7 +1275,9 @@
1275 self.reconcile_send_note(cr, uid, [voucher.id], context=context)1275 self.reconcile_send_note(cr, uid, [voucher.id], context=context)
1276 return True1276 return True
12771277
1278 def copy(self, cr, uid, id, default={}, context=None):1278 def copy(self, cr, uid, id, default=None, context=None):
1279 if default is None:
1280 default = {}
1279 default.update({1281 default.update({
1280 'state': 'draft',1282 'state': 'draft',
1281 'number': False,1283 'number': False,
12821284
=== modified file 'account_voucher/report/__init__.py'
--- account_voucher/report/__init__.py 2011-01-14 00:11:01 +0000
+++ account_voucher/report/__init__.py 2012-10-02 11:29:53 +0000
@@ -23,4 +23,4 @@
23import account_voucher_print23import account_voucher_print
24import account_voucher_sales_receipt24import account_voucher_sales_receipt
2525
26# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
27\ No newline at end of file26\ No newline at end of file
27# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2828
=== modified file 'anonymization/anonymization.py'
--- anonymization/anonymization.py 2012-09-20 09:08:13 +0000
+++ anonymization/anonymization.py 2012-10-02 11:29:53 +0000
@@ -363,7 +363,7 @@
363 })363 })
364 raise osv.except_osv(error_type, error_msg)364 raise osv.except_osv(error_type, error_msg)
365365
366 def anonymize_database(self,cr, uid, ids, context=None):366 def anonymize_database(self, cr, uid, ids, context=None):
367 """Sets the 'anonymized' state to defined fields"""367 """Sets the 'anonymized' state to defined fields"""
368368
369 # create a new history record:369 # create a new history record:
@@ -498,7 +498,7 @@
498 'target':'new',498 'target':'new',
499 }499 }
500500
501 def reverse_anonymize_database(self,cr, uid, ids, context=None):501 def reverse_anonymize_database(self, cr, uid, ids, context=None):
502 """Set the 'clear' state to defined fields"""502 """Set the 'clear' state to defined fields"""
503503
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')
505505
=== modified file 'audittrail/audittrail.py'
--- audittrail/audittrail.py 2012-09-30 12:53:37 +0000
+++ audittrail/audittrail.py 2012-10-02 11:29:53 +0000
@@ -202,7 +202,7 @@
202 res = value202 res = value
203 return res203 return res
204204
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):
206 """206 """
207 Creates lines for changed fields with its old and new values207 Creates lines for changed fields with its old and new values
208208
@@ -211,6 +211,8 @@
211 @param model: Object which values are being changed211 @param model: Object which values are being changed
212 @param lines: List of values for line is to be created212 @param lines: List of values for line is to be created
213 """213 """
214 if lines is None:
215 lines = []
214 pool = pooler.get_pool(cr.dbname)216 pool = pooler.get_pool(cr.dbname)
215 obj_pool = pool.get(model.model)217 obj_pool = pool.get(model.model)
216 model_pool = pool.get('ir.model')218 model_pool = pool.get('ir.model')
@@ -349,9 +351,9 @@
349 data[(model.id, resource_id)] = {'text':values_text, 'value': values}351 data[(model.id, resource_id)] = {'text':values_text, 'value': values}
350 return data352 return data
351353
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):
353 """355 """
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
355 (after the method was executed) and returns a structure with all the needed information to357 (after the method was executed) and returns a structure with all the needed information to
356 log those differences.358 log those differences.
357359
@@ -375,9 +377,11 @@
375 (model.id, resource_id): []377 (model.id, resource_id): []
376 }378 }
377379
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
379 record, we may have to log a change done in a x2many field of that object381 record, we may have to log a change done in a x2many field of that object
380 """382 """
383 if field_list is None:
384 field_list = []
381 key = (model.id, resource_id)385 key = (model.id, resource_id)
382 lines = {386 lines = {
383 key: []387 key: []
@@ -416,7 +420,7 @@
416 lines[key].append(data)420 lines[key].append(data)
417 return lines421 return lines
418422
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):
420 """424 """
421 This function processes and iterates recursively to log the difference between the old425 This function processes and iterates recursively to log the difference between the old
422 data (i.e before the method was executed) and the new data and creates audittrail log426 data (i.e before the method was executed) and the new data and creates audittrail log
@@ -435,6 +439,8 @@
435 on specific fields only.439 on specific fields only.
436 :return: True440 :return: True
437 """441 """
442 if field_list is None:
443 field_list = []
438 # loop on all the given ids444 # loop on all the given ids
439 for res_id in res_ids:445 for res_id in res_ids:
440 # compare old and new values and get audittrail log lines accordingly446 # compare old and new values and get audittrail log lines accordingly
441447
=== modified file 'base_crypt/crypt.py'
--- base_crypt/crypt.py 2012-08-10 14:12:19 +0000
+++ base_crypt/crypt.py 2012-10-02 11:29:53 +0000
@@ -47,7 +47,9 @@
47magic_md5 = '$1$'47magic_md5 = '$1$'
48_logger = logging.getLogger(__name__)48_logger = logging.getLogger(__name__)
4949
50def gen_salt( length=8, symbols=ascii_letters + digits ):50def gen_salt( length=8, symbols=None):
51 if symbols is None:
52 symbols = ascii_letters + digits
51 seed()53 seed()
52 return ''.join( sample( symbols, length ) )54 return ''.join( sample( symbols, length ) )
5355
5456
=== modified file 'base_module_doc_rst/report/ir_module_reference_print_graph.py'
--- base_module_doc_rst/report/ir_module_reference_print_graph.py 2011-01-14 00:11:01 +0000
+++ base_module_doc_rst/report/ir_module_reference_print_graph.py 2012-10-02 11:29:53 +0000
@@ -79,4 +79,4 @@
79 'addons/base_module_doc_rst/report/ir_module_reference_graph.rml',79 'addons/base_module_doc_rst/report/ir_module_reference_graph.rml',
80 parser=ir_module_reference_print_graph, header=False)80 parser=ir_module_reference_print_graph, header=False)
8181
82# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
83\ No newline at end of file82\ No newline at end of file
83# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
8484
=== modified file 'base_module_record/wizard/base_module_record_objects.py'
--- base_module_record/wizard/base_module_record_objects.py 2012-03-07 06:01:32 +0000
+++ base_module_record/wizard/base_module_record_objects.py 2012-10-02 11:29:53 +0000
@@ -127,7 +127,7 @@
127 _name = 'base.module.record.objects'127 _name = 'base.module.record.objects'
128 _description = "Base Module Record Objects"128 _description = "Base Module Record Objects"
129 129
130 def inter_call(self,cr,uid,data,context=None):130 def inter_call(self, cr, uid, data, context=None):
131 res=base_module_save._create_module(self, cr, uid, data, context)131 res=base_module_save._create_module(self, cr, uid, data, context)
132 mod_obj = self.pool.get('ir.model.data')132 mod_obj = self.pool.get('ir.model.data')
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)
134134
=== modified file 'base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py'
--- base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py 2012-08-06 16:28:17 +0000
+++ base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py 2012-10-02 11:29:53 +0000
@@ -42,11 +42,11 @@
4242
43class DomApiGeneral:43class DomApiGeneral:
44 """General DOM API utilities."""44 """General DOM API utilities."""
45 def __init__(self,content_string="",file=""):45 def __init__(self, content_string="", file=""):
46 self.content_string = content_string46 self.content_string = content_string
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)")
4848
49 def _unitTuple(self,string):49 def _unitTuple(self, string):
50 """Split values and units to a tuple."""50 """Split values and units to a tuple."""
51 temp = self.re_digits.findall(string)51 temp = self.re_digits.findall(string)
52 if not temp:52 if not temp:
@@ -54,13 +54,15 @@
54 else:54 else:
55 return (temp[0])55 return (temp[0])
5656
57 def stringPercentToFloat(self,string):57 def stringPercentToFloat(self, string):
58 temp = string.replace("""%""","")58 temp = string.replace("""%""","")
59 return float(temp)/10059 return float(temp)/100
6060
61 def findChildrenByName(self,parent,name,attr_dict={}):61 def findChildrenByName(self, parent, name, attr_dict=None):
62 """Helper functions. Does not work recursively.62 """Helper functions. Does not work recursively.
63 Optional: also test for certain attribute/value pairs."""63 Optional: also test for certain attribute/value pairs."""
64 if attr_dict is None:
65 attr_dict = {}
64 children = []66 children = []
65 for c in parent.childNodes:67 for c in parent.childNodes:
66 if c.nodeType == c.ELEMENT_NODE and c.nodeName == name:68 if c.nodeType == c.ELEMENT_NODE and c.nodeName == name:
@@ -70,7 +72,7 @@
70 else:72 else:
71 return self._selectForAttributes(nodelist=children,attr_dict=attr_dict)73 return self._selectForAttributes(nodelist=children,attr_dict=attr_dict)
7274
73 def _selectForAttributes(self,nodelist,attr_dict):75 def _selectForAttributes(self, nodelist, attr_dict):
74 "Helper function."""76 "Helper function."""
75 selected_nodes = []77 selected_nodes = []
76 for n in nodelist:78 for n in nodelist:
@@ -83,7 +85,7 @@
83 selected_nodes.append(n)85 selected_nodes.append(n)
84 return selected_nodes86 return selected_nodes
8587
86 def _stringToTuple(self,s):88 def _stringToTuple(self, s):
87 """Helper function."""89 """Helper function."""
88 try:90 try:
89 temp = string.split(s,",")91 temp = string.split(s,",")
@@ -91,13 +93,13 @@
91 except:93 except:
92 return None94 return None
9395
94 def _tupleToString(self,t):96 def _tupleToString(self, t):
95 try:97 try:
96 return self.openOfficeStringUtf8("%s,%s" % (t[0],t[1]))98 return self.openOfficeStringUtf8("%s,%s" % (t[0],t[1]))
97 except:99 except:
98 return None100 return None
99101
100 def _lengthToFloat(self,value):102 def _lengthToFloat(self, value):
101 v = value103 v = value
102 if not self.re_digits.search(v):104 if not self.re_digits.search(v):
103 return v105 return v
@@ -113,7 +115,7 @@
113 except:115 except:
114 return v116 return v
115117
116 def openOfficeStringUtf8(self,string):118 def openOfficeStringUtf8(self, string):
117 if type(string) == unicode:119 if type(string) == unicode:
118 return string.encode("utf-8")120 return string.encode("utf-8")
119 tempstring = unicode(string,"cp1252").encode("utf-8")121 tempstring = unicode(string,"cp1252").encode("utf-8")
@@ -121,7 +123,7 @@
121123
122class DomApi(DomApiGeneral):124class DomApi(DomApiGeneral):
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."""
124 def __init__(self,xml_content,xml_styles):126 def __init__(self, xml_content, xml_styles):
125 DomApiGeneral.__init__(self)127 DomApiGeneral.__init__(self)
126 self.content_dom = xml.dom.minidom.parseString(xml_content)128 self.content_dom = xml.dom.minidom.parseString(xml_content)
127 self.styles_dom = xml.dom.minidom.parseString(xml_styles)129 self.styles_dom = xml.dom.minidom.parseString(xml_styles)
@@ -145,7 +147,7 @@
145 for s in self.style_dict.keys():147 for s in self.style_dict.keys():
146 self.style_properties_dict[s] = self.getStylePropertiesDict(s)148 self.style_properties_dict[s] = self.getStylePropertiesDict(s)
147149
148 def updateWithPercents(self,dict,updatedict):150 def updateWithPercents(self, dict, updatedict):
149 """Sometimes you find values like "115%" in the style hierarchy."""151 """Sometimes you find values like "115%" in the style hierarchy."""
150 if not updatedict:152 if not updatedict:
151 # no style hierarchies for this style? =>153 # no style hierarchies for this style? =>
@@ -244,7 +246,7 @@
244 def toxml(self):246 def toxml(self):
245 return self.content_dom.toxml(encoding="utf-8")247 return self.content_dom.toxml(encoding="utf-8")
246248
247 def getStylePropertiesDict(self,style_name):249 def getStylePropertiesDict(self, style_name):
248 res = {}250 res = {}
249251
250 if self.style_dict[style_name].hasAttribute("style:parent-style-name"):252 if self.style_dict[style_name].hasAttribute("style:parent-style-name"):
@@ -265,7 +267,7 @@
265 self.save_pict = save_pict267 self.save_pict = save_pict
266 self.images = {}268 self.images = {}
267269
268 def oo_read(self,fname):270 def oo_read(self, fname):
269 z = zipfile.ZipFile(fname,"r")271 z = zipfile.ZipFile(fname,"r")
270 content = z.read('content.xml')272 content = z.read('content.xml')
271 style = z.read('styles.xml')273 style = z.read('styles.xml')
@@ -281,7 +283,7 @@
281 z.close()283 z.close()
282 return content,style284 return content,style
283285
284 def oo_replace(self,content):286 def oo_replace(self, content):
285 regex = [287 regex = [
286 (r"<para[^>]*/>", ""),288 (r"<para[^>]*/>", ""),
287 (r"<para(.*)>(.*?)<text:line-break[^>]*/>", "<para$1>$2</para><para$1>"),289 (r"<para(.*)>(.*?)<text:line-break[^>]*/>", "<para$1>$2</para><para$1>"),
@@ -290,7 +292,7 @@
290 content = re.sub(key, val, content)292 content = re.sub(key, val, content)
291 return content293 return content
292294
293 def unpackNormalize(self,sourcefile):295 def unpackNormalize(self, sourcefile):
294 c,s = self.oo_read(sourcefile)296 c,s = self.oo_read(sourcefile)
295 c = self.oo_replace(c)297 c = self.oo_replace(c)
296 dom = DomApi(c,s)298 dom = DomApi(c,s)
297299
=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/About.py'
--- base_report_designer/plugin/openerp_report_designer/bin/script/About.py 2011-12-19 16:54:40 +0000
+++ base_report_designer/plugin/openerp_report_designer/bin/script/About.py 2012-10-02 11:29:53 +0000
@@ -52,7 +52,7 @@
52 from lib.gui import *52 from lib.gui import *
5353
54class About(unohelper.Base, XJobExecutor):54class About(unohelper.Base, XJobExecutor):
55 def __init__(self,ctx):55 def __init__(self, ctx):
56 self.ctx = ctx56 self.ctx = ctx
57 self.module = "openerp_report"57 self.module = "openerp_report"
58 self.version = "0.1"58 self.version = "0.1"
5959
=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/AddAttachment.py'
--- base_report_designer/plugin/openerp_report_designer/bin/script/AddAttachment.py 2012-08-06 16:28:17 +0000
+++ base_report_designer/plugin/openerp_report_designer/bin/script/AddAttachment.py 2012-10-02 11:29:53 +0000
@@ -64,7 +64,7 @@
64 'PDF' : 'pdf',64 'PDF' : 'pdf',
65 'OpenOffice': 'sxw',65 'OpenOffice': 'sxw',
66 }66 }
67 def __init__(self,ctx):67 def __init__(self, ctx):
68 self.ctx = ctx68 self.ctx = ctx
69 self.module = "openerp_report"69 self.module = "openerp_report"
70 self.version = "0.1"70 self.version = "0.1"
@@ -132,7 +132,7 @@
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 )
133 self.win.doModalDialog("lstResourceType", self.Kind.keys()[0])133 self.win.doModalDialog("lstResourceType", self.Kind.keys()[0])
134134
135 def btnSearch_clicked( self, oActionEvent ):135 def btnSearch_clicked(self, oActionEvent):
136 modelSelectedItem = self.win.getListBoxSelectedItem("lstmodel")136 modelSelectedItem = self.win.getListBoxSelectedItem("lstmodel")
137 if modelSelectedItem == "":137 if modelSelectedItem == "":
138 return138 return
@@ -151,7 +151,7 @@
151 for result in self.aSearchResult:151 for result in self.aSearchResult:
152 self.lstResource.addItem(result[1],result[0])152 self.lstResource.addItem(result[1],result[0])
153153
154 def _send_attachment( self, name, data, res_model, res_id ):154 def _send_attachment(self, name, data, res_model, res_id):
155 desktop = getDesktop()155 desktop = getDesktop()
156 oDoc2 = desktop.getCurrentComponent()156 oDoc2 = desktop.getCurrentComponent()
157 docinfo = oDoc2.getDocumentInfo()157 docinfo = oDoc2.getDocumentInfo()
@@ -166,7 +166,7 @@
166166
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 )
168168
169 def send_attachment( self, model, resource_id ):169 def send_attachment(self, model, resource_id):
170 desktop = getDesktop()170 desktop = getDesktop()
171 oDoc2 = desktop.getCurrentComponent()171 oDoc2 = desktop.getCurrentComponent()
172 docinfo = oDoc2.getDocumentInfo()172 docinfo = oDoc2.getDocumentInfo()
@@ -187,7 +187,7 @@
187 data = read_data_from_file( get_absolute_file_path( url ) )187 data = read_data_from_file( get_absolute_file_path( url ) )
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 )
189189
190 def btnOkWithoutInformation_clicked( self, oActionEvent ):190 def btnOkWithoutInformation_clicked(self, oActionEvent):
191 desktop = getDesktop()191 desktop = getDesktop()
192 oDoc2 = desktop.getCurrentComponent()192 oDoc2 = desktop.getCurrentComponent()
193 docinfo = oDoc2.getDocumentInfo()193 docinfo = oDoc2.getDocumentInfo()
@@ -199,7 +199,7 @@
199 res = self.send_attachment( docinfo.getUserFieldValue(3), docinfo.getUserFieldValue(2) )199 res = self.send_attachment( docinfo.getUserFieldValue(3), docinfo.getUserFieldValue(2) )
200 self.win.endExecute()200 self.win.endExecute()
201201
202 def btnOkWithInformation_clicked(self,oActionEvent):202 def btnOkWithInformation_clicked(self, oActionEvent):
203 if self.win.getListBoxSelectedItem("lstResourceType") == "":203 if self.win.getListBoxSelectedItem("lstResourceType") == "":
204 ErrorDialog( "You have to select a resource type.", "", "Selection Error." )204 ErrorDialog( "You have to select a resource type.", "", "Selection Error." )
205 return205 return
@@ -221,7 +221,7 @@
221 res = self.send_attachment( self.dModel[self.win.getListBoxSelectedItem('lstmodel')], resourceid )221 res = self.send_attachment( self.dModel[self.win.getListBoxSelectedItem('lstmodel')], resourceid )
222 self.win.endExecute()222 self.win.endExecute()
223223
224 def btnCancel_clicked( self, oActionEvent ):224 def btnCancel_clicked(self, oActionEvent):
225 self.win.endExecute()225 self.win.endExecute()
226226
227 def doc2pdf(self, strFile):227 def doc2pdf(self, strFile):
@@ -262,7 +262,7 @@
262 # Can be None if len(strFilterSubName) <= 0262 # Can be None if len(strFilterSubName) <= 0
263 return filename263 return filename
264264
265 def _MakePropertyValue(self, cName = "", uValue = u"" ):265 def _MakePropertyValue(self, cName="", uValue=u""):
266 oPropertyValue = createUnoStruct( "com.sun.star.beans.PropertyValue" )266 oPropertyValue = createUnoStruct( "com.sun.star.beans.PropertyValue" )
267 if cName:267 if cName:
268 oPropertyValue.Name = cName268 oPropertyValue.Name = cName
269269
=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/Change.py'
--- base_report_designer/plugin/openerp_report_designer/bin/script/Change.py 2012-07-25 11:55:11 +0000
+++ base_report_designer/plugin/openerp_report_designer/bin/script/Change.py 2012-10-02 11:29:53 +0000
@@ -59,7 +59,7 @@
59 database="test"59 database="test"
6060
61class Change( unohelper.Base, XJobExecutor ):61class Change( unohelper.Base, XJobExecutor ):
62 def __init__(self,ctx):62 def __init__(self, ctx):
63 self.ctx = ctx63 self.ctx = ctx
64 self.module = "openerp_report"64 self.module = "openerp_report"
65 self.version = "0.1"65 self.version = "0.1"
@@ -107,7 +107,7 @@
107 self.lstProtocol.addItem(i,self.lstProtocol.getItemCount() )107 self.lstProtocol.addItem(i,self.lstProtocol.getItemCount() )
108 self.win.doModalDialog( "lstProtocol", protocol)108 self.win.doModalDialog( "lstProtocol", protocol)
109109
110 def btnNext_clicked(self,oActionEvent):110 def btnNext_clicked(self, oActionEvent):
111 global url111 global url
112 aVal=''112 aVal=''
113 #aVal= Fetature used 113 #aVal= Fetature used
114114
=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/ConvertBracesToField.py'
--- base_report_designer/plugin/openerp_report_designer/bin/script/ConvertBracesToField.py 2011-12-19 16:54:40 +0000
+++ base_report_designer/plugin/openerp_report_designer/bin/script/ConvertBracesToField.py 2012-10-02 11:29:53 +0000
@@ -3,31 +3,31 @@
3# Portions of this file are under the following copyright and license:3# Portions of this file are under the following copyright and license:
4#4#
5#5#
6# Copyright (c) 2003-2004 Danny Brewer 6# Copyright (c) 2003-2004 Danny Brewer
7# d29583@groovegarden.com 7# d29583@groovegarden.com
8# 8#
9# This library is free software; you can redistribute it and/or 9# This library is free software; you can redistribute it and/or
10# modify it under the terms of the GNU Lesser General Public 10# modify it under the terms of the GNU Lesser General Public
11# License as published by the Free Software Foundation; either 11# License as published by the Free Software Foundation; either
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.
13# 13#
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,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of 15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17# Lesser General Public License for more details. 17# Lesser General Public License for more details.
18# 18#
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
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
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
22# 22#
23# See: http://www.gnu.org/licenses/lgpl.html 23# See: http://www.gnu.org/licenses/lgpl.html
24#24#
25# 25#
26# and other portions are under the following copyright and license:26# and other portions are under the following copyright and license:
27#27#
28#28#
29# OpenERP, Open Source Management Solution>..29# OpenERP, Open Source Management Solution>..
30# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). 30# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
31#31#
32# This program is free software: you can redistribute it and/or modify32# This program is free software: you can redistribute it and/or modify
33# it under the terms of the GNU Affero General Public License as published by33# it under the terms of the GNU Affero General Public License as published by
@@ -63,7 +63,7 @@
6363
64class ConvertBracesToField( unohelper.Base, XJobExecutor ):64class ConvertBracesToField( unohelper.Base, XJobExecutor ):
6565
66 def __init__(self,ctx):66 def __init__(self, ctx):
6767
68 self.ctx = ctx68 self.ctx = ctx
69 self.module = "openerp_report"69 self.module = "openerp_report"
@@ -198,7 +198,7 @@
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))
199 self.logobj.log_write('ConvertBraceToField', LOG_ERROR, info)199 self.logobj.log_write('ConvertBraceToField', LOG_ERROR, info)
200200
201 def getRes(self,sock,sObject,sVar):201 def getRes(self, sock, sObject, sVar):
202 desktop=getDesktop()202 desktop=getDesktop()
203 doc =desktop.getCurrentComponent()203 doc =desktop.getCurrentComponent()
204 docinfo=doc.getDocumentInfo()204 docinfo=doc.getDocumentInfo()
@@ -215,7 +215,9 @@
215 sObject = self.getRes(sock,res[myval]['relation'], sVar[sVar.find("/")+1:])215 sObject = self.getRes(sock,res[myval]['relation'], sVar[sVar.find("/")+1:])
216 return sObject216 return sObject
217217
218 def getBraces(self,aReportSyntex=[]):218 def getBraces(self, aReportSyntex=None):
219 if aReportSyntex is None:
220 aReportSyntex = []
219 desktop=getDesktop()221 desktop=getDesktop()
220 doc = desktop.getCurrentComponent()222 doc = desktop.getCurrentComponent()
221 aSearchString=[]223 aSearchString=[]
222224
=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py'
--- base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py 2011-12-19 16:54:40 +0000
+++ base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py 2012-10-02 11:29:53 +0000
@@ -57,7 +57,7 @@
57 uid = 357 uid = 3
5858
59class ConvertFieldsToBraces( unohelper.Base, XJobExecutor ):59class ConvertFieldsToBraces( unohelper.Base, XJobExecutor ):
60 def __init__(self,ctx):60 def __init__(self, ctx):
61 self.ctx = ctx61 self.ctx = ctx
62 self.module = "openerp_report"62 self.module = "openerp_report"
63 self.version = "0.1"63 self.version = "0.1"
6464
=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/ExportToRML.py'
--- base_report_designer/plugin/openerp_report_designer/bin/script/ExportToRML.py 2012-08-06 16:28:17 +0000
+++ base_report_designer/plugin/openerp_report_designer/bin/script/ExportToRML.py 2012-10-02 11:29:53 +0000
@@ -67,7 +67,7 @@
6767
6868
69class ExportToRML( unohelper.Base, XJobExecutor ):69class ExportToRML( unohelper.Base, XJobExecutor ):
70 def __init__(self,ctx):70 def __init__(self, ctx):
71 self.ctx = ctx71 self.ctx = ctx
72 self.module = "openerp_report"72 self.module = "openerp_report"
73 self.version = "0.1"73 self.version = "0.1"
7474
=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/Expression.py'
--- base_report_designer/plugin/openerp_report_designer/bin/script/Expression.py 2012-07-25 11:55:11 +0000
+++ base_report_designer/plugin/openerp_report_designer/bin/script/Expression.py 2012-10-02 11:29:53 +0000
@@ -57,7 +57,7 @@
57 uid = 357 uid = 3
5858
59class Expression(unohelper.Base, XJobExecutor ):59class Expression(unohelper.Base, XJobExecutor ):
60 def __init__(self,sExpression="",sName="", bFromModify=False):60 def __init__(self, sExpression="", sName="", bFromModify=False):
61 LoginTest()61 LoginTest()
62 if not loginstatus and __name__=="package":62 if not loginstatus and __name__=="package":
63 exit(1)63 exit(1)
@@ -75,7 +75,7 @@
75 self.win.doModalDialog("",None)75 self.win.doModalDialog("",None)
7676
7777
78 def btnOk_clicked( self, oActionEvent ):78 def btnOk_clicked(self, oActionEvent):
79 desktop=getDesktop()79 desktop=getDesktop()
80 doc = desktop.getCurrentComponent()80 doc = desktop.getCurrentComponent()
81 text = doc.Text81 text = doc.Text
@@ -105,7 +105,7 @@
105 else:105 else:
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.")
107107
108 def btnCancel_clicked( self, oActionEvent ):108 def btnCancel_clicked(self, oActionEvent):
109 self.win.endExecute()109 self.win.endExecute()
110110
111if __name__<>"package" and __name__=="__main__":111if __name__<>"package" and __name__=="__main__":
112112
=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/Fields.py'
--- base_report_designer/plugin/openerp_report_designer/bin/script/Fields.py 2012-07-25 12:53:32 +0000
+++ base_report_designer/plugin/openerp_report_designer/bin/script/Fields.py 2012-10-02 11:29:53 +0000
@@ -64,7 +64,7 @@
6464
6565
66class Fields(unohelper.Base, XJobExecutor ):66class Fields(unohelper.Base, XJobExecutor ):
67 def __init__(self,sVariable="",sFields="",sDisplayName="",bFromModify=False):67 def __init__(self, sVariable="", sFields="", sDisplayName="", bFromModify=False):
68 LoginTest()68 LoginTest()
69 if not loginstatus and __name__=="package":69 if not loginstatus and __name__=="package":
70 exit(1)70 exit(1)
@@ -177,7 +177,7 @@
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")
178 self.win.endExecute()178 self.win.endExecute()
179179
180 def lstbox_selected(self,oItemEvent):180 def lstbox_selected(self, oItemEvent):
181 try:181 try:
182182
183 desktop=getDesktop()183 desktop=getDesktop()
@@ -200,7 +200,7 @@
200 if self.bModify:200 if self.bModify:
201 self.win.setEditText("txtUName",self.sGDisplayName)201 self.win.setEditText("txtUName",self.sGDisplayName)
202202
203 def getRes(self,sock ,sObject,sVar):203 def getRes(self, sock, sObject, sVar):
204 desktop=getDesktop()204 desktop=getDesktop()
205 doc =desktop.getCurrentComponent()205 doc =desktop.getCurrentComponent()
206 docinfo=doc.getDocumentInfo()206 docinfo=doc.getDocumentInfo()
@@ -219,7 +219,7 @@
219 else:219 else:
220 return sObject220 return sObject
221221
222 def cmbVariable_selected(self,oItemEvent):222 def cmbVariable_selected(self, oItemEvent):
223 if self.count > 0 :223 if self.count > 0 :
224 try:224 try:
225 desktop=getDesktop()225 desktop=getDesktop()
@@ -246,7 +246,7 @@
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))
247 self.logobj.log_write('Fields', LOG_ERROR, info)247 self.logobj.log_write('Fields', LOG_ERROR, info)
248248
249 def btnOk_clicked( self, oActionEvent ):249 def btnOk_clicked(self, oActionEvent):
250 desktop=getDesktop()250 desktop=getDesktop()
251 doc = desktop.getCurrentComponent()251 doc = desktop.getCurrentComponent()
252 cursor = doc.getCurrentController().getViewCursor()252 cursor = doc.getCurrentController().getViewCursor()
@@ -281,7 +281,7 @@
281 else:281 else:
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.")
283283
284 def btnCancel_clicked( self, oActionEvent ):284 def btnCancel_clicked(self, oActionEvent):
285 self.win.endExecute()285 self.win.endExecute()
286286
287if __name__<>"package" and __name__=="__main__":287if __name__<>"package" and __name__=="__main__":
288288
=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py'
--- base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py 2012-08-07 11:06:16 +0000
+++ base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py 2012-10-02 11:29:53 +0000
@@ -65,7 +65,7 @@
65 uid = 365 uid = 3
6666
67class ModifyExistingReport(unohelper.Base, XJobExecutor):67class ModifyExistingReport(unohelper.Base, XJobExecutor):
68 def __init__(self,ctx):68 def __init__(self, ctx):
69 self.ctx = ctx69 self.ctx = ctx
70 self.module = "openerp_report"70 self.module = "openerp_report"
71 self.version = "0.1"71 self.version = "0.1"
@@ -177,10 +177,10 @@
177177
178 self.win.endExecute()178 self.win.endExecute()
179179
180 def btnCancel_clicked( self, oActionEvent ):180 def btnCancel_clicked(self, oActionEvent):
181 self.win.endExecute()181 self.win.endExecute()
182182
183 def btnDelete_clicked( self, oActionEvent ):183 def btnDelete_clicked(self, oActionEvent):
184 desktop=getDesktop()184 desktop=getDesktop()
185 doc = desktop.getCurrentComponent()185 doc = desktop.getCurrentComponent()
186 docinfo=doc.getDocumentInfo()186 docinfo=doc.getDocumentInfo()
187187
=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py'
--- base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py 2011-12-19 16:54:40 +0000
+++ base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py 2012-10-02 11:29:53 +0000
@@ -66,7 +66,7 @@
66#66#
67#67#
68class NewReport(unohelper.Base, XJobExecutor):68class NewReport(unohelper.Base, XJobExecutor):
69 def __init__(self,ctx):69 def __init__(self, ctx):
70 self.ctx = ctx70 self.ctx = ctx
71 self.module = "openerp_report"71 self.module = "openerp_report"
72 self.version = "0.1"72 self.version = "0.1"
@@ -99,7 +99,7 @@
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 )
100 self.win.doModalDialog("",None)100 self.win.doModalDialog("",None)
101101
102 def btnOk_clicked(self,oActionEvent):102 def btnOk_clicked(self, oActionEvent):
103 desktop=getDesktop()103 desktop=getDesktop()
104 doc = desktop.getCurrentComponent()104 doc = desktop.getCurrentComponent()
105 docinfo=doc.getDocumentInfo()105 docinfo=doc.getDocumentInfo()
@@ -107,7 +107,7 @@
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))
108 self.win.endExecute()108 self.win.endExecute()
109109
110 def btnCancel_clicked( self, oActionEvent ):110 def btnCancel_clicked(self, oActionEvent):
111 self.win.endExecute()111 self.win.endExecute()
112112
113if __name__<>"package" and __name__=="__main__":113if __name__<>"package" and __name__=="__main__":
114114
=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/Repeatln.py'
--- base_report_designer/plugin/openerp_report_designer/bin/script/Repeatln.py 2012-07-25 11:55:11 +0000
+++ base_report_designer/plugin/openerp_report_designer/bin/script/Repeatln.py 2012-10-02 11:29:53 +0000
@@ -64,7 +64,7 @@
6464
65#class RepeatIn:65#class RepeatIn:
66class RepeatIn( unohelper.Base, XJobExecutor ):66class RepeatIn( unohelper.Base, XJobExecutor ):
67 def __init__(self,sObject="",sVariable="",sFields="",sDisplayName="",bFromModify=False):67 def __init__(self, sObject="", sVariable="", sFields="", sDisplayName="", bFromModify=False):
68 # Interface Design68 # Interface Design
69 LoginTest()69 LoginTest()
70 self.logobj=Logger()70 self.logobj=Logger()
@@ -204,7 +204,7 @@
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")
205 self.win.endExecute()205 self.win.endExecute()
206206
207 def lstbox_selected(self,oItemEvent):207 def lstbox_selected(self, oItemEvent):
208 sItem=self.win.getListBoxSelectedItem("lstFields")208 sItem=self.win.getListBoxSelectedItem("lstFields")
209 sMain=self.aListRepeatIn[self.win.getListBoxSelectedItemPos("lstFields")]209 sMain=self.aListRepeatIn[self.win.getListBoxSelectedItemPos("lstFields")]
210210
@@ -215,7 +215,7 @@
215 self.win.setEditText("txtName",sMain[sMain.rfind("/")+1:])215 self.win.setEditText("txtName",sMain[sMain.rfind("/")+1:])
216 self.win.setEditText("txtUName","|-."+sItem[sItem.rfind("/")+1:]+".-|")216 self.win.setEditText("txtUName","|-."+sItem[sItem.rfind("/")+1:]+".-|")
217217
218 def cmbVariable_selected(self,oItemEvent):218 def cmbVariable_selected(self, oItemEvent):
219219
220 if self.count > 0 :220 if self.count > 0 :
221221
@@ -290,7 +290,7 @@
290 else:290 else:
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.")
292292
293 def btnCancel_clicked( self, oActionEvent ):293 def btnCancel_clicked(self, oActionEvent):
294 self.win.endExecute()294 self.win.endExecute()
295295
296if __name__<>"package" and __name__=="__main__":296if __name__<>"package" and __name__=="__main__":
297297
=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/SendToServer.py'
--- base_report_designer/plugin/openerp_report_designer/bin/script/SendToServer.py 2012-08-07 11:06:16 +0000
+++ base_report_designer/plugin/openerp_report_designer/bin/script/SendToServer.py 2012-10-02 11:29:53 +0000
@@ -72,7 +72,7 @@
72 'HTML' : 'html'72 'HTML' : 'html'
73 }73 }
7474
75 def __init__(self,ctx):75 def __init__(self, ctx):
76 self.ctx = ctx76 self.ctx = ctx
77 self.module = "openerp_report"77 self.module = "openerp_report"
78 self.version = "0.1"78 self.version = "0.1"
@@ -136,10 +136,10 @@
136136
137 self.win.doModalDialog("lstResourceType", self.Kind.keys()[0])137 self.win.doModalDialog("lstResourceType", self.Kind.keys()[0])
138138
139 def lstbox_selected(self,oItemEvent):139 def lstbox_selected(self, oItemEvent):
140 pass140 pass
141141
142 def btnCancel_clicked( self, oActionEvent ):142 def btnCancel_clicked(self, oActionEvent):
143 self.win.endExecute()143 self.win.endExecute()
144144
145 def btnOk_clicked(self, oActionEvent):145 def btnOk_clicked(self, oActionEvent):
@@ -221,7 +221,7 @@
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)
222 return id222 return id
223223
224 def getInverseFieldsRecord(self,nVal):224 def getInverseFieldsRecord(self, nVal):
225 desktop=getDesktop()225 desktop=getDesktop()
226 doc = desktop.getCurrentComponent()226 doc = desktop.getCurrentComponent()
227 count=0227 count=0
228228
=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py'
--- base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py 2012-08-07 11:06:16 +0000
+++ base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py 2012-10-02 11:29:53 +0000
@@ -59,7 +59,7 @@
59 database="test"59 database="test"
6060
61class ServerParameter( unohelper.Base, XJobExecutor ):61class ServerParameter( unohelper.Base, XJobExecutor ):
62 def __init__(self, aVal= None, sURL=""):62 def __init__(self, aVal=None, sURL=""):
63 self.module = "openerp_report"63 self.module = "openerp_report"
64 self.version = "0.1"64 self.version = "0.1"
65 desktop=getDesktop()65 desktop=getDesktop()
@@ -116,8 +116,7 @@
116116
117 #self.win.doModalDialog("lstDatabase",docinfo.getUserFieldValue(2))117 #self.win.doModalDialog("lstDatabase",docinfo.getUserFieldValue(2))
118118
119 def btnOk_clicked(self,oActionEvent):119 def btnOk_clicked(self, oActionEvent):
120
121 sLogin=self.win.getEditText("txtLoginName")120 sLogin=self.win.getEditText("txtLoginName")
122 sPassword=self.win.getEditText("txtPassword")121 sPassword=self.win.getEditText("txtPassword")
123 global url122 global url
@@ -157,11 +156,10 @@
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))
158 self.win.endExecute()157 self.win.endExecute()
159158
160159 def btnCancel_clicked(self, oActionEvent):
161 def btnCancel_clicked( self, oActionEvent ):
162 self.win.endExecute()160 self.win.endExecute()
163161
164 def btnPrevious_clicked(self,oActionEvent):162 def btnPrevious_clicked(self, oActionEvent):
165 self.win.endExecute()163 self.win.endExecute()
166 Change(None)164 Change(None)
167 self.win.endExecute()165 self.win.endExecute()
@@ -172,5 +170,4 @@
172elif __name__=="package":170elif __name__=="package":
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",),)
174172
175
176# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:173# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
177174
=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/Translation.py'
--- base_report_designer/plugin/openerp_report_designer/bin/script/Translation.py 2012-08-06 16:28:17 +0000
+++ base_report_designer/plugin/openerp_report_designer/bin/script/Translation.py 2012-10-02 11:29:53 +0000
@@ -61,7 +61,7 @@
6161
6262
63class AddLang(unohelper.Base, XJobExecutor ):63class AddLang(unohelper.Base, XJobExecutor ):
64 def __init__(self,sVariable="",sFields="",sDisplayName="",bFromModify=False):64 def __init__(self, sVariable="", sFields="", sDisplayName="", bFromModify=False):
65 LoginTest()65 LoginTest()
66 if not loginstatus and __name__=="package":66 if not loginstatus and __name__=="package":
67 exit(1)67 exit(1)
@@ -157,7 +157,7 @@
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")
158 self.win.endExecute()158 self.win.endExecute()
159159
160 def lstbox_selected(self,oItemEvent):160 def lstbox_selected(self, oItemEvent):
161 try:161 try:
162162
163 desktop=getDesktop()163 desktop=getDesktop()
@@ -183,7 +183,7 @@
183 if self.bModify:183 if self.bModify:
184 self.win.setEditText("txtUName",self.sGDisplayName)184 self.win.setEditText("txtUName",self.sGDisplayName)
185185
186 def getRes(self,sock ,sObject,sVar):186 def getRes(self, sock, sObject, sVar):
187 desktop=getDesktop()187 desktop=getDesktop()
188 doc =desktop.getCurrentComponent()188 doc =desktop.getCurrentComponent()
189 docinfo=doc.getDocumentInfo()189 docinfo=doc.getDocumentInfo()
@@ -203,7 +203,7 @@
203 return sObject203 return sObject
204204
205205
206 def cmbVariable_selected(self,oItemEvent):206 def cmbVariable_selected(self, oItemEvent):
207 if self.count > 0 :207 if self.count > 0 :
208 try:208 try:
209 desktop=getDesktop()209 desktop=getDesktop()
@@ -229,7 +229,7 @@
229 except:229 except:
230 import traceback;traceback.print_exc()230 import traceback;traceback.print_exc()
231231
232 def btnOk_clicked( self, oActionEvent ):232 def btnOk_clicked(self, oActionEvent):
233 self.bOkay = True233 self.bOkay = True
234 desktop=getDesktop()234 desktop=getDesktop()
235 doc = desktop.getCurrentComponent()235 doc = desktop.getCurrentComponent()
@@ -263,7 +263,7 @@
263 else:263 else:
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.")
265265
266 def btnCancel_clicked( self, oActionEvent ):266 def btnCancel_clicked(self, oActionEvent):
267 self.win.endExecute()267 self.win.endExecute()
268268
269269
270270
=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/lib/error.py'
--- base_report_designer/plugin/openerp_report_designer/bin/script/lib/error.py 2011-12-19 16:54:40 +0000
+++ base_report_designer/plugin/openerp_report_designer/bin/script/lib/error.py 2012-10-02 11:29:53 +0000
@@ -48,7 +48,7 @@
48if __name__<>"package":48if __name__<>"package":
49 from gui import *49 from gui import *
50class ErrorDialog:50class ErrorDialog:
51 def __init__(self,sErrorMsg, sErrorHelpMsg="",sTitle="Error Message"):51 def __init__(self, sErrorMsg, sErrorHelpMsg="", sTitle="Error Message"):
52 self.win = DBModalDialog(50, 50, 150, 90, sTitle)52 self.win = DBModalDialog(50, 50, 150, 90, sTitle)
53 self.win.addFixedText("lblErrMsg", 5, 5, 190, 25, sErrorMsg)53 self.win.addFixedText("lblErrMsg", 5, 5, 190, 25, sErrorMsg)
54 self.win.addFixedText("lblErrHelpMsg", 5, 30, 190, 25, sErrorHelpMsg)54 self.win.addFixedText("lblErrHelpMsg", 5, 30, 190, 25, sErrorHelpMsg)
5555
=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/lib/functions.py'
--- base_report_designer/plugin/openerp_report_designer/bin/script/lib/functions.py 2011-12-19 16:54:40 +0000
+++ base_report_designer/plugin/openerp_report_designer/bin/script/lib/functions.py 2012-10-02 11:29:53 +0000
@@ -59,7 +59,13 @@
59 database="test"59 database="test"
60 uid = 160 uid = 1
6161
62def genTree(object,aList,insField,host,level=3, ending=[], ending_excl=[], recur=[], root='', actualroot=""):62def genTree(object, aList, insField, host, level=3, ending=None, ending_excl=None, recur=None, root='', actualroot=""):
63 if ending is None:
64 ending = []
65 if ending_excl is None:
66 ending_excl = []
67 if recur is None:
68 recur = []
63 try:69 try:
64 global url70 global url
65 sock=RPCSession(url)71 sock=RPCSession(url)
@@ -79,7 +85,7 @@
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))
80 obj.log_write('Function', LOG_ERROR, info)86 obj.log_write('Function', LOG_ERROR, info)
8187
82def VariableScope(oTcur,insVariable,aObjectList,aComponentAdd,aItemList,sTableName=""):88def VariableScope(oTcur, insVariable, aObjectList, aComponentAdd, aItemList, sTableName=""):
83 if sTableName.find(".") != -1:89 if sTableName.find(".") != -1:
84 for i in range(len(aItemList)):90 for i in range(len(aItemList)):
85 if aComponentAdd[i]==sTableName:91 if aComponentAdd[i]==sTableName:
@@ -96,7 +102,7 @@
96 if aObjectList[j][:aObjectList[j].find("(")] == sLVal and sLVal!="":102 if aObjectList[j][:aObjectList[j].find("(")] == sLVal and sLVal!="":
97 insVariable.append(aObjectList[j])103 insVariable.append(aObjectList[j])
98104
99def getList(aObjectList,host,count):105def getList(aObjectList, host, count):
100 desktop=getDesktop()106 desktop=getDesktop()
101 doc =desktop.getCurrentComponent()107 doc =desktop.getCurrentComponent()
102 docinfo=doc.getDocumentInfo()108 docinfo=doc.getDocumentInfo()
@@ -128,7 +134,7 @@
128 else:134 else:
129 aObjectList.append("List of " + docinfo.getUserFieldValue(3))135 aObjectList.append("List of " + docinfo.getUserFieldValue(3))
130136
131def getRelation(sRelName, sItem, sObjName, aObjectList, host ):137def getRelation(sRelName, sItem, sObjName, aObjectList, host):
132 global url138 global url
133 sock=RPCSession(url)139 sock=RPCSession(url)
134 global passwd140 global passwd
@@ -143,7 +149,7 @@
143 getRelation(res[k]['relation'], sItem[sItem.find(".")+1:], sObjName,aObjectList,host)149 getRelation(res[k]['relation'], sItem[sItem.find(".")+1:], sObjName,aObjectList,host)
144150
145151
146def getPath(sPath,sMain):152def getPath(sPath, sMain):
147 desktop=getDesktop()153 desktop=getDesktop()
148 doc =desktop.getCurrentComponent()154 doc =desktop.getCurrentComponent()
149 oParEnum = doc.getTextFields().createEnumeration()155 oParEnum = doc.getTextFields().createEnumeration()
@@ -161,7 +167,7 @@
161 getPath(sPath, sMain)167 getPath(sPath, sMain)
162 return sPath168 return sPath
163169
164def EnumDocument(aItemList,aComponentAdd):170def EnumDocument(aItemList, aComponentAdd):
165 desktop = getDesktop()171 desktop = getDesktop()
166 parent=""172 parent=""
167 bFlag = False173 bFlag = False
@@ -183,7 +189,7 @@
183 aItemList.append( templist )189 aItemList.append( templist )
184 aComponentAdd.append( parent )190 aComponentAdd.append( parent )
185191
186def getChildTable(oPar,aItemList,aComponentAdd,sTableName=""):192def getChildTable(oPar, aItemList, aComponentAdd, sTableName=""):
187 sNames = oPar.getCellNames()193 sNames = oPar.getCellNames()
188 bEmptyTableFlag=True194 bEmptyTableFlag=True
189 for val in sNames:195 for val in sNames:
@@ -229,7 +235,7 @@
229 aComponentAdd.append(sTableName+"."+oPar.Name)235 aComponentAdd.append(sTableName+"."+oPar.Name)
230 return 0236 return 0
231237
232def getRecersiveSection(oCurrentSection,aSectionList):238def getRecersiveSection(oCurrentSection, aSectionList):
233 desktop=getDesktop()239 desktop=getDesktop()
234 doc =desktop.getCurrentComponent()240 doc =desktop.getCurrentComponent()
235 oParEnum=doc.getText().createEnumeration()241 oParEnum=doc.getText().createEnumeration()
236242
=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/lib/logreport.py'
--- base_report_designer/plugin/openerp_report_designer/bin/script/lib/logreport.py 2012-06-22 06:48:54 +0000
+++ base_report_designer/plugin/openerp_report_designer/bin/script/lib/logreport.py 2012-10-02 11:29:53 +0000
@@ -39,11 +39,10 @@
39 _logger.setLevel(logging.INFO)39 _logger.setLevel(logging.INFO)
4040
41class Logger(object):41class Logger(object):
42 def log_write(self,name,level,msg):42 def log_write(self, name, level, msg):
43 getattr(_logger,level)(msg)43 getattr(_logger,level)(msg)
4444
45 def shutdown(self):45 def shutdown(self):
46 logging.shutdown()46 logging.shutdown()
4747
48
49# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:48# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
5049
=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/lib/rpc.py'
--- base_report_designer/plugin/openerp_report_designer/bin/script/lib/rpc.py 2011-12-19 16:54:40 +0000
+++ base_report_designer/plugin/openerp_report_designer/bin/script/lib/rpc.py 2012-10-02 11:29:53 +0000
@@ -52,7 +52,7 @@
5252
5353
54class RPCSession(object):54class RPCSession(object):
55 def __init__(self,url):55 def __init__(self, url):
5656
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 '')
5858
@@ -152,7 +152,7 @@
152152
153 return res153 return res
154154
155 def execute(self, sDatabase,UID,sPassword,obj, method, *args):155 def execute(self, sDatabase, UID, sPassword, obj, method, *args):
156 global rpc_url156 global rpc_url
157157
158 sock = xmlrpclib.ServerProxy(rpc_url + 'object')158 sock = xmlrpclib.ServerProxy(rpc_url + 'object')
159159
=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/lib/tools.py'
--- base_report_designer/plugin/openerp_report_designer/bin/script/lib/tools.py 2011-12-19 16:54:40 +0000
+++ base_report_designer/plugin/openerp_report_designer/bin/script/lib/tools.py 2012-10-02 11:29:53 +0000
@@ -21,19 +21,19 @@
21##############################################################################21##############################################################################
22import urllib22import urllib
2323
24def get_absolute_file_path( url ):24def get_absolute_file_path(url):
25 url_unquoted = urllib.unquote(url)25 url_unquoted = urllib.unquote(url)
26 return os.name == 'nt' and url_unquoted[1:] or url_unquoted 26 return os.name == 'nt' and url_unquoted[1:] or url_unquoted
2727
28# This function reads the content of a file and return it to the caller28# This function reads the content of a file and return it to the caller
29def read_data_from_file( filename ):29def read_data_from_file(filename):
30 fp = file( filename, "rb" )30 fp = file( filename, "rb" )
31 data = fp.read()31 data = fp.read()
32 fp.close()32 fp.close()
33 return data33 return data
3434
35# This function writes the content to a file35# This function writes the content to a file
36def write_data_to_file( filename, data ):36def write_data_to_file(filename, data):
37 fp = file( filename, 'wb' )37 fp = file( filename, 'wb' )
38 fp.write( data )38 fp.write( data )
39 fp.close()39 fp.close()
4040
=== modified file 'base_report_designer/plugin/openerp_report_designer/bin/script/modify.py'
--- base_report_designer/plugin/openerp_report_designer/bin/script/modify.py 2012-08-06 16:28:17 +0000
+++ base_report_designer/plugin/openerp_report_designer/bin/script/modify.py 2012-10-02 11:29:53 +0000
@@ -61,7 +61,7 @@
61 uid = 361 uid = 3
6262
63class modify(unohelper.Base, XJobExecutor ):63class modify(unohelper.Base, XJobExecutor ):
64 def __init__( self, ctx ):64 def __init__(self, ctx):
65 self.ctx = ctx65 self.ctx = ctx
66 self.module = "openerp_report"66 self.module = "openerp_report"
67 self.version = "0.1"67 self.version = "0.1"
6868
=== modified file 'base_report_designer/plugin/openerp_report_designer/test/test_fields.py'
--- base_report_designer/plugin/openerp_report_designer/test/test_fields.py 2011-12-19 16:54:40 +0000
+++ base_report_designer/plugin/openerp_report_designer/test/test_fields.py 2012-10-02 11:29:53 +0000
@@ -10,7 +10,13 @@
1010
11sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object')11sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object')
1212
13def get(object, level=3, ending=[], ending_excl=[], recur=[], root=''):13def get(object, level=3, ending=None, ending_excl=None, recur=None, root=''):
14 if ending is None:
15 ending = []
16 if ending_excl is None:
17 ending_excl = []
18 if recur is None:
19 recur = []
14 res = sock.execute('terp', 3, 'admin', 'account.invoice', 'fields_get')20 res = sock.execute('terp', 3, 'admin', 'account.invoice', 'fields_get')
15 key = res.keys()21 key = res.keys()
16 key.sort()22 key.sort()
1723
=== modified file 'base_vat/__init__.py'
--- base_vat/__init__.py 2011-12-19 16:54:40 +0000
+++ base_vat/__init__.py 2012-10-02 11:29:53 +0000
@@ -22,4 +22,4 @@
22import res_company22import res_company
23import base_vat23import base_vat
2424
25# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
26\ No newline at end of file25\ No newline at end of file
26# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2727
=== modified file 'base_vat/res_company.py'
--- base_vat/res_company.py 2011-11-28 16:40:14 +0000
+++ base_vat/res_company.py 2012-10-02 11:29:53 +0000
@@ -29,4 +29,4 @@
29 "rather than via a simple format validation (checksum)."),29 "rather than via a simple format validation (checksum)."),
30 }30 }
3131
32
33\ No newline at end of file32\ No newline at end of file
33
3434
=== modified file 'caldav/caldav_node.py'
--- caldav/caldav_node.py 2012-07-25 12:05:41 +0000
+++ caldav/caldav_node.py 2012-10-02 11:29:53 +0000
@@ -43,7 +43,7 @@
43 DAV_M_NS = dict_merge2(nodes.node_dir.DAV_M_NS,43 DAV_M_NS = dict_merge2(nodes.node_dir.DAV_M_NS,
44 { "http://calendarserver.org/ns/" : '_get_dav', } )44 { "http://calendarserver.org/ns/" : '_get_dav', } )
4545
46 def _file_get(self,cr, nodename=False):46 def _file_get(self, cr, nodename=False):
47 return []47 return []
4848
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):
@@ -100,7 +100,7 @@
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,
101 { "http://calendarserver.org/ns/" : '_get_dav', } )101 { "http://calendarserver.org/ns/" : '_get_dav', } )
102102
103 def _file_get(self,cr, nodename=False):103 def _file_get(self, cr, nodename=False):
104 return []104 return []
105105
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):
@@ -181,7 +181,7 @@
181181
182 http_options = { 'DAV': ['calendar-access'] }182 http_options = { 'DAV': ['calendar-access'] }
183183
184 def __init__(self,path, parent, context, calendar):184 def __init__(self, path, parent, context, calendar):
185 super(node_calendar,self).__init__(path, parent,context)185 super(node_calendar,self).__init__(path, parent,context)
186 self.calendar_id = calendar.id186 self.calendar_id = calendar.id
187 self.mimetype = 'application/x-directory'187 self.mimetype = 'application/x-directory'
@@ -271,7 +271,7 @@
271 def children(self, cr, domain=None):271 def children(self, cr, domain=None):
272 return self._child_get(cr, domain=domain)272 return self._child_get(cr, domain=domain)
273273
274 def child(self,cr, name, domain=None):274 def child(self, cr, name, domain=None):
275 res = self._child_get(cr, name, domain=domain)275 res = self._child_get(cr, name, domain=domain)
276 if res:276 if res:
277 return res[0]277 return res[0]
@@ -353,16 +353,16 @@
353 return None353 return None
354354
355355
356 def set_data(self, cr, data, fil_obj = None):356 def set_data(self, cr, data, fil_obj=None):
357 uid = self.context.uid357 uid = self.context.uid
358 calendar_obj = self.context._dirobj.pool.get('basic.calendar')358 calendar_obj = self.context._dirobj.pool.get('basic.calendar')
359 res = calendar_obj.import_cal(cr, uid, data, self.calendar_id)359 res = calendar_obj.import_cal(cr, uid, data, self.calendar_id)
360 return res360 return res
361361
362 def get_data_len(self, cr, fil_obj = None):362 def get_data_len(self, cr, fil_obj=None):
363 return self.content_length363 return self.content_length
364364
365 def _get_ttag(self,cr):365 def _get_ttag(self, cr):
366 return 'calendar-%d' % (self.calendar_id,)366 return 'calendar-%d' % (self.calendar_id,)
367367
368 def rmcol(self, cr):368 def rmcol(self, cr):
@@ -441,7 +441,7 @@
441441
442 http_options = { 'DAV': ['calendar-access'] }442 http_options = { 'DAV': ['calendar-access'] }
443443
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):
445 super(res_node_calendar,self).__init__(path, parent, context)445 super(res_node_calendar,self).__init__(path, parent, context)
446 self.mimetype = 'text/calendar'446 self.mimetype = 'text/calendar'
447 self.create_date = parent.create_date447 self.create_date = parent.create_date
@@ -474,10 +474,10 @@
474 def _get_caldav_calendar_data(self, cr):474 def _get_caldav_calendar_data(self, cr):
475 return self.get_data(cr)475 return self.get_data(cr)
476476
477 def get_data_len(self, cr, fil_obj = None):477 def get_data_len(self, cr, fil_obj=None):
478 return self.content_length478 return self.content_length
479479
480 def set_data(self, cr, data, fil_obj = None):480 def set_data(self, cr, data, fil_obj=None):
481 uid = self.context.uid481 uid = self.context.uid
482 context = self.context.context.copy()482 context = self.context.context.copy()
483 context.update(self.dctx)483 context.update(self.dctx)
@@ -486,7 +486,7 @@
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)
487 return res487 return res
488488
489 def _get_ttag(self,cr):489 def _get_ttag(self, cr):
490 res = False490 res = False
491 if self.model and self.res_id:491 if self.model and self.res_id:
492 res = '%s_%d' % (self.model, self.res_id)492 res = '%s_%d' % (self.model, self.res_id)
493493
=== modified file 'crm/crm.py'
--- crm/crm.py 2012-09-24 12:51:39 +0000
+++ crm/crm.py 2012-10-02 11:29:53 +0000
@@ -58,7 +58,7 @@
5858
59class crm_case_stage(osv.osv):59class crm_case_stage(osv.osv):
60 """ Model for case stages. This models the main stages of a document60 """ Model for case stages. This models the main stages of a document
61 management flow. Main CRM objects (leads, opportunities, project 61 management flow. Main CRM objects (leads, opportunities, project
62 issues, ...) will now use only stages, instead of state and stages.62 issues, ...) will now use only stages, instead of state and stages.
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.
64 """64 """
@@ -126,11 +126,11 @@
126 'note': fields.text('Description'),126 'note': fields.text('Description'),
127 'working_hours': fields.float('Working Hours', digits=(16,2 )),127 'working_hours': fields.float('Working Hours', digits=(16,2 )),
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'),
129 'alias_id': fields.many2one('mail.alias', 'Alias', ondelete="cascade", required=True, 129 'alias_id': fields.many2one('mail.alias', 'Alias', ondelete="cascade", required=True,
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 "
131 "create new leads assigned to the team."),131 "create new leads assigned to the team."),
132 }132 }
133 133
134 def _get_stage_common(self, cr, uid, context):134 def _get_stage_common(self, cr, uid, context):
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)
136 return ids136 return ids
@@ -165,12 +165,12 @@
165 name = record['parent_id'][1] + ' / ' + name165 name = record['parent_id'][1] + ' / ' + name
166 res.append((record['id'], name))166 res.append((record['id'], name))
167 return res167 return res
168 168
169 def create(self, cr, uid, vals, context=None):169 def create(self, cr, uid, vals, context=None):
170 mail_alias = self.pool.get('mail.alias')170 mail_alias = self.pool.get('mail.alias')
171 if not vals.get('alias_id'):171 if not vals.get('alias_id'):
172 vals.pop('alias_name', None) # prevent errors during copy()172 vals.pop('alias_name', None) # prevent errors during copy()
173 alias_id = mail_alias.create_unique_alias(cr, uid, 173 alias_id = mail_alias.create_unique_alias(cr, uid,
174 {'alias_name': vals['name']},174 {'alias_name': vals['name']},
175 model_name="crm.lead",175 model_name="crm.lead",
176 context=context)176 context=context)
@@ -178,7 +178,7 @@
178 res = super(crm_case_section, self).create(cr, uid, vals, context)178 res = super(crm_case_section, self).create(cr, uid, vals, context)
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)
180 return res180 return res
181 181
182 def unlink(self, cr, uid, ids, context=None):182 def unlink(self, cr, uid, ids, context=None):
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.
184 mail_alias = self.pool.get('mail.alias')184 mail_alias = self.pool.get('mail.alias')
@@ -217,7 +217,6 @@
217 'section_id': fields.many2one('crm.case.section', 'Sales Team'),217 'section_id': fields.many2one('crm.case.section', 'Sales Team'),
218 }218 }
219219
220
221def _links_get(self, cr, uid, context=None):220def _links_get(self, cr, uid, context=None):
222 """Gets links value for reference field"""221 """Gets links value for reference field"""
223 obj = self.pool.get('res.request.link')222 obj = self.pool.get('res.request.link')
224223
=== modified file 'crm/crm_lead.py'
--- crm/crm_lead.py 2012-09-28 09:53:31 +0000
+++ crm/crm_lead.py 2012-10-02 11:29:53 +0000
@@ -311,7 +311,6 @@
311 }311 }
312 return {'value' : values}312 return {'value' : values}
313313
314
315 def _check(self, cr, uid, ids=False, context=None):314 def _check(self, cr, uid, ids=False, context=None):
316 """ Override of the base.stage method.315 """ Override of the base.stage method.
317 Function called by the scheduler to process cases for date actions316 Function called by the scheduler to process cases for date actions
@@ -801,7 +800,7 @@
801 if section_id:800 if section_id:
802 vals.setdefault('message_follower_ids', [])801 vals.setdefault('message_follower_ids', [])
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]
804 return super(crm_lead,self).write(cr, uid, ids, vals, context) 803 return super(crm_lead,self).write(cr, uid, ids, vals, context)
805804
806 # ----------------------------------------805 # ----------------------------------------
807 # Mail Gateway806 # Mail Gateway
808807
=== modified file 'crm_claim/crm_claim.py'
--- crm_claim/crm_claim.py 2012-09-10 04:17:26 +0000
+++ crm_claim/crm_claim.py 2012-10-02 11:29:53 +0000
@@ -35,7 +35,7 @@
3535
36class crm_claim_stage(osv.osv):36class crm_claim_stage(osv.osv):
37 """ Model for claim stages. This models the main stages of a claim37 """ Model for claim stages. This models the main stages of a claim
38 management flow. Main CRM objects (leads, opportunities, project 38 management flow. Main CRM objects (leads, opportunities, project
39 issues, ...) will now use only stages, instead of state and stages.39 issues, ...) will now use only stages, instead of state and stages.
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.
41 """41 """
@@ -104,7 +104,7 @@
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."),
105 'partner_phone': fields.char('Phone', size=32),105 'partner_phone': fields.char('Phone', size=32),
106 'stage_id': fields.many2one ('crm.claim.stage', 'Stage',106 'stage_id': fields.many2one ('crm.claim.stage', 'Stage',
107 domain="['|', ('section_ids', '=', section_id), ('case_default', '=', True)]"), 107 domain="['|', ('section_ids', '=', section_id), ('case_default', '=', True)]"),
108 'cause': fields.text('Root Cause'),108 'cause': fields.text('Root Cause'),
109 'state': fields.related('stage_id', 'state', type="selection", store=True,109 'state': fields.related('stage_id', 'state', type="selection", store=True,
110 selection=crm.AVAILABLE_STATES, string="State", readonly=True,110 selection=crm.AVAILABLE_STATES, string="State", readonly=True,
111111
=== modified file 'crm_helpdesk/crm_helpdesk.py'
--- crm_helpdesk/crm_helpdesk.py 2012-09-17 10:11:09 +0000
+++ crm_helpdesk/crm_helpdesk.py 2012-10-02 11:29:53 +0000
@@ -69,9 +69,9 @@
69 'probability': fields.float('Probability (%)'),69 'probability': fields.float('Probability (%)'),
70 'categ_id': fields.many2one('crm.case.categ', 'Category', \70 'categ_id': fields.many2one('crm.case.categ', 'Category', \
71 domain="['|',('section_id','=',False),('section_id','=',section_id),\71 domain="['|',('section_id','=',False),('section_id','=',section_id),\
72 ('object_id.model', '=', 'crm.helpdesk')]"), 72 ('object_id.model', '=', 'crm.helpdesk')]"),
73 'duration': fields.float('Duration', states={'done': [('readonly', True)]}), 73 'duration': fields.float('Duration', states={'done': [('readonly', True)]}),
74 'state': fields.selection(crm.AVAILABLE_STATES, 'Status', size=16, readonly=True, 74 'state': fields.selection(crm.AVAILABLE_STATES, 'Status', size=16, readonly=True,
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.\
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\'.\
77 \nWhen the case is over, the state is set to \'Done\'.\77 \nWhen the case is over, the state is set to \'Done\'.\
@@ -139,9 +139,9 @@
139139
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)
141141
142 # ******************************142 # ---------------------------------------------------
143 # OpenChatter143 # OpenChatter
144 # ******************************144 # ---------------------------------------------------
145145
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):
147 """ override of default base_state method. """147 """ override of default base_state method. """
@@ -152,5 +152,4 @@
152 self.message_post(cr, uid, ids, body=msg, context=context)152 self.message_post(cr, uid, ids, body=msg, context=context)
153 return True153 return True
154154
155
156# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:155# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
157156
=== modified file 'crm_profiling/crm_profiling.py'
--- crm_profiling/crm_profiling.py 2012-07-12 05:50:38 +0000
+++ crm_profiling/crm_profiling.py 2012-10-02 11:29:53 +0000
@@ -77,7 +77,7 @@
77 return ids_to_check77 return ids_to_check
7878
7979
80def test_prof(cr, uid, seg_id, pid, answers_ids = []):80def test_prof(cr, uid, seg_id, pid, answers_ids=None):
8181
82 """ return True if the partner pid fetch the segmentation rule seg_id82 """ return True if the partner pid fetch the segmentation rule seg_id
83 @param cr: the current row, from the database cursor,83 @param cr: the current row, from the database cursor,
8484
=== modified file 'document/content_index.py'
--- document/content_index.py 2012-08-06 17:08:41 +0000
+++ document/content_index.py 2012-10-02 11:29:53 +0000
@@ -51,7 +51,7 @@
51 return mts[0]51 return mts[0]
52 return None52 return None
5353
54 def indexContent(self, content, filename=None, realfile = None):54 def indexContent(self, content, filename=None, realfile=None):
55 """ Use either content or the real file, to index.55 """ Use either content or the real file, to index.
56 Some parsers will work better with the actual56 Some parsers will work better with the actual
57 content, others parse a file easier. Try the57 content, others parse a file easier. Try the
@@ -95,16 +95,15 @@
9595
96 raise NhException('No appropriate method to index file.')96 raise NhException('No appropriate method to index file.')
9797
98 def _doIndexContent(self,content):98 def _doIndexContent(self, content):
99 raise NhException("Content cannot be handled here.")99 raise NhException("Content cannot be handled here.")
100100
101 def _doIndexFile(self,fpath):101 def _doIndexFile(self, fpath):
102 raise NhException("Content cannot be handled here.")102 raise NhException("Content cannot be handled here.")
103103
104 def __repr__(self):104 def __repr__(self):
105 return "<indexer %s.%s>" %(self.__module__, self.__class__.__name__)105 return "<indexer %s.%s>" %(self.__module__, self.__class__.__name__)
106106
107
108def mime_match(mime, mdict):107def mime_match(mime, mdict):
109 if mdict.has_key(mime):108 if mdict.has_key(mime):
110 return (mime, mdict[mime])109 return (mime, mdict[mime])
@@ -136,7 +135,7 @@
136 if not f:135 if not f:
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.")
138137
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):
140 fobj = None139 fobj = None
141 fname = None140 fname = None
142 mime = None141 mime = None
143142
=== modified file 'document/document.py'
--- document/document.py 2012-09-24 16:26:45 +0000
+++ document/document.py 2012-10-02 11:29:53 +0000
@@ -149,7 +149,7 @@
149 _sql_constraints = [149 _sql_constraints = [
150 # filename_uniq is not possible in pure SQL150 # filename_uniq is not possible in pure SQL
151 ]151 ]
152 def _check_duplication(self, cr, uid, vals, ids=[], op='create'):152 def _check_duplication(self, cr, uid, vals, ids=None, op='create'):
153 name = vals.get('name', False)153 name = vals.get('name', False)
154 parent_id = vals.get('parent_id', False)154 parent_id = vals.get('parent_id', False)
155 res_model = vals.get('res_model', False)155 res_model = vals.get('res_model', False)
156156
=== modified file 'document/document_directory.py'
--- document/document_directory.py 2012-09-24 16:26:45 +0000
+++ document/document_directory.py 2012-10-02 11:29:53 +0000
@@ -221,7 +221,7 @@
221 pass221 pass
222 return res222 return res
223223
224 def _locate_child(self, cr, uid, root_id, uri,nparent, ncontext):224 def _locate_child(self, cr, uid, root_id, uri, nparent, ncontext):
225 """ try to locate the node in uri,225 """ try to locate the node in uri,
226 Return a tuple (node_dir, remaining_path)226 Return a tuple (node_dir, remaining_path)
227 """227 """
@@ -234,7 +234,7 @@
234 default.update(name=_("%s (copy)") % (name))234 default.update(name=_("%s (copy)") % (name))
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)
236236
237 def _check_duplication(self, cr, uid, vals, ids=[], op='create'):237 def _check_duplication(self, cr, uid, vals, ids=None, op='create'):
238 name=vals.get('name',False)238 name=vals.get('name',False)
239 parent_id=vals.get('parent_id',False)239 parent_id=vals.get('parent_id',False)
240 ressource_parent_type_id=vals.get('ressource_parent_type_id',False)240 ressource_parent_type_id=vals.get('ressource_parent_type_id',False)
241241
=== modified file 'document/nodes.py'
--- document/nodes.py 2012-08-06 17:08:41 +0000
+++ document/nodes.py 2012-10-02 11:29:53 +0000
@@ -103,7 +103,7 @@
103 def get(self, name, default=None):103 def get(self, name, default=None):
104 return self.context.get(name, default)104 return self.context.get(name, default)
105105
106 def get_uri(self, cr, uri):106 def get_uri(self, cr, uri):
107 """ Although this fn passes back to doc.dir, it is needed since107 """ Although this fn passes back to doc.dir, it is needed since
108 it is a potential caching point.108 it is a potential caching point.
109 """109 """
@@ -252,7 +252,7 @@
252 print "node_class.children()"252 print "node_class.children()"
253 return [] #stub253 return [] #stub
254254
255 def child(self,cr, name, domain=None):255 def child(self, cr, name, domain=None):
256 print "node_class.child()"256 print "node_class.child()"
257 return None257 return None
258258
@@ -270,7 +270,7 @@
270 print "node_class.path_get()"270 print "node_class.path_get()"
271 return False271 return False
272272
273 def get_data(self,cr):273 def get_data(self, cr):
274 raise TypeError('No data for %s.'% self.type)274 raise TypeError('No data for %s.'% self.type)
275275
276 def open_data(self, cr, mode):276 def open_data(self, cr, mode):
@@ -287,10 +287,10 @@
287 """287 """
288 raise TypeError('No data for %s.' % self.type)288 raise TypeError('No data for %s.' % self.type)
289289
290 def _get_storage(self,cr):290 def _get_storage(self, cr):
291 raise RuntimeError("No storage for base class.")291 raise RuntimeError("No storage for base class.")
292292
293 def get_etag(self,cr):293 def get_etag(self, cr):
294 """ Get a tag, unique per object + modification.294 """ Get a tag, unique per object + modification.
295295
296 see. http://tools.ietf.org/html/rfc2616#section-13.3.3 """296 see. http://tools.ietf.org/html/rfc2616#section-13.3.3 """
@@ -434,7 +434,9 @@
434434
435 """435 """
436 our_type = 'database'436 our_type = 'database'
437 def __init__(self, path=[], parent=False, context=None):437 def __init__(self, path=None, parent=False, context=None):
438 if path is None:
439 path = []
438 super(node_database,self).__init__(path, parent, context)440 super(node_database,self).__init__(path, parent, context)
439 self.unixperms = 040750441 self.unixperms = 040750
440 self.uidperms = 5442 self.uidperms = 5
@@ -477,11 +479,11 @@
477479
478 return res480 return res
479481
480 def _file_get(self,cr, nodename=False):482 def _file_get(self, cr, nodename=False):
481 res = []483 res = []
482 return res484 return res
483485
484 def _get_ttag(self,cr):486 def _get_ttag(self, cr):
485 return 'db-%s' % cr.dbname487 return 'db-%s' % cr.dbname
486488
487def mkdosname(company_name, default='noname'):489def mkdosname(company_name, default='noname'):
@@ -666,7 +668,6 @@
666668
667 return dirobj.create(cr, uid, val)669 return dirobj.create(cr, uid, val)
668670
669
670 def create_child(self, cr, path, data=None):671 def create_child(self, cr, path, data=None):
671 """ API function to create a child file object and node672 """ API function to create a child file object and node
672 Return the node_* created673 Return the node_* created
@@ -693,7 +694,7 @@
693 fnode.set_data(cr, data, fil)694 fnode.set_data(cr, data, fil)
694 return fnode695 return fnode
695696
696 def _get_ttag(self,cr):697 def _get_ttag(self, cr):
697 return 'dir-%d' % self.dir_id698 return 'dir-%d' % self.dir_id
698699
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):
@@ -802,7 +803,7 @@
802 def children(self, cr, domain=None):803 def children(self, cr, domain=None):
803 return self._child_get(cr, domain=domain)804 return self._child_get(cr, domain=domain)
804805
805 def child(self,cr, name, domain=None):806 def child(self, cr, name, domain=None):
806 res = self._child_get(cr, name, domain=domain)807 res = self._child_get(cr, name, domain=domain)
807 if res:808 if res:
808 return res[0]809 return res[0]
@@ -878,7 +879,7 @@
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))
879 return res880 return res
880881
881 def _get_ttag(self,cr):882 def _get_ttag(self, cr):
882 return 'rdir-%d' % self.dir_id883 return 'rdir-%d' % self.dir_id
883884
884class node_res_obj(node_class):885class node_res_obj(node_class):
@@ -889,7 +890,7 @@
889 node_dirs (with limited domain).890 node_dirs (with limited domain).
890 """891 """
891 our_type = 'collection'892 our_type = 'collection'
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):
893 super(node_res_obj,self).__init__(path, parent,context)894 super(node_res_obj,self).__init__(path, parent,context)
894 assert parent895 assert parent
895 #todo: more info from dirr896 #todo: more info from dirr
@@ -958,7 +959,7 @@
958 return res[0]959 return res[0]
959 return None960 return None
960961
961 def _file_get(self,cr, nodename=False):962 def _file_get(self, cr, nodename=False):
962 res = []963 res = []
963 is_allowed = self.check_perms((nodename and 1) or 5)964 is_allowed = self.check_perms((nodename and 1) or 5)
964 if not is_allowed:965 if not is_allowed:
@@ -1160,7 +1161,7 @@
1160 fnode.set_data(cr, data, fil)1161 fnode.set_data(cr, data, fil)
1161 return fnode1162 return fnode
11621163
1163 def _get_ttag(self,cr):1164 def _get_ttag(self, cr):
1164 return 'rodir-%d-%d' % (self.dir_id, self.res_id)1165 return 'rodir-%d-%d' % (self.dir_id, self.res_id)
11651166
1166node_res_dir.res_obj_class = node_res_obj1167node_res_dir.res_obj_class = node_res_obj
@@ -1210,7 +1211,6 @@
1210 return False1211 return False
1211 return self.file_id == other.file_id1212 return self.file_id == other.file_id
12121213
1213
1214 def open_data(self, cr, mode):1214 def open_data(self, cr, mode):
1215 stor = self.storage_id1215 stor = self.storage_id
1216 assert stor, "No storage for file #%s." % self.file_id1216 assert stor, "No storage for file #%s." % self.file_id
@@ -1262,7 +1262,7 @@
1262 else:1262 else:
1263 self.path = dirpath[0]1263 self.path = dirpath[0]
12641264
1265 def get_data(self, cr, fil_obj = None):1265 def get_data(self, cr, fil_obj=None):
1266 """ Retrieve the data for some file.1266 """ Retrieve the data for some file.
1267 fil_obj may optionally be specified, and should be a browse object1267 fil_obj may optionally be specified, and should be a browse object
1268 for the file. This is useful when the caller has already initiated1268 for the file. This is useful when the caller has already initiated
@@ -1278,14 +1278,14 @@
1278 stobj = self.context._dirobj.pool.get('document.storage')1278 stobj = self.context._dirobj.pool.get('document.storage')
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)
12801280
1281 def get_data_len(self, cr, fil_obj = None):1281 def get_data_len(self, cr, fil_obj=None):
1282 # TODO: verify with the storage object!1282 # TODO: verify with the storage object!
1283 bin_size = self.context.context.get('bin_size', False)1283 bin_size = self.context.context.get('bin_size', False)
1284 if bin_size and not self.content_length:1284 if bin_size and not self.content_length:
1285 self.content_length = fil_obj.db_datas1285 self.content_length = fil_obj.db_datas
1286 return self.content_length1286 return self.content_length
12871287
1288 def set_data(self, cr, data, fil_obj = None):1288 def set_data(self, cr, data, fil_obj=None):
1289 """ Store data at some file.1289 """ Store data at some file.
1290 fil_obj may optionally be specified, and should be a browse object1290 fil_obj may optionally be specified, and should be a browse object
1291 for the file. This is useful when the caller has already initiated1291 for the file. This is useful when the caller has already initiated
@@ -1299,7 +1299,7 @@
1299 stobj = self.context._dirobj.pool.get('document.storage')1299 stobj = self.context._dirobj.pool.get('document.storage')
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)
13011301
1302 def _get_ttag(self,cr):1302 def _get_ttag(self, cr):
1303 return 'file-%d' % self.file_id1303 return 'file-%d' % self.file_id
13041304
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):
@@ -1362,7 +1362,7 @@
13621362
1363class node_content(node_class):1363class node_content(node_class):
1364 our_type = 'content'1364 our_type = 'content'
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):
1366 super(node_content,self).__init__(path, parent,context)1366 super(node_content,self).__init__(path, parent,context)
1367 self.cnt_id = cnt.id1367 self.cnt_id = cnt.id
1368 self.create_date = False1368 self.create_date = False
@@ -1382,7 +1382,7 @@
1382 self.dctx.update(dctx)1382 self.dctx.update(dctx)
1383 self.act_id = act_id1383 self.act_id = act_id
13841384
1385 def fill_fields(self, cr, dctx = None):1385 def fill_fields(self, cr, dctx=None):
1386 """ Try to read the object and fill missing fields, like mimetype,1386 """ Try to read the object and fill missing fields, like mimetype,
1387 dates etc.1387 dates etc.
1388 This function must be different from the constructor, because1388 This function must be different from the constructor, because
@@ -1395,8 +1395,7 @@
1395 if res and res[0][0]:1395 if res and res[0][0]:
1396 self.mimetype = str(res[0][0])1396 self.mimetype = str(res[0][0])
13971397
13981398 def get_data(self, cr, fil_obj=None):
1399 def get_data(self, cr, fil_obj = None):
1400 cntobj = self.context._dirobj.pool.get('document.directory.content')1399 cntobj = self.context._dirobj.pool.get('document.directory.content')
1401 if not self.check_perms(4):1400 if not self.check_perms(4):
1402 raise IOError(errno.EPERM, "Permission denied.")1401 raise IOError(errno.EPERM, "Permission denied.")
@@ -1426,7 +1425,7 @@
14261425
1427 return nodefd_content(self, cr, mode, ctx)1426 return nodefd_content(self, cr, mode, ctx)
14281427
1429 def get_data_len(self, cr, fil_obj = None):1428 def get_data_len(self, cr, fil_obj=None):
1430 # FIXME : here, we actually generate the content twice!!1429 # FIXME : here, we actually generate the content twice!!
1431 # we should have cached the generated content, but it is1430 # we should have cached the generated content, but it is
1432 # not advisable to do keep it in memory, until we have a cache1431 # not advisable to do keep it in memory, until we have a cache
@@ -1435,7 +1434,7 @@
1435 self.get_data(cr,fil_obj)1434 self.get_data(cr,fil_obj)
1436 return self.content_length1435 return self.content_length
14371436
1438 def set_data(self, cr, data, fil_obj = None):1437 def set_data(self, cr, data, fil_obj=None):
1439 cntobj = self.context._dirobj.pool.get('document.directory.content')1438 cntobj = self.context._dirobj.pool.get('document.directory.content')
1440 if not self.check_perms(2):1439 if not self.check_perms(2):
1441 raise IOError(errno.EPERM, "Permission denied.")1440 raise IOError(errno.EPERM, "Permission denied.")
@@ -1444,7 +1443,7 @@
1444 ctx.update(self.dctx)1443 ctx.update(self.dctx)
1445 return cntobj.process_write(cr, self.context.uid, self, data, ctx)1444 return cntobj.process_write(cr, self.context.uid, self, data, ctx)
14461445
1447 def _get_ttag(self,cr):1446 def _get_ttag(self, cr):
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 '')
14491448
1450 def get_dav_resourcetype(self, cr):1449 def get_dav_resourcetype(self, cr):
@@ -1558,5 +1557,4 @@
1558 cr.close()1557 cr.close()
1559 StringIO.close(self)1558 StringIO.close(self)
15601559
1561#eof
1562# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:1560# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
15631561
=== modified file 'document/odt2txt.py' (properties changed: +x to -x)
--- document/odt2txt.py 2011-09-22 09:55:31 +0000
+++ document/odt2txt.py 2012-10-02 11:29:53 +0000
@@ -24,11 +24,11 @@
24import StringIO24import StringIO
2525
26class OpenDocumentTextFile :26class OpenDocumentTextFile :
27 def __init__ (self, filepath) :27 def __init__ (self, filepath):
28 zip = zipfile.ZipFile(filepath)28 zip = zipfile.ZipFile(filepath)
29 self.content = xml.dom.minidom.parseString(zip.read("content.xml"))29 self.content = xml.dom.minidom.parseString(zip.read("content.xml"))
3030
31 def toString (self) :31 def toString (self):
32 """ Converts the document to a string. """32 """ Converts the document to a string. """
33 buffer = u""33 buffer = u""
34 for val in ["text:p", "text:h", "text:list"]:34 for val in ["text:p", "text:h", "text:list"]:
@@ -36,7 +36,7 @@
36 buffer += self.textToString(paragraph) + "\n"36 buffer += self.textToString(paragraph) + "\n"
37 return buffer37 return buffer
3838
39 def textToString(self, element) :39 def textToString(self, element):
40 buffer = u""40 buffer = u""
41 for node in element.childNodes :41 for node in element.childNodes :
42 if node.nodeType == xml.dom.Node.TEXT_NODE :42 if node.nodeType == xml.dom.Node.TEXT_NODE :
4343
=== modified file 'document/std_index.py'
--- document/std_index.py 2012-07-25 10:33:34 +0000
+++ document/std_index.py 2012-10-02 11:29:53 +0000
@@ -39,7 +39,7 @@
39 except UnicodeError:39 except UnicodeError:
40 return s40 return s
4141
42def textToString(element) :42def textToString(element):
43 buffer = u""43 buffer = u""
44 for node in element.childNodes :44 for node in element.childNodes :
45 if node.nodeType == xml.dom.Node.TEXT_NODE :45 if node.nodeType == xml.dom.Node.TEXT_NODE :
@@ -56,7 +56,7 @@
56 def _getExtensions(self):56 def _getExtensions(self):
57 return ['.txt', '.py']57 return ['.txt', '.py']
5858
59 def _doIndexContent(self,content):59 def _doIndexContent(self, content):
60 return content60 return content
6161
62cntIndex.register(TxtIndex())62cntIndex.register(TxtIndex())
@@ -68,7 +68,7 @@
68 def _getExtensions(self):68 def _getExtensions(self):
69 return ['.pptx']69 return ['.pptx']
7070
71 def _doIndexFile(self,fname):71 def _doIndexFile(self, fname):
72 def toString () :72 def toString () :
73 """ Converts the document to a string. """73 """ Converts the document to a string. """
74 buffer = u""74 buffer = u""
@@ -96,7 +96,7 @@
96 def _getExtensions(self):96 def _getExtensions(self):
97 return ['.doc']97 return ['.doc']
9898
99 def _doIndexFile(self,fname):99 def _doIndexFile(self, fname):
100 try:100 try:
101 pop = Popen(['antiword', fname], shell=False, stdout=PIPE)101 pop = Popen(['antiword', fname], shell=False, stdout=PIPE)
102 (data, _) = pop.communicate()102 (data, _) = pop.communicate()
@@ -116,7 +116,7 @@
116 def _getExtensions(self):116 def _getExtensions(self):
117 return ['.docx']117 return ['.docx']
118118
119 def _doIndexFile(self,fname):119 def _doIndexFile(self, fname):
120 zip = zipfile.ZipFile(fname)120 zip = zipfile.ZipFile(fname)
121 content = xml.dom.minidom.parseString(zip.read("word/document.xml"))121 content = xml.dom.minidom.parseString(zip.read("word/document.xml"))
122 def toString () :122 def toString () :
@@ -141,7 +141,7 @@
141 def _getExtensions(self):141 def _getExtensions(self):
142 return ['.xlsx']142 return ['.xlsx']
143143
144 def _doIndexFile(self,fname):144 def _doIndexFile(self, fname):
145 zip = zipfile.ZipFile(fname)145 zip = zipfile.ZipFile(fname)
146 content = xml.dom.minidom.parseString(zip.read("xl/sharedStrings.xml"))146 content = xml.dom.minidom.parseString(zip.read("xl/sharedStrings.xml"))
147 def toString () :147 def toString () :
@@ -165,7 +165,7 @@
165 def _getExtensions(self):165 def _getExtensions(self):
166 return ['.pdf']166 return ['.pdf']
167167
168 def _doIndexFile(self,fname):168 def _doIndexFile(self, fname):
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)
170 (data, _) = pop.communicate()170 (data, _) = pop.communicate()
171 return _to_unicode(data)171 return _to_unicode(data)
@@ -181,7 +181,7 @@
181 return []181 return []
182 #return ['.png','.jpg','.gif','.jpeg','.bmp','.tiff']182 #return ['.png','.jpg','.gif','.jpeg','.bmp','.tiff']
183183
184 def _doIndexContent(self,content):184 def _doIndexContent(self, content):
185 return 'image'185 return 'image'
186186
187187
188188
=== modified file 'document_webdav/document_webdav.py'
--- document_webdav/document_webdav.py 2012-08-06 17:08:41 +0000
+++ document_webdav/document_webdav.py 2012-10-02 11:29:53 +0000
@@ -57,7 +57,7 @@
57 # TODO group57 # TODO group
58 return58 return
5959
60 def _locate_child(self, cr, uid, root_id, uri,nparent, ncontext):60 def _locate_child(self, cr, uid, root_id, uri, nparent, ncontext):
61 """ try to locate the node in uri,61 """ try to locate the node in uri,
62 Return a tuple (node_dir, remaining_path)62 Return a tuple (node_dir, remaining_path)
63 """63 """
6464
=== modified file 'document_webdav/redirect.py'
--- document_webdav/redirect.py 2012-06-22 06:48:39 +0000
+++ document_webdav/redirect.py 2012-10-02 11:29:53 +0000
@@ -30,7 +30,7 @@
30 _HTTP_OPTIONS = { 'Allow': ['OPTIONS', 'GET', 'HEAD', 'PROPFIND'] }30 _HTTP_OPTIONS = { 'Allow': ['OPTIONS', 'GET', 'HEAD', 'PROPFIND'] }
31 redirect_paths = {}31 redirect_paths = {}
3232
33 def __init__(self,request, client_address, server):33 def __init__(self, request, client_address, server):
34 HTTPHandler.__init__(self,request,client_address,server)34 HTTPHandler.__init__(self,request,client_address,server)
3535
36 def send_head(self):36 def send_head(self):
3737
=== modified file 'document_webdav/test_davclient.py' (properties changed: +x to -x)
--- document_webdav/test_davclient.py 2012-08-31 13:51:36 +0000
+++ document_webdav/test_davclient.py 2012-10-02 11:29:53 +0000
@@ -683,7 +683,7 @@
683 assert d2 == d, "Data does not match"683 assert d2 == d, "Data does not match"
684 return ctype, rrange, d684 return ctype, rrange, d
685685
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):
687 """ HTTP PUT687 """ HTTP PUT
688 @param noclobber will prevent overwritting a resource (If-None-Match)688 @param noclobber will prevent overwritting a resource (If-None-Match)
689 @param mime will set the content-type689 @param mime will set the content-type
@@ -705,5 +705,4 @@
705 etag = m.getheader('ETag')705 etag = m.getheader('ETag')
706 return etag or True706 return etag or True
707707
708#eof
709# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:708# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
710709
=== modified file 'document_webdav/webdav.py'
--- document_webdav/webdav.py 2012-07-13 05:29:57 +0000
+++ document_webdav/webdav.py 2012-10-02 11:29:53 +0000
@@ -236,7 +236,7 @@
236 return re236 return re
237237
238238
239def mk_propname_response(self,uri,propnames,doc):239def mk_propname_response(self, uri, propnames, doc):
240 """ make a new <prop> result element for a PROPNAME request240 """ make a new <prop> result element for a PROPNAME request
241241
242 This will simply format the propnames list.242 This will simply format the propnames list.
243243
=== modified file 'document_webdav/webdav_server.py'
--- document_webdav/webdav_server.py 2012-08-06 17:08:41 +0000
+++ document_webdav/webdav_server.py 2012-10-02 11:29:53 +0000
@@ -81,7 +81,7 @@
81 'DELETE', 'TRACE', 'REPORT', ]81 'DELETE', 'TRACE', 'REPORT', ]
82 }82 }
8383
84 def get_userinfo(self,user,pw):84 def get_userinfo(self, user, pw):
85 return False85 return False
8686
87 def _log(self, message):87 def _log(self, message):
@@ -167,7 +167,7 @@
167 self.close_connection = 1167 self.close_connection = 1
168 DAVRequestHandler.send_header(self, key, value)168 DAVRequestHandler.send_header(self, key, value)
169169
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):
171 if headers and 'Connection' in headers:171 if headers and 'Connection' in headers:
172 pass172 pass
173 elif self.request_version in ('HTTP/1.0', 'HTTP/0.9'):173 elif self.request_version in ('HTTP/1.0', 'HTTP/0.9'):
@@ -441,10 +441,10 @@
441 def __init__(self, parent):441 def __init__(self, parent):
442 self.parent = parent442 self.parent = parent
443443
444 def get_propnames(self,uri):444 def get_propnames(self, uri):
445 return self.PROPS445 return self.PROPS
446446
447 def get_prop(self,uri,ns,propname):447 def get_prop(self, uri, ns, propname):
448 if self.M_NS.has_key(ns):448 if self.M_NS.has_key(ns):
449 prefix=self.M_NS[ns]449 prefix=self.M_NS[ns]
450 else:450 else:
@@ -460,10 +460,10 @@
460 def get_data(self, uri, range=None):460 def get_data(self, uri, range=None):
461 raise DAV_NotFound461 raise DAV_NotFound
462462
463 def _get_dav_creationdate(self,uri):463 def _get_dav_creationdate(self, uri):
464 return time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())464 return time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())
465465
466 def _get_dav_getlastmodified(self,uri):466 def _get_dav_getlastmodified(self, uri):
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())
468468
469 def _get_dav_displayname(self, uri):469 def _get_dav_displayname(self, uri):
470470
=== modified file 'email_template/html2text.py' (properties changed: +x to -x)
--- email_template/html2text.py 2011-12-19 16:54:40 +0000
+++ email_template/html2text.py 2012-10-02 11:29:53 +0000
@@ -41,13 +41,13 @@
41 if k.startswith("&#") and k.endswith(";"): return int(k[2:-1]) # not in latin-141 if k.startswith("&#") and k.endswith(";"): return int(k[2:-1]) # not in latin-1
42 return ord(codecs.latin_1_decode(k)[0])42 return ord(codecs.latin_1_decode(k)[0])
4343
44unifiable = {'rsquo':"'", 'lsquo':"'", 'rdquo':'"', 'ldquo':'"', 44unifiable = {'rsquo':"'", 'lsquo':"'", 'rdquo':'"', 'ldquo':'"',
45'copy':'(C)', 'mdash':'--', 'nbsp':' ', 'rarr':'->', 'larr':'<-', 'middot':'*',45'copy':'(C)', 'mdash':'--', 'nbsp':' ', 'rarr':'->', 'larr':'<-', 'middot':'*',
46'ndash':'-', 'oelig':'oe', 'aelig':'ae',46'ndash':'-', 'oelig':'oe', 'aelig':'ae',
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',
48'egrave':'e', 'eacute':'e', 'ecirc':'e', 'euml':'e', 48'egrave':'e', 'eacute':'e', 'ecirc':'e', 'euml':'e',
49'igrave':'i', 'iacute':'i', 'icirc':'i', 'iuml':'i',49'igrave':'i', 'iacute':'i', 'icirc':'i', 'iuml':'i',
50'ograve':'o', 'oacute':'o', 'ocirc':'o', 'otilde':'o', 'ouml':'o', 50'ograve':'o', 'oacute':'o', 'ocirc':'o', 'otilde':'o', 'ouml':'o',
51'ugrave':'u', 'uacute':'u', 'ucirc':'u', 'uuml':'u'}51'ugrave':'u', 'uacute':'u', 'ucirc':'u', 'uuml':'u'}
5252
53unifiable_n = {}53unifiable_n = {}
@@ -60,7 +60,7 @@
60 c = int(name[1:], 16)60 c = int(name[1:], 16)
61 else:61 else:
62 c = int(name)62 c = int(name)
63 63
64 if not UNICODE_SNOB and c in unifiable_n.keys():64 if not UNICODE_SNOB and c in unifiable_n.keys():
65 return unifiable_n[c]65 return unifiable_n[c]
66 else:66 else:
@@ -76,14 +76,14 @@
7676
77def replaceEntities(s):77def replaceEntities(s):
78 s = s.group(1)78 s = s.group(1)
79 if s[0] == "#": 79 if s[0] == "#":
80 return charref(s[1:])80 return charref(s[1:])
81 else: return entityref(s)81 else: return entityref(s)
8282
83r_unescape = re.compile(r"&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));")83r_unescape = re.compile(r"&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));")
84def unescape(s):84def unescape(s):
85 return r_unescape.sub(replaceEntities, s)85 return r_unescape.sub(replaceEntities, s)
86 86
87def fixattrs(attrs):87def fixattrs(attrs):
88 # Fix bug in sgmllib.py88 # Fix bug in sgmllib.py
89 if not attrs: return attrs89 if not attrs: return attrs
@@ -105,7 +105,7 @@
105 """Wrap all paragraphs in the provided text."""105 """Wrap all paragraphs in the provided text."""
106 if not BODY_WIDTH:106 if not BODY_WIDTH:
107 return text107 return text
108 108
109 assert wrap, "Requires Python 2.3."109 assert wrap, "Requires Python 2.3."
110 result = ''110 result = ''
111 newlines = 0111 newlines = 0
@@ -136,7 +136,7 @@
136class _html2text(sgmllib.SGMLParser):136class _html2text(sgmllib.SGMLParser):
137 def __init__(self, out=sys.stdout.write, baseurl=''):137 def __init__(self, out=sys.stdout.write, baseurl=''):
138 sgmllib.SGMLParser.__init__(self)138 sgmllib.SGMLParser.__init__(self)
139 139
140 if out is None: self.out = self.outtextf140 if out is None: self.out = self.outtextf
141 else: self.out = out141 else: self.out = out
142 self.outtext = u''142 self.outtext = u''
@@ -157,43 +157,43 @@
157 self.abbr_data = None # last inner HTML (for abbr being defined)157 self.abbr_data = None # last inner HTML (for abbr being defined)
158 self.abbr_list = {} # stack of abbreviations to write later158 self.abbr_list = {} # stack of abbreviations to write later
159 self.baseurl = baseurl159 self.baseurl = baseurl
160 160
161 def outtextf(self, s): 161 def outtextf(self, s):
162 self.outtext += s162 self.outtext += s
163 163
164 def close(self):164 def close(self):
165 sgmllib.SGMLParser.close(self)165 sgmllib.SGMLParser.close(self)
166 166
167 self.pbr()167 self.pbr()
168 self.o('', 0, 'end')168 self.o('', 0, 'end')
169 169
170 return self.outtext170 return self.outtext
171 171
172 def handle_charref(self, c):172 def handle_charref(self, c):
173 self.o(charref(c))173 self.o(charref(c))
174174
175 def handle_entityref(self, c):175 def handle_entityref(self, c):
176 self.o(entityref(c))176 self.o(entityref(c))
177 177
178 def unknown_starttag(self, tag, attrs):178 def unknown_starttag(self, tag, attrs):
179 self.handle_tag(tag, attrs, 1)179 self.handle_tag(tag, attrs, 1)
180 180
181 def unknown_endtag(self, tag):181 def unknown_endtag(self, tag):
182 self.handle_tag(tag, None, 0)182 self.handle_tag(tag, None, 0)
183 183
184 def previousIndex(self, attrs):184 def previousIndex(self, attrs):
185 """ returns the index of certain set of attributes (of a link) in the185 """ returns the index of certain set of attributes (of a link) in the
186 self.a list186 self.a list
187 187
188 If the set of attributes is not found, returns None188 If the set of attributes is not found, returns None
189 """189 """
190 if not attrs.has_key('href'): return None190 if not attrs.has_key('href'): return None
191 191
192 i = -1192 i = -1
193 for a in self.a:193 for a in self.a:
194 i += 1194 i += 1
195 match = 0195 match = 0
196 196
197 if a.has_key('href') and a['href'] == attrs['href']:197 if a.has_key('href') and a['href'] == attrs['href']:
198 if a.has_key('title') or attrs.has_key('title'):198 if a.has_key('title') or attrs.has_key('title'):
199 if (a.has_key('title') and attrs.has_key('title') and199 if (a.has_key('title') and attrs.has_key('title') and
@@ -206,13 +206,13 @@
206206
207 def handle_tag(self, tag, attrs, start):207 def handle_tag(self, tag, attrs, start):
208 attrs = fixattrs(attrs)208 attrs = fixattrs(attrs)
209 209
210 if hn(tag):210 if hn(tag):
211 self.p()211 self.p()
212 if start: self.o(hn(tag)*"#" + ' ')212 if start: self.o(hn(tag)*"#" + ' ')
213213
214 if tag in ['p', 'div']: self.p()214 if tag in ['p', 'div']: self.p()
215 215
216 if tag == "br" and start: self.o(" \n")216 if tag == "br" and start: self.o(" \n")
217217
218 if tag == "hr" and start:218 if tag == "hr" and start:
@@ -220,21 +220,21 @@
220 self.o("* * *")220 self.o("* * *")
221 self.p()221 self.p()
222222
223 if tag in ["head", "style", 'script']: 223 if tag in ["head", "style", 'script']:
224 if start: self.quiet += 1224 if start: self.quiet += 1
225 else: self.quiet -= 1225 else: self.quiet -= 1
226226
227 if tag in ["body"]:227 if tag in ["body"]:
228 self.quiet = 0 # sites like 9rules.com never close <head>228 self.quiet = 0 # sites like 9rules.com never close <head>
229 229
230 if tag == "blockquote":230 if tag == "blockquote":
231 if start: 231 if start:
232 self.p(); self.o('> ', 0, 1); self.start = 1232 self.p(); self.o('> ', 0, 1); self.start = 1
233 self.blockquote += 1233 self.blockquote += 1
234 else:234 else:
235 self.blockquote -= 1235 self.blockquote -= 1
236 self.p()236 self.p()
237 237
238 if tag in ['em', 'i', 'u']: self.o("_")238 if tag in ['em', 'i', 'u']: self.o("_")
239 if tag in ['strong', 'b']: self.o("**")239 if tag in ['strong', 'b']: self.o("**")
240 if tag == "code" and not self.pre: self.o('`') #TODO: `` `this` ``240 if tag == "code" and not self.pre: self.o('`') #TODO: `` `this` ``
@@ -243,7 +243,7 @@
243 attrsD = {}243 attrsD = {}
244 for (x, y) in attrs: attrsD[x] = y244 for (x, y) in attrs: attrsD[x] = y
245 attrs = attrsD245 attrs = attrsD
246 246
247 self.abbr_title = None247 self.abbr_title = None
248 self.abbr_data = ''248 self.abbr_data = ''
249 if attrs.has_key('title'):249 if attrs.has_key('title'):
@@ -253,13 +253,13 @@
253 self.abbr_list[self.abbr_data] = self.abbr_title253 self.abbr_list[self.abbr_data] = self.abbr_title
254 self.abbr_title = None254 self.abbr_title = None
255 self.abbr_data = ''255 self.abbr_data = ''
256 256
257 if tag == "a":257 if tag == "a":
258 if start:258 if start:
259 attrsD = {}259 attrsD = {}
260 for (x, y) in attrs: attrsD[x] = y260 for (x, y) in attrs: attrsD[x] = y
261 attrs = attrsD261 attrs = attrsD
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('#')):
263 self.astack.append(attrs)263 self.astack.append(attrs)
264 self.o("[")264 self.o("[")
265 else:265 else:
@@ -277,7 +277,7 @@
277 a['outcount'] = self.outcount277 a['outcount'] = self.outcount
278 self.a.append(a)278 self.a.append(a)
279 self.o("][" + `a['count']` + "]")279 self.o("][" + `a['count']` + "]")
280 280
281 if tag == "img" and start:281 if tag == "img" and start:
282 attrsD = {}282 attrsD = {}
283 for (x, y) in attrs: attrsD[x] = y283 for (x, y) in attrs: attrsD[x] = y
@@ -296,20 +296,20 @@
296 self.o("![")296 self.o("![")
297 self.o(alt)297 self.o(alt)
298 self.o("]["+`attrs['count']`+"]")298 self.o("]["+`attrs['count']`+"]")
299 299
300 if tag == 'dl' and start: self.p()300 if tag == 'dl' and start: self.p()
301 if tag == 'dt' and not start: self.pbr()301 if tag == 'dt' and not start: self.pbr()
302 if tag == 'dd' and start: self.o(' ')302 if tag == 'dd' and start: self.o(' ')
303 if tag == 'dd' and not start: self.pbr()303 if tag == 'dd' and not start: self.pbr()
304 304
305 if tag in ["ol", "ul"]:305 if tag in ["ol", "ul"]:
306 if start:306 if start:
307 self.list.append({'name':tag, 'num':0})307 self.list.append({'name':tag, 'num':0})
308 else:308 else:
309 if self.list: self.list.pop()309 if self.list: self.list.pop()
310 310
311 self.p()311 self.p()
312 312
313 if tag == 'li':313 if tag == 'li':
314 if start:314 if start:
315 self.pbr()315 self.pbr()
@@ -323,10 +323,10 @@
323 self.start = 1323 self.start = 1
324 else:324 else:
325 self.pbr()325 self.pbr()
326 326
327 if tag in ["table", "tr"] and start: self.p()327 if tag in ["table", "tr"] and start: self.p()
328 if tag == 'td': self.pbr()328 if tag == 'td': self.pbr()
329 329
330 if tag == "pre":330 if tag == "pre":
331 if start:331 if start:
332 self.startpre = 1332 self.startpre = 1
@@ -334,34 +334,35 @@
334 else:334 else:
335 self.pre = 0335 self.pre = 0
336 self.p()336 self.p()
337 337
338 def pbr(self):338 def pbr(self):
339 if self.p_p == 0: self.p_p = 1339 if self.p_p == 0: self.p_p = 1
340340
341 def p(self): self.p_p = 2341 def p(self):
342 342 self.p_p = 2
343
343 def o(self, data, puredata=0, force=0):344 def o(self, data, puredata=0, force=0):
344 if self.abbr_data is not None: self.abbr_data += data345 if self.abbr_data is not None: self.abbr_data += data
345 346
346 if not self.quiet: 347 if not self.quiet:
347 if puredata and not self.pre:348 if puredata and not self.pre:
348 data = re.sub('\s+', ' ', data)349 data = re.sub('\s+', ' ', data)
349 if data and data[0] == ' ':350 if data and data[0] == ' ':
350 self.space = 1351 self.space = 1
351 data = data[1:]352 data = data[1:]
352 if not data and not force: return353 if not data and not force: return
353 354
354 if self.startpre:355 if self.startpre:
355 #self.out(" :") #TODO: not output when already one there356 #self.out(" :") #TODO: not output when already one there
356 self.startpre = 0357 self.startpre = 0
357 358
358 bq = (">" * self.blockquote)359 bq = (">" * self.blockquote)
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 += " "
360 361
361 if self.pre:362 if self.pre:
362 bq += " "363 bq += " "
363 data = data.replace("\n", "\n"+bq)364 data = data.replace("\n", "\n"+bq)
364 365
365 if self.start:366 if self.start:
366 self.space = 0367 self.space = 0
367 self.p_p = 0368 self.p_p = 0
@@ -377,7 +378,7 @@
377 if self.p_p:378 if self.p_p:
378 self.out(('\n'+bq)*self.p_p)379 self.out(('\n'+bq)*self.p_p)
379 self.space = 0380 self.space = 0
380 381
381 if self.space:382 if self.space:
382 if not self.lastWasNL: self.out(' ')383 if not self.lastWasNL: self.out(' ')
383 self.space = 0384 self.space = 0
@@ -388,7 +389,7 @@
388 newa = []389 newa = []
389 for link in self.a:390 for link in self.a:
390 if self.outcount > link['outcount']:391 if self.outcount > link['outcount']:
391 self.out(" ["+`link['count']`+"]: " + urlparse.urljoin(self.baseurl, link['href'])) 392 self.out(" ["+`link['count']`+"]: " + urlparse.urljoin(self.baseurl, link['href']))
392 if link.has_key('title'): self.out(" ("+link['title']+")")393 if link.has_key('title'): self.out(" ("+link['title']+")")
393 self.out("\n")394 self.out("\n")
394 else:395 else:
@@ -397,7 +398,7 @@
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.
398399
399 self.a = newa400 self.a = newa
400 401
401 if self.abbr_list and force == "end":402 if self.abbr_list and force == "end":
402 for abbr, definition in self.abbr_list.items():403 for abbr, definition in self.abbr_list.items():
403 self.out(" *[" + abbr + "]: " + definition + "\n")404 self.out(" *[" + abbr + "]: " + definition + "\n")
@@ -410,8 +411,9 @@
410 def handle_data(self, data):411 def handle_data(self, data):
411 if r'\/script>' in data: self.quiet -= 1412 if r'\/script>' in data: self.quiet -= 1
412 self.o(data, 1)413 self.o(data, 1)
413 414
414 def unknown_decl(self, data): pass415 def unknown_decl(self, data):
416 pass
415417
416def wrapwrite(text): sys.stdout.write(text.encode('utf8'))418def wrapwrite(text): sys.stdout.write(text.encode('utf8'))
417419
418420
=== modified file 'event/event.py'
--- event/event.py 2012-09-17 16:33:01 +0000
+++ event/event.py 2012-10-02 11:29:53 +0000
@@ -223,6 +223,7 @@
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),
224 'user_id': lambda obj, cr, uid, context: uid,224 'user_id': lambda obj, cr, uid, context: uid,
225 }225 }
226
226 def subscribe_to_event(self, cr, uid, ids, context=None):227 def subscribe_to_event(self, cr, uid, ids, context=None):
227 register_pool = self.pool.get('event.registration')228 register_pool = self.pool.get('event.registration')
228 user_pool = self.pool.get('res.users')229 user_pool = self.pool.get('res.users')
@@ -252,6 +253,7 @@
252 _constraints = [253 _constraints = [
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']),
254 ]255 ]
256
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):
256 if type_event:258 if type_event:
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)
@@ -347,7 +349,6 @@
347 'phone': fields.char('Phone', size=64),349 'phone': fields.char('Phone', size=64),
348 'name': fields.char('Name', size=128, select=True),350 'name': fields.char('Name', size=128, select=True),
349 }351 }
350
351 _defaults = {352 _defaults = {
352 'nb_register': 1,353 'nb_register': 1,
353 'state': 'draft',354 'state': 'draft',
354355
=== modified file 'event/report/__init__.py'
--- event/report/__init__.py 2011-01-14 00:11:01 +0000
+++ event/report/__init__.py 2012-10-02 11:29:53 +0000
@@ -21,4 +21,4 @@
2121
22import report_event_registration22import report_event_registration
2323
24# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
25\ No newline at end of file24\ No newline at end of file
25# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2626
=== modified file 'event/wizard/event_confirm.py'
--- event/wizard/event_confirm.py 2011-01-14 00:11:01 +0000
+++ event/wizard/event_confirm.py 2012-10-02 11:29:53 +0000
@@ -34,4 +34,4 @@
3434
35event_confirm()35event_confirm()
3636
37# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
38\ No newline at end of file37\ No newline at end of file
38# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3939
=== modified file 'event_moodle/event_moodle.py'
--- event_moodle/event_moodle.py 2012-09-26 07:45:27 +0000
+++ event_moodle/event_moodle.py 2012-10-02 11:29:53 +0000
@@ -127,7 +127,7 @@
127 passwd = passwd + '+'127 passwd = passwd + '+'
128 return passwd128 return passwd
129129
130 def check_email(self,email):130 def check_email(self, email):
131 131
132 """132 """
133 check if email is correct133 check if email is correct
134134
=== modified file 'event_project/event_project.py'
--- event_project/event_project.py 2011-01-14 00:11:01 +0000
+++ event_project/event_project.py 2012-10-02 11:29:53 +0000
@@ -55,4 +55,4 @@
55 55
56event()56event()
5757
58# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
59\ No newline at end of file58\ No newline at end of file
59# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
6060
=== modified file 'event_project/wizard/event_project_retro.py'
--- event_project/wizard/event_project_retro.py 2011-01-14 00:11:01 +0000
+++ event_project/wizard/event_project_retro.py 2012-10-02 11:29:53 +0000
@@ -80,4 +80,4 @@
8080
81event_project()81event_project()
8282
83# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
84\ No newline at end of file83\ No newline at end of file
84# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
8585
=== modified file 'hr_attendance/wizard/hr_attendance_bymonth.py'
--- hr_attendance/wizard/hr_attendance_bymonth.py 2011-12-16 05:52:38 +0000
+++ hr_attendance/wizard/hr_attendance_bymonth.py 2012-10-02 11:29:53 +0000
@@ -50,4 +50,4 @@
5050
51hr_attendance_bymonth()51hr_attendance_bymonth()
5252
53# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
54\ No newline at end of file53\ No newline at end of file
54# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
5555
=== modified file 'hr_attendance/wizard/hr_attendance_byweek.py'
--- hr_attendance/wizard/hr_attendance_byweek.py 2011-01-14 00:11:01 +0000
+++ hr_attendance/wizard/hr_attendance_byweek.py 2012-10-02 11:29:53 +0000
@@ -48,4 +48,4 @@
4848
49hr_attendance_byweek()49hr_attendance_byweek()
5050
51# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
52\ No newline at end of file51\ No newline at end of file
52# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
5353
=== modified file 'hr_attendance/wizard/hr_attendance_error.py'
--- hr_attendance/wizard/hr_attendance_error.py 2012-07-25 12:13:54 +0000
+++ hr_attendance/wizard/hr_attendance_error.py 2012-10-02 11:29:53 +0000
@@ -66,4 +66,4 @@
6666
67hr_attendance_error()67hr_attendance_error()
6868
69# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
70\ No newline at end of file69\ No newline at end of file
70# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
7171
=== modified file 'hr_evaluation/hr_evaluation.py'
--- hr_evaluation/hr_evaluation.py 2012-09-27 04:10:11 +0000
+++ hr_evaluation/hr_evaluation.py 2012-10-02 11:29:53 +0000
@@ -43,6 +43,7 @@
43 'month_next': 12,43 'month_next': 12,
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),
45 }45 }
46
46hr_evaluation_plan()47hr_evaluation_plan()
4748
48class hr_evaluation_plan_phase(osv.osv):49class hr_evaluation_plan_phase(osv.osv):
@@ -95,6 +96,7 @@
9596
96 '''),97 '''),
97 }98 }
99
98hr_evaluation_plan_phase()100hr_evaluation_plan_phase()
99101
100class hr_employee(osv.osv):102class hr_employee(osv.osv):
@@ -210,8 +212,6 @@
210 elif phase.action == "self":212 elif phase.action == "self":
211 children = [evaluation.employee_id]213 children = [evaluation.employee_id]
212 for child in children:214 for child in children:
213# if not child.user_id:
214# continue
215215
216 int_id = hr_eval_inter_obj.create(cr, uid, {216 int_id = hr_eval_inter_obj.create(cr, uid, {
217 'evaluation_id': evaluation.id,217 'evaluation_id': evaluation.id,
@@ -250,7 +250,7 @@
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."))
251 return True251 return True
252252
253 def button_done(self,cr, uid, ids, context=None):253 def button_done(self, cr, uid, ids, context=None):
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)
255 return True255 return True
256256
257257
=== modified file 'hr_payroll/report/report_contribution_register.py'
--- hr_payroll/report/report_contribution_register.py 2011-06-29 09:20:32 +0000
+++ hr_payroll/report/report_contribution_register.py 2012-10-02 11:29:53 +0000
@@ -72,4 +72,4 @@
7272
73report_sxw.report_sxw('report.contribution.register.lines', 'hr.contribution.register', 'hr_payroll/report/report_contribution_register.rml', parser=contribution_register_report)73report_sxw.report_sxw('report.contribution.register.lines', 'hr.contribution.register', 'hr_payroll/report/report_contribution_register.rml', parser=contribution_register_report)
7474
75# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
76\ No newline at end of file75\ No newline at end of file
76# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
7777
=== modified file 'hr_payroll/report/report_payslip.py'
--- hr_payroll/report/report_payslip.py 2011-12-19 16:54:40 +0000
+++ hr_payroll/report/report_payslip.py 2012-10-02 11:29:53 +0000
@@ -46,4 +46,4 @@
4646
47report_sxw.report_sxw('report.payslip', 'hr.payslip', 'hr_payroll/report/report_payslip.rml', parser=payslip_report)47report_sxw.report_sxw('report.payslip', 'hr.payslip', 'hr_payroll/report/report_payslip.rml', parser=payslip_report)
4848
49# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
50\ No newline at end of file49\ No newline at end of file
50# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
5151
=== modified file 'hr_payroll/report/report_payslip_details.py'
--- hr_payroll/report/report_payslip_details.py 2012-07-19 12:03:11 +0000
+++ hr_payroll/report/report_payslip_details.py 2012-10-02 11:29:53 +0000
@@ -116,4 +116,4 @@
116116
117report_sxw.report_sxw('report.paylip.details', 'hr.payslip', 'hr_payroll/report/report_payslip_details.rml', parser=payslip_details_report)117report_sxw.report_sxw('report.paylip.details', 'hr.payslip', 'hr_payroll/report/report_payslip_details.rml', parser=payslip_details_report)
118118
119# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
120\ No newline at end of file119\ No newline at end of file
120# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
121121
=== modified file 'hr_payroll_account/__init__.py'
--- hr_payroll_account/__init__.py 2011-09-15 05:45:39 +0000
+++ hr_payroll_account/__init__.py 2012-10-02 11:29:53 +0000
@@ -23,4 +23,4 @@
23import hr_payroll_account23import hr_payroll_account
24import wizard24import wizard
2525
26# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
27\ No newline at end of file26\ No newline at end of file
27# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2828
=== modified file 'hr_payroll_account/wizard/__init__.py'
--- hr_payroll_account/wizard/__init__.py 2011-09-15 05:45:39 +0000
+++ hr_payroll_account/wizard/__init__.py 2012-10-02 11:29:53 +0000
@@ -22,4 +22,4 @@
2222
23import hr_payroll_payslips_by_employees23import hr_payroll_payslips_by_employees
2424
25# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
26\ No newline at end of file25\ No newline at end of file
26# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2727
=== modified file 'hr_payroll_account/wizard/hr_payroll_payslips_by_employees.py'
--- hr_payroll_account/wizard/hr_payroll_payslips_by_employees.py 2012-08-16 10:42:15 +0000
+++ hr_payroll_account/wizard/hr_payroll_payslips_by_employees.py 2012-10-02 11:29:53 +0000
@@ -38,4 +38,4 @@
3838
39hr_payslip_employees()39hr_payslip_employees()
4040
41# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
42\ No newline at end of file41\ No newline at end of file
42# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4343
=== modified file 'hr_recruitment/hr_recruitment.py'
--- hr_recruitment/hr_recruitment.py 2012-09-16 15:18:26 +0000
+++ hr_recruitment/hr_recruitment.py 2012-10-02 11:29:53 +0000
@@ -243,7 +243,7 @@
243 'stage_id': _read_group_stage_ids243 'stage_id': _read_group_stage_ids
244 }244 }
245245
246 def onchange_job(self,cr, uid, ids, job, context=None):246 def onchange_job(self, cr, uid, ids, job, context=None):
247 result = {}247 result = {}
248248
249 if job:249 if job:
@@ -494,7 +494,6 @@
494 message = _("Applicant has been <b>created</b>.")494 message = _("Applicant has been <b>created</b>.")
495 return self.message_post(cr, uid, ids, body=message, context=context)495 return self.message_post(cr, uid, ids, body=message, context=context)
496496
497
498class hr_job(osv.osv):497class hr_job(osv.osv):
499 _inherit = "hr.job"498 _inherit = "hr.job"
500 _name = "hr.job"499 _name = "hr.job"
@@ -505,7 +504,6 @@
505 help="Email alias for this job position. New emails will automatically "504 help="Email alias for this job position. New emails will automatically "
506 "create new applicants for this job position."),505 "create new applicants for this job position."),
507 }506 }
508
509 _defaults = {507 _defaults = {
510 'alias_domain': False, # always hide alias during creation508 'alias_domain': False, # always hide alias during creation
511 }509 }
@@ -548,12 +546,12 @@
548 datas['model'] = 'survey.print'546 datas['model'] = 'survey.print'
549 context.update({'response_id': [0], 'response_no': 0,})547 context.update({'response_id': [0], 'response_no': 0,})
550 return {548 return {
551 'type': 'ir.actions.report.xml',549 'type': 'ir.actions.report.xml',
552 'report_name': 'survey.form',550 'report_name': 'survey.form',
553 'datas': datas,551 'datas': datas,
554 'context' : context,552 'context' : context,
555 'nodestroy':True,553 'nodestroy':True,
556 }554 }
557555
558class applicant_category(osv.osv):556class applicant_category(osv.osv):
559 """ Category of applicant """557 """ Category of applicant """
560558
=== modified file 'hr_recruitment/wizard/hr_recruitment_create_partner_job.py'
--- hr_recruitment/wizard/hr_recruitment_create_partner_job.py 2012-08-07 11:31:37 +0000
+++ hr_recruitment/wizard/hr_recruitment_create_partner_job.py 2012-10-02 11:29:53 +0000
@@ -29,7 +29,7 @@
29 'close': fields.boolean('Close job request'),29 'close': fields.boolean('Close job request'),
30 }30 }
3131
32 def view_init(self, cr , uid , fields_list, context=None):32 def view_init(self, cr, uid, fields_list, context=None):
33 case_obj = self.pool.get('hr.applicant')33 case_obj = self.pool.get('hr.applicant')
34 if context is None:34 if context is None:
35 context = {}35 context = {}
3636
=== modified file 'hr_recruitment/wizard/hr_recruitment_employee_hired.py'
--- hr_recruitment/wizard/hr_recruitment_employee_hired.py 2011-11-17 10:53:01 +0000
+++ hr_recruitment/wizard/hr_recruitment_employee_hired.py 2012-10-02 11:29:53 +0000
@@ -26,7 +26,7 @@
26 _name = 'hired.employee'26 _name = 'hired.employee'
27 _description = 'Create Employee'27 _description = 'Create Employee'
2828
29 def case_close(self, cr, uid,ids, context=None):29 def case_close(self, cr, uid, ids, context=None):
30 """30 """
31 @param self: The object pointer31 @param self: The object pointer
32 @param cr: the current row, from the database cursor,32 @param cr: the current row, from the database cursor,
@@ -39,7 +39,7 @@
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',[]))
40 return {}40 return {}
4141
42 def case_close_with_emp(self, cr, uid,ids, context=None):42 def case_close_with_emp(self, cr, uid, ids, context=None):
43 """43 """
44 @param self: The object pointer44 @param self: The object pointer
45 @param cr: the current row, from the database cursor,45 @param cr: the current row, from the database cursor,
4646
=== modified file 'hr_timesheet_invoice/hr_timesheet_invoice.py'
--- hr_timesheet_invoice/hr_timesheet_invoice.py 2012-09-07 07:31:52 +0000
+++ hr_timesheet_invoice/hr_timesheet_invoice.py 2012-10-02 11:29:53 +0000
@@ -84,7 +84,7 @@
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]
85 return res85 return res
8686
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):
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)
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)
90 pricelist = part.property_product_pricelist and part.property_product_pricelist.id or False90 pricelist = part.property_product_pricelist and part.property_product_pricelist.id or False
@@ -199,6 +199,7 @@
199199
200hr_analytic_timesheet()200hr_analytic_timesheet()
201201
202
202class account_invoice(osv.osv):203class account_invoice(osv.osv):
203 _inherit = "account.invoice"204 _inherit = "account.invoice"
204205
@@ -218,6 +219,7 @@
218219
219account_invoice()220account_invoice()
220221
222
221class account_move_line(osv.osv):223class account_move_line(osv.osv):
222 _inherit = "account.move.line"224 _inherit = "account.move.line"
223225
@@ -234,4 +236,3 @@
234account_move_line()236account_move_line()
235237
236# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:238# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
237
238239
=== modified file 'hr_timesheet_invoice/report/account_analytic_profit.py'
--- hr_timesheet_invoice/report/account_analytic_profit.py 2011-01-14 00:11:01 +0000
+++ hr_timesheet_invoice/report/account_analytic_profit.py 2012-10-02 11:29:53 +0000
@@ -120,4 +120,4 @@
120120
121report_sxw.report_sxw('report.account.analytic.profit', 'account.analytic.line', 'addons/hr_timesheet_invoice/report/account_analytic_profit.rml', parser=account_analytic_profit)121report_sxw.report_sxw('report.account.analytic.profit', 'account.analytic.line', 'addons/hr_timesheet_invoice/report/account_analytic_profit.rml', parser=account_analytic_profit)
122122
123# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
124\ No newline at end of file123\ No newline at end of file
124# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
125125
=== modified file 'hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py'
--- hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py 2012-09-29 13:29:07 +0000
+++ hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py 2012-10-02 11:29:53 +0000
@@ -38,7 +38,7 @@
38 # 'price': boolean38 # 'price': boolean
39 # 'product': many2one id39 # 'product': many2one id
40 # }40 # }
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):
42 analytic_account_obj = self.pool.get('account.analytic.account')42 analytic_account_obj = self.pool.get('account.analytic.account')
43 res_partner_obj = self.pool.get('res.partner')43 res_partner_obj = self.pool.get('res.partner')
44 account_payment_term_obj = self.pool.get('account.payment.term')44 account_payment_term_obj = self.pool.get('account.payment.term')
@@ -52,6 +52,8 @@
52 invoices = []52 invoices = []
53 if context is None:53 if context is None:
54 context = {}54 context = {}
55 if data is None:
56 data = {}
5557
56 account_ids = {}58 account_ids = {}
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):
@@ -86,14 +88,14 @@
86 'date_due': date_due,88 'date_due': date_due,
87 'fiscal_position': account.partner_id.property_account_position.id89 'fiscal_position': account.partner_id.property_account_position.id
88 }90 }
89 91
90 context2 = context.copy()92 context2 = context.copy()
91 context2['lang'] = partner.lang93 context2['lang'] = partner.lang
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
93 context2['force_company'] = curr_invoice['company_id']95 context2['force_company'] = curr_invoice['company_id']
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)
95 context2['company_id'] = curr_invoice['company_id']97 context2['company_id'] = curr_invoice['company_id']
96 98
97 last_invoice = invoice_obj.create(cr, uid, curr_invoice, context=context2)99 last_invoice = invoice_obj.create(cr, uid, curr_invoice, context=context2)
98 invoices.append(last_invoice)100 invoices.append(last_invoice)
99101
100102
=== modified file 'hr_timesheet_sheet/hr_timesheet_sheet.py'
--- hr_timesheet_sheet/hr_timesheet_sheet.py 2012-09-27 19:10:59 +0000
+++ hr_timesheet_sheet/hr_timesheet_sheet.py 2012-10-02 11:29:53 +0000
@@ -358,7 +358,7 @@
358 'department_id':fields.many2one('hr.department','Department'),358 'department_id':fields.many2one('hr.department','Department'),
359 }359 }
360360
361 def _default_date_from(self,cr, uid, context=None):361 def _default_date_from(self, cr, uid, context=None):
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)
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'
364 if r=='month':364 if r=='month':
@@ -369,7 +369,7 @@
369 return time.strftime('%Y-01-01')369 return time.strftime('%Y-01-01')
370 return time.strftime('%Y-%m-%d')370 return time.strftime('%Y-%m-%d')
371371
372 def _default_date_to(self,cr, uid, context=None):372 def _default_date_to(self, cr, uid, context=None):
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)
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'
375 if r=='month':375 if r=='month':
376376
=== modified file 'hr_timesheet_sheet/wizard/hr_timesheet_current.py'
--- hr_timesheet_sheet/wizard/hr_timesheet_current.py 2012-08-07 11:31:37 +0000
+++ hr_timesheet_sheet/wizard/hr_timesheet_current.py 2012-10-02 11:29:53 +0000
@@ -61,4 +61,4 @@
6161
62hr_timesheet_current_open()62hr_timesheet_current_open()
6363
64# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
65\ No newline at end of file64\ No newline at end of file
65# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
6666
=== modified file 'idea/idea.py'
--- idea/idea.py 2012-08-17 10:03:02 +0000
+++ idea/idea.py 2012-10-02 11:29:53 +0000
@@ -39,6 +39,7 @@
39 ('name', 'unique(name)', 'The name of the category must be unique' )39 ('name', 'unique(name)', 'The name of the category must be unique' )
40 ]40 ]
41 _order = 'name asc'41 _order = 'name asc'
42
42idea_category()43idea_category()
4344
44class idea_idea(osv.osv):45class idea_idea(osv.osv):
@@ -65,24 +66,24 @@
65 }66 }
66 _order = 'name asc'67 _order = 'name asc'
6768
68 def idea_cancel(self, cr, uid, ids, context={}):69 def idea_cancel(self, cr, uid, ids, context=None):
69 self.write(cr, uid, ids, { 'state': 'cancel' })70 self.write(cr, uid, ids, { 'state': 'cancel' })
70 self.message_post(cr, uid, ids, body=_('Idea canceled.'), context=context)71 self.message_post(cr, uid, ids, body=_('Idea canceled.'), context=context)
71 return True72 return True
7273
73 def idea_open(self, cr, uid, ids, context={}):74 def idea_open(self, cr, uid, ids, context=None):
74 self.write(cr, uid, ids, { 'state': 'open'})75 self.write(cr, uid, ids, { 'state': 'open'})
75 self.message_post(cr, uid, ids, body=_('Idea accepted.'), context=context)76 self.message_post(cr, uid, ids, body=_('Idea accepted.'), context=context)
76 return True77 return True
7778
78 def idea_close(self, cr, uid, ids, context={}):79 def idea_close(self, cr, uid, ids, context=None):
79 self.message_post(cr, uid, ids, body=_('Idea done.'), context=context)80 self.message_post(cr, uid, ids, body=_('Idea done.'), context=context)
80 self.write(cr, uid, ids, { 'state': 'close' })81 self.write(cr, uid, ids, { 'state': 'close' })
81 return True82 return True
8283
83 def idea_draft(self, cr, uid, ids, context={}):84 def idea_draft(self, cr, uid, ids, context=None):
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)
85 self.write(cr, uid, ids, { 'state': 'draft' })86 self.write(cr, uid, ids, { 'state': 'draft' })
86 return True87 return True
88
87idea_idea()89idea_idea()
88
8990
=== modified file 'import_base/import_framework.py'
--- import_base/import_framework.py 2012-09-13 09:37:17 +0000
+++ import_base/import_framework.py 2012-10-02 11:29:53 +0000
@@ -227,7 +227,7 @@
227 return map227 return map
228228
229229
230 def _fields_mapp(self,dict_sugar, openerp_dict, table):230 def _fields_mapp(self, dict_sugar, openerp_dict, table):
231 """231 """
232 call all the mapper and transform data232 call all the mapper and transform data
233 to be compatible with import_data233 to be compatible with import_data
234234
=== modified file 'import_sugarcrm/import_sugarcrm.py'
--- import_sugarcrm/import_sugarcrm.py 2012-09-07 11:44:36 +0000
+++ import_sugarcrm/import_sugarcrm.py 2012-10-02 11:29:53 +0000
@@ -253,7 +253,7 @@
253 val['datas_fname'] = Filename253 val['datas_fname'] = Filename
254 return val 254 return val
255 255
256 def get_history_mapping(self): 256 def get_history_mapping(self):
257 return { 257 return {
258 'model' : 'ir.attachment',258 'model' : 'ir.attachment',
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],
@@ -301,7 +301,7 @@
301 val['email_from'] = partner_email301 val['email_from'] = partner_email
302 return val302 return val
303 303
304 def get_crm_claim_mapping(self): 304 def get_crm_claim_mapping(self):
305 return { 305 return {
306 'model' : 'crm.claim',306 'model' : 'crm.claim',
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],
@@ -602,7 +602,7 @@
602 partner_contact_email = address.email602 partner_contact_email = address.email
603 return partner_contact_id, partner_contact_email603 return partner_contact_id, partner_contact_email
604604
605 def import_opp(self, val): 605 def import_opp(self, val):
606 partner_contact_id, partner_contact_email = self.import_opportunity_contact(val)606 partner_contact_id, partner_contact_email = self.import_opportunity_contact(val)
607 val['partner_address_id/id'] = partner_contact_id607 val['partner_address_id/id'] = partner_contact_id
608 val['email_from'] = partner_contact_email608 val['email_from'] = partner_contact_email
609609
=== modified file 'l10n_be/__init__.py'
--- l10n_be/__init__.py 2012-09-13 09:28:14 +0000
+++ l10n_be/__init__.py 2012-10-02 11:29:53 +0000
@@ -21,4 +21,4 @@
2121
22import wizard22import wizard
2323
24# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
25\ No newline at end of file24\ No newline at end of file
25# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2626
=== modified file 'l10n_be_coda/l10n_be_coda.py'
--- l10n_be_coda/l10n_be_coda.py 2012-09-25 07:32:01 +0000
+++ l10n_be_coda/l10n_be_coda.py 2012-10-02 11:29:53 +0000
@@ -171,6 +171,7 @@
171 'parent_id': fields.many2one('account.coda.trans.type', 'Parent'),171 'parent_id': fields.many2one('account.coda.trans.type', 'Parent'),
172 'description': fields.text('Description', translate=True),172 'description': fields.text('Description', translate=True),
173 }173 }
174
174account_coda_trans_type()175account_coda_trans_type()
175176
176class account_coda_trans_code(osv.osv):177class account_coda_trans_code(osv.osv):
@@ -187,6 +188,7 @@
187 'description': fields.char('Description', size=128, translate=True, select=2),188 'description': fields.char('Description', size=128, translate=True, select=2),
188 'comment': fields.text('Comment', translate=True),189 'comment': fields.text('Comment', translate=True),
189 }190 }
191
190account_coda_trans_code()192account_coda_trans_code()
191193
192class account_coda_trans_category(osv.osv):194class account_coda_trans_category(osv.osv):
@@ -197,6 +199,7 @@
197 'category': fields.char('Transaction Category', size=3, required=True),199 'category': fields.char('Transaction Category', size=3, required=True),
198 'description': fields.char('Description', size=256, translate=True),200 'description': fields.char('Description', size=256, translate=True),
199 }201 }
202
200account_coda_trans_category()203account_coda_trans_category()
201204
202class account_coda_comm_type(osv.osv):205class account_coda_comm_type(osv.osv):
@@ -209,14 +212,17 @@
209 }212 }
210 _sql_constraints = [213 _sql_constraints = [
211 ('code_uniq', 'unique (code)','The Structured Communication Code must be unique !')214 ('code_uniq', 'unique (code)','The Structured Communication Code must be unique !')
212 ]215 ]
216
213account_coda_comm_type()217account_coda_comm_type()
214218
215class coda_bank_statement(osv.osv):219class coda_bank_statement(osv.osv):
216 _name = 'coda.bank.statement'220 _name = 'coda.bank.statement'
217 _description = 'CODA Bank Statement'221 _description = 'CODA Bank Statement'
218222
219 def _default_journal_id(self, cr, uid, context={}):223 def _default_journal_id(self, cr, uid, context=None):
224 if context is None:
225 context = {}
220 if context.get('journal_id', False):226 if context.get('journal_id', False):
221 return context['journal_id']227 return context['journal_id']
222 return False228 return False
@@ -232,7 +238,7 @@
232 res[r] = round(res[r], 2)238 res[r] = round(res[r], 2)
233 return res239 return res
234240
235 def _get_period(self, cr, uid, context={}):241 def _get_period(self, cr, uid, context=None):
236 periods = self.pool.get('account.period').find(cr, uid)242 periods = self.pool.get('account.period').find(cr, uid)
237 if periods:243 if periods:
238 return periods[0]244 return periods[0]
@@ -404,6 +410,7 @@
404 _columns = {410 _columns = {
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),
406 }412 }
413
407account_bank_statement_line_global()414account_bank_statement_line_global()
408415
409# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:416# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
410417
=== modified file 'l10n_be_invoice_bba/invoice.py'
--- l10n_be_invoice_bba/invoice.py 2012-07-18 12:26:36 +0000
+++ l10n_be_invoice_bba/invoice.py 2012-10-02 11:29:53 +0000
@@ -2,9 +2,9 @@
2##############################################################################2##############################################################################
3#3#
4# OpenERP, Open Source Management Solution4# OpenERP, Open Source Management Solution
5# 5#
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.
7# 7#
8# This program is free software: you can redistribute it and/or modify8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the10# published by the Free Software Foundation, either version 3 of the
@@ -36,23 +36,23 @@
36 _inherit = 'account.invoice'36 _inherit = 'account.invoice'
3737
38 def _get_reference_type(self, cursor, user, context=None):38 def _get_reference_type(self, cursor, user, context=None):
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' """
40 res = super(account_invoice, self)._get_reference_type(cursor, user,40 res = super(account_invoice, self)._get_reference_type(cursor, user,
41 context=context)41 context=context)
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')
43 res.append(('bba', 'BBA Structured Communication'))43 res.append(('bba', 'BBA Structured Communication'))
44 #l_logger.warning('reference_type = %s' %res ) 44 #l_logger.warning('reference_type = %s' %res )
45 return res45 return res
4646
47 def check_bbacomm(self, val):47 def check_bbacomm(self, val):
48 supported_chars = '0-9+*/ '48 supported_chars = '0-9+*/ '
49 pattern = re.compile('[^' + supported_chars + ']')49 pattern = re.compile('[^' + supported_chars + ']')
50 if pattern.findall(val or ''):50 if pattern.findall(val or ''):
51 return False 51 return False
52 bbacomm = re.sub('\D', '', val or '')52 bbacomm = re.sub('\D', '', val or '')
53 if len(bbacomm) == 12:53 if len(bbacomm) == 12:
54 base = int(bbacomm[:10])54 base = int(bbacomm[:10])
55 mod = base % 97 or 97 55 mod = base % 97 or 97
56 if mod == int(bbacomm[-2:]):56 if mod == int(bbacomm[-2:]):
57 return True57 return True
58 return False58 return False
@@ -64,29 +64,29 @@
64 return True64 return True
6565
66 def onchange_partner_id(self, cr, uid, ids, type, partner_id,66 def onchange_partner_id(self, cr, uid, ids, type, partner_id,
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):
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,
69 date_invoice, payment_term, partner_bank_id, company_id)69 date_invoice, payment_term, partner_bank_id, company_id)
70# reference_type = self.default_get(cr, uid, ['reference_type'])['reference_type']70# reference_type = self.default_get(cr, uid, ['reference_type'])['reference_type']
71# _logger.warning('partner_id %s' % partner_id)71# _logger.warning('partner_id %s' % partner_id)
72 reference = False72 reference = False
73 reference_type = 'none'73 reference_type = 'none'
74 if partner_id: 74 if partner_id:
75 if (type == 'out_invoice'):75 if (type == 'out_invoice'):
76 reference_type = self.pool.get('res.partner').browse(cr, uid, partner_id).out_inv_comm_type76 reference_type = self.pool.get('res.partner').browse(cr, uid, partner_id).out_inv_comm_type
77 if reference_type:77 if reference_type:
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']
79 res_update = { 79 res_update = {
80 'reference_type': reference_type or 'none',80 'reference_type': reference_type or 'none',
81 'reference': reference,81 'reference': reference,
82 }82 }
83 result['value'].update(res_update)83 result['value'].update(res_update)
84 return result 84 return result
8585
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):
87 partner_obj = self.pool.get('res.partner')87 partner_obj = self.pool.get('res.partner')
88 reference = reference or ''88 reference = reference or ''
89 algorithm = False89 algorithm = False
90 if partner_id:90 if partner_id:
91 algorithm = partner_obj.browse(cr, uid, partner_id, context=context).out_inv_comm_algorithm91 algorithm = partner_obj.browse(cr, uid, partner_id, context=context).out_inv_comm_algorithm
92 algorithm = algorithm or 'random'92 algorithm = algorithm or 'random'
@@ -97,7 +97,7 @@
97 doy = time.strftime('%j')97 doy = time.strftime('%j')
98 year = time.strftime('%Y')98 year = time.strftime('%Y')
99 seq = '001'99 seq = '001'
100 seq_ids = self.search(cr, uid, 100 seq_ids = self.search(cr, uid,
101 [('type', '=', 'out_invoice'), ('reference_type', '=', 'bba'),101 [('type', '=', 'out_invoice'), ('reference_type', '=', 'bba'),
102 ('reference', 'like', '+++%s/%s/%%' % (doy, year))], order='reference')102 ('reference', 'like', '+++%s/%s/%%' % (doy, year))], order='reference')
103 if seq_ids:103 if seq_ids:
@@ -110,7 +110,7 @@
110 '\nPlease create manually a unique BBA Structured Communication.'))110 '\nPlease create manually a unique BBA Structured Communication.'))
111 bbacomm = doy + year + seq111 bbacomm = doy + year + seq
112 base = int(bbacomm)112 base = int(bbacomm)
113 mod = base % 97 or 97 113 mod = base % 97 or 97
114 reference = '+++%s/%s/%s%02d+++' % (doy, year, seq, mod)114 reference = '+++%s/%s/%s%02d+++' % (doy, year, seq, mod)
115 elif algorithm == 'partner_ref':115 elif algorithm == 'partner_ref':
116 if not self.check_bbacomm(reference):116 if not self.check_bbacomm(reference):
@@ -119,13 +119,13 @@
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):
120 raise osv.except_osv(_('Warning!'),120 raise osv.except_osv(_('Warning!'),
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!' \
122 '\nPlease correct the Partner record.')) 122 '\nPlease correct the Partner record.'))
123 else:123 else:
124 partner_ref_nr = partner_ref_nr.ljust(7, '0')124 partner_ref_nr = partner_ref_nr.ljust(7, '0')
125 seq = '001'125 seq = '001'
126 seq_ids = self.search(cr, uid, 126 seq_ids = self.search(cr, uid,
127 [('type', '=', 'out_invoice'), ('reference_type', '=', 'bba'),127 [('type', '=', 'out_invoice'), ('reference_type', '=', 'bba'),
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')
129 if seq_ids:129 if seq_ids:
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])
131 if prev_seq < 999:131 if prev_seq < 999:
@@ -133,10 +133,10 @@
133 else:133 else:
134 raise osv.except_osv(_('Warning!'),134 raise osv.except_osv(_('Warning!'),
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!' \
136 '\nPlease create manually a unique BBA Structured Communication.')) 136 '\nPlease create manually a unique BBA Structured Communication.'))
137 bbacomm = partner_ref_nr + seq137 bbacomm = partner_ref_nr + seq
138 base = int(bbacomm)138 base = int(bbacomm)
139 mod = base % 97 or 97 139 mod = base % 97 or 97
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)
141 elif algorithm == 'random':141 elif algorithm == 'random':
142 if not self.check_bbacomm(reference):142 if not self.check_bbacomm(reference):
@@ -144,67 +144,66 @@
144 bbacomm = str(base).rjust(7, '0')144 bbacomm = str(base).rjust(7, '0')
145 base = int(bbacomm)145 base = int(bbacomm)
146 mod = base % 97 or 97146 mod = base % 97 or 97
147 mod = str(mod).rjust(2, '0') 147 mod = str(mod).rjust(2, '0')
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)
149 else:149 else:
150 raise osv.except_osv(_('Error!'),150 raise osv.except_osv(_('Error!'),
151 _("Unsupported Structured Communication Type Algorithm '%s' !" \151 _("Unsupported Structured Communication Type Algorithm '%s' !" \
152 "\nPlease contact your OpenERP support channel.") % algorithm) 152 "\nPlease contact your OpenERP support channel.") % algorithm)
153 return {'value': {'reference': reference}} 153 return {'value': {'reference': reference}}
154 154
155 def create(self, cr, uid, vals, context=None):155 def create(self, cr, uid, vals, context=None):
156 if vals.has_key('reference_type'):156 if vals.has_key('reference_type'):
157 reference_type = vals['reference_type']157 reference_type = vals['reference_type']
158 if reference_type == 'bba': 158 if reference_type == 'bba':
159 if vals.has_key('reference'):159 if vals.has_key('reference'):
160 bbacomm = vals['reference']160 bbacomm = vals['reference']
161 else:161 else:
162 raise osv.except_osv(_('Warning!'),162 raise osv.except_osv(_('Warning!'),
163 _('Empty BBA Structured Communication!' \163 _('Empty BBA Structured Communication!' \
164 '\nPlease fill in a unique BBA Structured Communication.')) 164 '\nPlease fill in a unique BBA Structured Communication.'))
165 if self.check_bbacomm(bbacomm):165 if self.check_bbacomm(bbacomm):
166 reference = re.sub('\D', '', bbacomm)166 reference = re.sub('\D', '', bbacomm)
167 vals['reference'] = '+++' + reference[0:3] + '/' + reference[3:7] + '/' + reference[7:] + '+++' 167 vals['reference'] = '+++' + reference[0:3] + '/' + reference[3:7] + '/' + reference[7:] + '+++'
168 same_ids = self.search(cr, uid, 168 same_ids = self.search(cr, uid,
169 [('type', '=', 'out_invoice'), ('reference_type', '=', 'bba'),169 [('type', '=', 'out_invoice'), ('reference_type', '=', 'bba'),
170 ('reference', '=', vals['reference'])])170 ('reference', '=', vals['reference'])])
171 if same_ids:171 if same_ids:
172 raise osv.except_osv(_('Warning!'),172 raise osv.except_osv(_('Warning!'),
173 _('The BBA Structured Communication has already been used!' \173 _('The BBA Structured Communication has already been used!' \
174 '\nPlease create manually a unique BBA Structured Communication.')) 174 '\nPlease create manually a unique BBA Structured Communication.'))
175 return super(account_invoice, self).create(cr, uid, vals, context=context) 175 return super(account_invoice, self).create(cr, uid, vals, context=context)
176176
177 def write(self, cr, uid, ids, vals, context={}):177 def write(self, cr, uid, ids, vals, context=None):
178 if isinstance(ids, (int, long)):178 if isinstance(ids, (int, long)):
179 ids = [ids]179 ids = [ids]
180 for inv in self.browse(cr, uid, ids, context): 180 for inv in self.browse(cr, uid, ids, context):
181 if vals.has_key('reference_type'):181 if vals.has_key('reference_type'):
182 reference_type = vals['reference_type']182 reference_type = vals['reference_type']
183 else: 183 else:
184 reference_type = inv.reference_type or ''184 reference_type = inv.reference_type or ''
185 if reference_type == 'bba': 185 if reference_type == 'bba':
186 if vals.has_key('reference'):186 if vals.has_key('reference'):
187 bbacomm = vals['reference']187 bbacomm = vals['reference']
188 else:188 else:
189 bbacomm = inv.reference or ''189 bbacomm = inv.reference or ''
190 if self.check_bbacomm(bbacomm):190 if self.check_bbacomm(bbacomm):
191 reference = re.sub('\D', '', bbacomm)191 reference = re.sub('\D', '', bbacomm)
192 vals['reference'] = '+++' + reference[0:3] + '/' + reference[3:7] + '/' + reference[7:] + '+++' 192 vals['reference'] = '+++' + reference[0:3] + '/' + reference[3:7] + '/' + reference[7:] + '+++'
193 same_ids = self.search(cr, uid, 193 same_ids = self.search(cr, uid,
194 [('id', '!=', inv.id), ('type', '=', 'out_invoice'), 194 [('id', '!=', inv.id), ('type', '=', 'out_invoice'),
195 ('reference_type', '=', 'bba'), ('reference', '=', vals['reference'])])195 ('reference_type', '=', 'bba'), ('reference', '=', vals['reference'])])
196 if same_ids:196 if same_ids:
197 raise osv.except_osv(_('Warning!'),197 raise osv.except_osv(_('Warning!'),
198 _('The BBA Structured Communication has already been used!' \198 _('The BBA Structured Communication has already been used!' \
199 '\nPlease create manually a unique BBA Structured Communication.')) 199 '\nPlease create manually a unique BBA Structured Communication.'))
200 return super(account_invoice, self).write(cr, uid, ids, vals, context) 200 return super(account_invoice, self).write(cr, uid, ids, vals, context)
201201
202 _columns = {202 _columns = {
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."),
204 'reference_type': fields.selection(_get_reference_type, 'Communication Type',204 'reference_type': fields.selection(_get_reference_type, 'Communication Type',
205 required=True),205 required=True),
206 }206 }
207
208 _constraints = [207 _constraints = [
209 (_check_communication, 'Invalid BBA Structured Communication !', ['Communication']),208 (_check_communication, 'Invalid BBA Structured Communication !', ['Communication']),
210 ]209 ]
211210
=== modified file 'l10n_br/l10n_br.py'
--- l10n_br/l10n_br.py 2011-10-03 13:32:03 +0000
+++ l10n_br/l10n_br.py 2012-10-02 11:29:53 +0000
@@ -81,4 +81,4 @@
81 81
82l10n_br_account_cst()82l10n_br_account_cst()
8383
84# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
85\ No newline at end of file84\ No newline at end of file
85# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
8686
=== modified file 'l10n_ch/partner.py'
--- l10n_ch/partner.py 2011-09-16 14:32:55 +0000
+++ l10n_ch/partner.py 2012-10-02 11:29:53 +0000
@@ -30,4 +30,4 @@
30 }30 }
3131
32res_partner()32res_partner()
33# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
34\ No newline at end of file33\ No newline at end of file
34# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3535
=== modified file 'l10n_ch/payment.py'
--- l10n_ch/payment.py 2011-01-14 12:41:54 +0000
+++ l10n_ch/payment.py 2012-10-02 11:29:53 +0000
@@ -24,7 +24,7 @@
24class payment_order(osv.osv):24class payment_order(osv.osv):
25 _inherit = 'payment.order'25 _inherit = 'payment.order'
2626
27 def get_wizard(self,mode):27 def get_wizard(self, mode):
28 if mode == 'dta':28 if mode == 'dta':
29 return 'l10n_ch', 'action_dta_create'29 return 'l10n_ch', 'action_dta_create'
3030
3131
=== modified file 'l10n_ch/report/report_webkit_html.py'
--- l10n_ch/report/report_webkit_html.py 2012-08-07 11:06:16 +0000
+++ l10n_ch/report/report_webkit_html.py 2012-10-02 11:29:53 +0000
@@ -76,7 +76,7 @@
76 self._check(ids)76 self._check(ids)
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)
7878
79 def police_absolute_path(self, inner_path) :79 def police_absolute_path(self, inner_path):
80 """Will get the ocrb police absolute path"""80 """Will get the ocrb police absolute path"""
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))
82 return path82 return path
8383
=== modified file 'l10n_ch/wizard/create_dta.py'
--- l10n_ch/wizard/create_dta.py 2012-08-07 11:31:37 +0000
+++ l10n_ch/wizard/create_dta.py 2012-10-02 11:29:53 +0000
@@ -41,7 +41,7 @@
41 (u'ä','a'),41 (u'ä','a'),
42]42]
4343
44def _u2a(text) :44def _u2a(text):
45 """Tries to convert unicode charactere to asci equivalence"""45 """Tries to convert unicode charactere to asci equivalence"""
46 if not text : return ""46 if not text : return ""
47 txt = ""47 txt = ""
4848
=== modified file 'l10n_fr/l10n_fr.py'
--- l10n_fr/l10n_fr.py 2012-04-13 10:39:57 +0000
+++ l10n_fr/l10n_fr.py 2012-10-02 11:29:53 +0000
@@ -29,7 +29,6 @@
29 'name': fields.char('Name', size=128),29 'name': fields.char('Name', size=128),
30 'line_ids': fields.one2many('l10n.fr.line', 'report_id', 'Lines'),30 'line_ids': fields.one2many('l10n.fr.line', 'report_id', 'Lines'),
31 }31 }
32
33 _sql_constraints = [32 _sql_constraints = [
34 ('code_uniq', 'unique (code)','The code report must be unique !')33 ('code_uniq', 'unique (code)','The code report must be unique !')
35 ]34 ]
@@ -61,7 +60,4 @@
6160
62res_company()61res_company()
6362
64
65
66
67# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:63# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
6864
=== modified file 'l10n_fr/report/base_report.py'
--- l10n_fr/report/base_report.py 2011-01-14 00:11:01 +0000
+++ l10n_fr/report/base_report.py 2012-10-02 11:29:53 +0000
@@ -117,4 +117,4 @@
117 break117 break
118 self._set_variable(code, sum)118 self._set_variable(code, sum)
119119
120# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
121\ No newline at end of file120\ No newline at end of file
121# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
122122
=== modified file 'l10n_lu/wizard/pdf_ext.py'
--- l10n_lu/wizard/pdf_ext.py 2011-01-14 00:11:01 +0000
+++ l10n_lu/wizard/pdf_ext.py 2012-10-02 11:29:53 +0000
@@ -57,7 +57,7 @@
57%%EOF57%%EOF
58"""58"""
5959
60def output_field( f ):60def output_field(f):
61 return "\xfe\xff" + "".join( [ "\x00"+c for c in f ] )61 return "\xfe\xff" + "".join( [ "\x00"+c for c in f ] )
6262
63def extract_keys(lines):63def extract_keys(lines):
6464
=== modified file 'lunch/report/order.py'
--- lunch/report/order.py 2011-01-14 00:11:01 +0000
+++ lunch/report/order.py 2012-10-02 11:29:53 +0000
@@ -26,14 +26,14 @@
2626
27class order(report_sxw.rml_parse):27class order(report_sxw.rml_parse):
2828
29 def get_lines(self, user,objects):29 def get_lines(self, user, objects):
30 lines=[]30 lines=[]
31 for obj in objects:31 for obj in objects:
32 if user.id==obj.user_id.id:32 if user.id==obj.user_id.id:
33 lines.append(obj)33 lines.append(obj)
34 return lines34 return lines
3535
36 def get_total(self, user,objects):36 def get_total(self, user, objects):
37 lines=[]37 lines=[]
38 for obj in objects:38 for obj in objects:
39 if user.id==obj.user_id.id:39 if user.id==obj.user_id.id:
4040
=== modified file 'mail/mail_thread.py'
--- mail/mail_thread.py 2012-09-18 15:59:05 +0000
+++ mail/mail_thread.py 2012-10-02 11:29:53 +0000
@@ -590,7 +590,7 @@
590 context = context or {}590 context = context or {}
591 attachments = attachments or []591 attachments = attachments or []
592 assert (not thread_id) or isinstance(thread_id, (int,long)) or \592 assert (not thread_id) or isinstance(thread_id, (int,long)) or \
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"
594 if isinstance(thread_id, (list, tuple)):594 if isinstance(thread_id, (list, tuple)):
595 thread_id = thread_id and thread_id[0]595 thread_id = thread_id and thread_id[0]
596596
@@ -618,7 +618,7 @@
618 'parent_id': parent_id,618 'parent_id': parent_id,
619 'attachment_ids': attachment_ids,619 'attachment_ids': attachment_ids,
620 })620 })
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
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)
623623
624 #------------------------------------------------------624 #------------------------------------------------------
625625
=== modified file 'mail/static/scripts/openerp_mailgate.py' (properties changed: +x to -x)
=== modified file 'membership/report/__init__.py'
--- membership/report/__init__.py 2011-01-14 00:11:01 +0000
+++ membership/report/__init__.py 2012-10-02 11:29:53 +0000
@@ -20,4 +20,4 @@
20##############################################################################20##############################################################################
2121
22import report_membership22import report_membership
23# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
24\ No newline at end of file23\ No newline at end of file
24# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2525
=== modified file 'membership/report/report_membership.py'
--- membership/report/report_membership.py 2012-05-04 12:13:26 +0000
+++ membership/report/report_membership.py 2012-10-02 11:29:53 +0000
@@ -141,4 +141,4 @@
141141
142report_membership()142report_membership()
143143
144# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
145\ No newline at end of file144\ No newline at end of file
145# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
146146
=== modified file 'membership/wizard/__init__.py'
--- membership/wizard/__init__.py 2011-01-14 00:11:01 +0000
+++ membership/wizard/__init__.py 2012-10-02 11:29:53 +0000
@@ -20,4 +20,4 @@
20##############################################################################20##############################################################################
2121
22import membership_invoice22import membership_invoice
23# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
24\ No newline at end of file23\ No newline at end of file
24# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2525
=== modified file 'mrp/mrp.py'
--- mrp/mrp.py 2012-09-30 12:57:57 +0000
+++ mrp/mrp.py 2012-10-02 11:29:53 +0000
@@ -274,13 +274,15 @@
274 return {'value': {'name': prod.name, 'product_uom': prod.uom_id.id}}274 return {'value': {'name': prod.name, 'product_uom': prod.uom_id.id}}
275 return {}275 return {}
276276
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):
278 """ Finds BoM for particular product and product uom.278 """ Finds BoM for particular product and product uom.
279 @param product_id: Selected product.279 @param product_id: Selected product.
280 @param product_uom: Unit of measure of a product.280 @param product_uom: Unit of measure of a product.
281 @param properties: List of related properties.281 @param properties: List of related properties.
282 @return: False or BoM id.282 @return: False or BoM id.
283 """283 """
284 if properties is None:
285 properties = []
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,))
285 ids = map(lambda x: x[0], cr.fetchall())287 ids = map(lambda x: x[0], cr.fetchall())
286 max_prop = 0288 max_prop = 0
@@ -295,7 +297,7 @@
295 max_prop = prop297 max_prop = prop
296 return result298 return result
297299
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):
299 """ Finds Products and Work Centers for related BoM for manufacturing order.301 """ Finds Products and Work Centers for related BoM for manufacturing order.
300 @param bom: BoM of particular product.302 @param bom: BoM of particular product.
301 @param factor: Factor of product UoM.303 @param factor: Factor of product UoM.
@@ -609,11 +611,13 @@
609 self.write(cr, uid, ids, {'state': 'picking_except'})611 self.write(cr, uid, ids, {'state': 'picking_except'})
610 return True612 return True
611613
612 def action_compute(self, cr, uid, ids, properties=[], context=None):614 def action_compute(self, cr, uid, ids, properties=None, context=None):
613 """ Computes bills of material of a product.615 """ Computes bills of material of a product.
614 @param properties: List containing dictionaries of properties.616 @param properties: List containing dictionaries of properties.
615 @return: No. of products.617 @return: No. of products.
616 """618 """
619 if properties is None:
620 properties = []
617 results = []621 results = []
618 bom_obj = self.pool.get('mrp.bom')622 bom_obj = self.pool.get('mrp.bom')
619 uom_obj = self.pool.get('product.uom')623 uom_obj = self.pool.get('product.uom')
@@ -832,7 +836,7 @@
832 'product_id': wc.product_id.id,836 'product_id': wc.product_id.id,
833 'unit_amount': wc_line.hour,837 'unit_amount': wc_line.hour,
834 'product_uom_id': wc.product_id.id and wc.product_id.uom_id.id or False838 'product_uom_id': wc.product_id.id and wc.product_id.uom_id.id or False
835 839
836 } )840 } )
837 if wc.costs_journal_id and wc.costs_general_account_id:841 if wc.costs_journal_id and wc.costs_general_account_id:
838 value = wc_line.cycle * wc.costs_cycle842 value = wc_line.cycle * wc.costs_cycle
@@ -849,7 +853,7 @@
849 'product_id': wc.product_id.id,853 'product_id': wc.product_id.id,
850 'unit_amount': wc_line.cycle,854 'unit_amount': wc_line.cycle,
851 'product_uom_id': wc.product_id.id and wc.product_id.uom_id.id or False855 'product_uom_id': wc.product_id.id and wc.product_id.uom_id.id or False
852 856
853 } )857 } )
854 return amount858 return amount
855859
856860
=== modified file 'mrp/procurement.py'
--- mrp/procurement.py 2012-08-17 10:03:02 +0000
+++ mrp/procurement.py 2012-10-02 11:29:53 +0000
@@ -33,7 +33,7 @@
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'),
34 }34 }
35 35
36 def check_produce_product(self, cr, uid, procurement, context=[]):36 def check_produce_product(self, cr, uid, procurement, context=None):
37 """ Finds the bill of material for the product from procurement order.37 """ Finds the bill of material for the product from procurement order.
38 @return: True or False38 @return: True or False
39 """39 """
4040
=== modified file 'mrp/report/bom_structure.py'
--- mrp/report/bom_structure.py 2011-01-14 00:11:01 +0000
+++ mrp/report/bom_structure.py 2012-10-02 11:29:53 +0000
@@ -35,7 +35,7 @@
35 def get_children(self, object, level=0):35 def get_children(self, object, level=0):
36 result = []36 result = []
3737
38 def _get_rec(object,level):38 def _get_rec(object, level):
39 for l in object:39 for l in object:
40 res = {}40 res = {}
41 res['name'] = l.name41 res['name'] = l.name
@@ -61,4 +61,4 @@
61report_sxw.report_sxw('report.bom.structure','mrp.bom','mrp/report/bom_structure.rml',parser=bom_structure,header='internal')61report_sxw.report_sxw('report.bom.structure','mrp.bom','mrp/report/bom_structure.rml',parser=bom_structure,header='internal')
6262
6363
64# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
65\ No newline at end of file64\ No newline at end of file
65# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
6666
=== modified file 'mrp/stock.py'
--- mrp/stock.py 2012-02-13 15:27:55 +0000
+++ mrp/stock.py 2012-10-02 11:29:53 +0000
@@ -102,7 +102,7 @@
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)
103 return processed_ids103 return processed_ids
104 104
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):
106 """ Consumed product with specific quatity from specific source location.106 """ Consumed product with specific quatity from specific source location.
107 @param product_qty: Consumed product quantity107 @param product_qty: Consumed product quantity
108 @param location_id: Source location108 @param location_id: Source location
109109
=== modified file 'mrp_operations/mrp_operations.py'
--- mrp_operations/mrp_operations.py 2012-08-17 10:03:02 +0000
+++ mrp_operations/mrp_operations.py 2012-10-02 11:29:53 +0000
@@ -422,7 +422,7 @@
422 pass422 pass
423 return result423 return result
424424
425 def action_compute(self, cr, uid, ids, properties=[], context=None):425 def action_compute(self, cr, uid, ids, properties=None, context=None):
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.
427 @param properties: List containing dictionaries of properties.427 @param properties: List containing dictionaries of properties.
428 @return: No. of products.428 @return: No. of products.
429429
=== modified file 'plugin/plugin_handler.py'
--- plugin/plugin_handler.py 2012-09-13 08:25:35 +0000
+++ plugin/plugin_handler.py 2012-10-02 11:29:53 +0000
@@ -6,7 +6,6 @@
66
7from osv import osv, fields7from osv import osv, fields
88
9
10class plugin_handler(osv.osv_memory):9class plugin_handler(osv.osv_memory):
11 _name = 'plugin.handler'10 _name = 'plugin.handler'
1211
@@ -37,7 +36,7 @@
37 @param email: email is a standard RFC2822 email message36 @param email: email is a standard RFC2822 email message
38 @return Dictionary which contain id and the model name of the document linked with the mail37 @return Dictionary which contain id and the model name of the document linked with the mail
39 if no document is found the id = 038 if no document is found the id = 0
40 (model_name, res_id, url, name_get) 39 (model_name, res_id, url, name_get)
41 """40 """
42 mail_message_obj = self.pool.get('mail.message')41 mail_message_obj = self.pool.get('mail.message')
43 model = ""42 model = ""
@@ -52,7 +51,7 @@
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)])
53 msg_id = len(msg_ids) and msg_ids[0] or False52 msg_id = len(msg_ids) and msg_ids[0] or False
54 if not msg_id and parent_id:53 if not msg_id and parent_id:
55 msg_id = parent_id 54 msg_id = parent_id
56 if msg_id:55 if msg_id:
57 msg = mail_message_obj.browse(cr, uid, msg_id)56 msg = mail_message_obj.browse(cr, uid, msg_id)
58 res_id = msg.res_id57 res_id = msg.res_id
@@ -61,7 +60,6 @@
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]
62 return (model,res_id, url,name)61 return (model,res_id, url,name)
6362
64
65 def document_type(self, cr, uid, context=None):63 def document_type(self, cr, uid, context=None):
66 """64 """
67 Return the list of available model to push65 Return the list of available model to push
@@ -74,13 +72,13 @@
74 doc_dict['res.partner'] = "Partner"72 doc_dict['res.partner'] = "Partner"
75 return doc_dict.items()73 return doc_dict.items()
7674
77 # Can be used where search record was used 75 # Can be used where search record was used
78 def list_document_get(self, cr, uid, model, name):76 def list_document_get(self, cr, uid, model, name):
79 """77 """
80 This function return the result of name_search on the object model78 This function return the result of name_search on the object model
81 @param model: the name of the model 79 @param model: the name of the model
82 @param : the name of the document80 @param : the name of the document
83 @return : the result of name_search a list of tuple 81 @return : the result of name_search a list of tuple
84 [(id, 'name')]82 [(id, 'name')]
85 """83 """
86 return self.pool.get(model).name_search(cr, uid, name)84 return self.pool.get(model).name_search(cr, uid, name)
@@ -89,7 +87,7 @@
89 """87 """
90 @param email: email is a standard RFC2822 email message88 @param email: email is a standard RFC2822 email message
91 @param model: On which model the message is pushed89 @param model: On which model the message is pushed
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
93 @return Dictionary which contain model , url and resource id.91 @return Dictionary which contain model , url and resource id.
94 """92 """
95 mail_message = self.pool.get('mail.message')93 mail_message = self.pool.get('mail.message')
@@ -97,7 +95,7 @@
97 msg = self.pool.get('mail.thread').message_parse(cr, uid, email)95 msg = self.pool.get('mail.thread').message_parse(cr, uid, email)
98 message_id = msg.get('message-id')96 message_id = msg.get('message-id')
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)])
100 98
101 if message_id and mail_ids :99 if message_id and mail_ids :
102 mail_record = mail_message.browse(cr, uid, mail_ids)[0]100 mail_record = mail_message.browse(cr, uid, mail_ids)[0]
103 res_id = mail_record.res_id101 res_id = mail_record.res_id
@@ -109,11 +107,11 @@
109 res_id = model_obj.message_process(cr, uid, model, email)107 res_id = model_obj.message_process(cr, uid, model, email)
110 notify = "Mail successfully pushed, a new %s has been created " % model108 notify = "Mail successfully pushed, a new %s has been created " % model
111 else:109 else:
112 model_obj.message_post(cr, uid, [res_id], 110 model_obj.message_post(cr, uid, [res_id],
113 body= msg.get('body'), 111 body= msg.get('body'),
114 subject= msg.get('subject'), 112 subject= msg.get('subject'),
115 type= 'email', 113 type= 'email',
116 parent_id= msg.get('parent_id'), 114 parent_id= msg.get('parent_id'),
117 attachments= msg.get('attachments'))115 attachments= msg.get('attachments'))
118 notify = "Mail successfully pushed"116 notify = "Mail successfully pushed"
119 url = self._make_url(cr, uid, res_id, model)117 url = self._make_url(cr, uid, res_id, model)
@@ -123,7 +121,7 @@
123 """121 """
124 @param data : the data use to create the res.partner122 @param data : the data use to create the res.partner
125 [('field_name', value)], field name is required123 [('field_name', value)], field name is required
126 @param partner_id : On which partner the address is attached 124 @param partner_id : On which partner the address is attached
127 if partner_id = 0 then create a new partner with the same name that the address125 if partner_id = 0 then create a new partner with the same name that the address
128 @return : the partner_id sended or created, this allow the plugin to open the right partner page126 @return : the partner_id sended or created, this allow the plugin to open the right partner page
129 """127 """
@@ -138,7 +136,7 @@
138 return ('res.partner', partner_id, url)136 return ('res.partner', partner_id, url)
139137
140 # Specific to outlook rfc822 is not available so we split in arguments headerd,body,attachemnts138 # Specific to outlook rfc822 is not available so we split in arguments headerd,body,attachemnts
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):
142 # ----------------------------------------140 # ----------------------------------------
143 # solution 1141 # solution 1
144 # construct a fake rfc822 from the separated arguement142 # construct a fake rfc822 from the separated arguement
@@ -149,14 +147,14 @@
149 # solution 2147 # solution 2
150 # use self.pushmessage only with header and body148 # use self.pushmessage only with header and body
151 # add attachemnt yourself after149 # add attachemnt yourself after
152 mail_message = self.pool.get('mail.message') 150 mail_message = self.pool.get('mail.message')
153 ir_attachment_obj = self.pool.get('ir.attachment')151 ir_attachment_obj = self.pool.get('ir.attachment')
154 attach_ids = []152 attach_ids = []
155 msg = self.pool.get('mail.thread').message_parse(cr, uid, headers)153 msg = self.pool.get('mail.thread').message_parse(cr, uid, headers)
156 message_id = msg.get('message-id') 154 message_id = msg.get('message-id')
157 push_mail = self.push_message(cr, uid, model, headers, res_id)155 push_mail = self.push_message(cr, uid, model, headers, res_id)
158 res_id = push_mail[1]156 res_id = push_mail[1]
159 model = push_mail[0] 157 model = push_mail[0]
160 for name in attachments.keys():158 for name in attachments.keys():
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)])
162 if attachment_ids:160 if attachment_ids:
163161
=== modified file 'point_of_sale/report/account_statement.py'
--- point_of_sale/report/account_statement.py 2011-01-14 00:11:01 +0000
+++ point_of_sale/report/account_statement.py 2012-10-02 11:29:53 +0000
@@ -48,4 +48,4 @@
4848
49report_sxw.report_sxw('report.account.statement', 'account.bank.statement', 'addons/statement/report/account_statement.rml', parser=account_statement,header='internal')49report_sxw.report_sxw('report.account.statement', 'account.bank.statement', 'addons/statement/report/account_statement.rml', parser=account_statement,header='internal')
5050
51# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
52\ No newline at end of file51\ No newline at end of file
52# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
5353
=== modified file 'point_of_sale/report/all_closed_cashbox_of_the_day.py'
--- point_of_sale/report/all_closed_cashbox_of_the_day.py 2011-01-14 00:11:01 +0000
+++ point_of_sale/report/all_closed_cashbox_of_the_day.py 2012-10-02 11:29:53 +0000
@@ -38,13 +38,13 @@
38 'get_net_total_starting':self._get_net_total_starting,38 'get_net_total_starting':self._get_net_total_starting,
39 })39 })
4040
41 def _get_user(self,line_ids):41 def _get_user(self, line_ids):
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'])
43 self.cr.execute(sql)43 self.cr.execute(sql)
44 user = self.cr.fetchone()44 user = self.cr.fetchone()
45 return user[0]45 return user[0]
4646
47 def _get_data(self,user):47 def _get_data(self, user):
48 data = {}48 data = {}
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,
50 abs.state,abs.balance_end_real FROM account_bank_statement as abs50 abs.state,abs.balance_end_real FROM account_bank_statement as abs
@@ -57,7 +57,7 @@
57 data = self.cr.dictfetchall()57 data = self.cr.dictfetchall()
58 return data58 return data
5959
60 def _get_lines(self,statement):60 def _get_lines(self, statement):
61 data = {}61 data = {}
62 sql = """ select absl.* from account_bank_statement_line as absl, account_bank_statement as abs62 sql = """ select absl.* from account_bank_statement_line as absl, account_bank_statement as abs
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'])
@@ -65,7 +65,7 @@
65 data = self.cr.dictfetchall()65 data = self.cr.dictfetchall()
66 return data66 return data
6767
68 def _get_bal(self,data):68 def _get_bal(self, data):
69 res = {}69 res = {}
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'])
71 self.cr.execute(sql)71 self.cr.execute(sql)
@@ -75,7 +75,7 @@
75 else:75 else:
76 return False76 return False
7777
78 def _get_sub_total(self,user,data,date):78 def _get_sub_total(self, user, data, date):
79 res={}79 res={}
80 self.cr.execute(""" select sum(absl.amount) from account_bank_statement as abs80 self.cr.execute(""" select sum(absl.amount) from account_bank_statement as abs
81 LEFT JOIN account_bank_statement_line as absl ON abs.id = absl.statement_id81 LEFT JOIN account_bank_statement_line as absl ON abs.id = absl.statement_id
@@ -90,7 +90,7 @@
90 else:90 else:
91 return False91 return False
9292
93 def _get_partner(self,statement):93 def _get_partner(self, statement):
94 res = {}94 res = {}
95 if statement['pos_statement_id']:95 if statement['pos_statement_id']:
96 sql =""" select rp.name from account_bank_statement_line as absl,res_partner as rp96 sql =""" select rp.name from account_bank_statement_line as absl,res_partner as rp
@@ -102,7 +102,7 @@
102 else:102 else:
103 return 0.00103 return 0.00
104104
105 def _get_net_total_starting(self,user):105 def _get_net_total_starting(self, user):
106 lst = []106 lst = []
107 res={}107 res={}
108 total_ending_bal = 0.0108 total_ending_bal = 0.0
@@ -124,7 +124,7 @@
124 lst.append(total_starting_bal)124 lst.append(total_starting_bal)
125 return lst125 return lst
126126
127 def _get_net_total(self,user):127 def _get_net_total(self, user):
128 res={}128 res={}
129 sql = """select sum(absl.amount) as net_total from account_bank_statement as abs129 sql = """select sum(absl.amount) as net_total from account_bank_statement as abs
130 LEFT JOIN account_bank_statement_line as absl ON abs.id = absl.statement_id130 LEFT JOIN account_bank_statement_line as absl ON abs.id = absl.statement_id
@@ -137,4 +137,4 @@
137137
138report_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')138report_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')
139139
140# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
141\ No newline at end of file140\ No newline at end of file
141# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
142142
=== modified file 'point_of_sale/report/pos_details.py'
--- point_of_sale/report/pos_details.py 2011-12-29 16:58:23 +0000
+++ point_of_sale/report/pos_details.py 2012-10-02 11:29:53 +0000
@@ -24,7 +24,7 @@
2424
25class pos_details(report_sxw.rml_parse):25class pos_details(report_sxw.rml_parse):
2626
27 def _get_invoice(self,inv_id):27 def _get_invoice(self, inv_id):
28 res={}28 res={}
29 if inv_id:29 if inv_id:
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,))
@@ -37,7 +37,7 @@
37 user_obj = self.pool.get('res.users')37 user_obj = self.pool.get('res.users')
38 return user_obj.search(self.cr, self.uid, [])38 return user_obj.search(self.cr, self.uid, [])
3939
40 def _pos_sales_details(self,form):40 def _pos_sales_details(self, form):
41 pos_obj = self.pool.get('pos.order')41 pos_obj = self.pool.get('pos.order')
42 user_obj = self.pool.get('res.users')42 user_obj = self.pool.get('res.users')
43 data = []43 data = []
@@ -74,7 +74,7 @@
74 def _get_sales_total_2(self):74 def _get_sales_total_2(self):
75 return self.total75 return self.total
7676
77 def _get_sum_invoice_2(self,form):77 def _get_sum_invoice_2(self, form):
78 pos_obj = self.pool.get('pos.order')78 pos_obj = self.pool.get('pos.order')
79 user_obj = self.pool.get('res.users')79 user_obj = self.pool.get('res.users')
80 user_ids = form['user_ids'] or self._get_all_users()80 user_ids = form['user_ids'] or self._get_all_users()
8181
=== modified file 'point_of_sale/report/pos_details_summary.py'
--- point_of_sale/report/pos_details_summary.py 2012-05-12 22:37:43 +0000
+++ point_of_sale/report/pos_details_summary.py 2012-10-02 11:29:53 +0000
@@ -42,7 +42,7 @@
42 'getcompany':self.get_company42 'getcompany':self.get_company
43 })43 })
4444
45 def get_company(self,objects):45 def get_company(self, objects):
46 comp=[obj.company_id.name for obj in objects]46 comp=[obj.company_id.name for obj in objects]
47 return '%s' % (comp[0])47 return '%s' % (comp[0])
4848
4949
=== modified file 'point_of_sale/report/pos_lines.py'
--- point_of_sale/report/pos_lines.py 2011-01-14 00:11:01 +0000
+++ point_of_sale/report/pos_lines.py 2012-10-02 11:29:53 +0000
@@ -41,7 +41,7 @@
41 self.total = tot41 self.total = tot
42 return self.total42 return self.total
4343
44 def __taxes__(self,obj):44 def __taxes__(self, obj):
45 self.cr.execute ( " Select acct.name from pos_order as po " \45 self.cr.execute ( " Select acct.name from pos_order as po " \
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 " \
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 " \
@@ -52,4 +52,4 @@
5252
53report_sxw.report_sxw('report.pos.lines', 'pos.order', 'addons/point_of_sale/report/pos_lines.rml', parser=pos_lines,header='internal')53report_sxw.report_sxw('report.pos.lines', 'pos.order', 'addons/point_of_sale/report/pos_lines.rml', parser=pos_lines,header='internal')
5454
55# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
56\ No newline at end of file55\ No newline at end of file
56# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
5757
=== modified file 'point_of_sale/report/pos_payment_report.py'
--- point_of_sale/report/pos_payment_report.py 2011-01-14 00:11:01 +0000
+++ point_of_sale/report/pos_payment_report.py 2012-10-02 11:29:53 +0000
@@ -33,7 +33,7 @@
33 'pos_payment_total':self._pos_payment_total,33 'pos_payment_total':self._pos_payment_total,
34 })34 })
3535
36 def _pos_payment(self,obj):36 def _pos_payment(self, obj):
37 data={}37 data={}
38 sql = """ select id from pos_order where id = %d"""%(obj.id)38 sql = """ select id from pos_order where id = %d"""%(obj.id)
39 self.cr.execute(sql)39 self.cr.execute(sql)
@@ -56,9 +56,9 @@
56 self.total += d['price_unit'] * d['qty']56 self.total += d['price_unit'] * d['qty']
57 return data57 return data
5858
59 def _pos_payment_total(self,o):59 def _pos_payment_total(self, o):
60 return self.total60 return self.total
6161
62report_sxw.report_sxw('report.pos.payment.report', 'pos.order', 'addons/point_of_sale/report/pos_payment_report.rml', parser=pos_payment_report,header='internal')62report_sxw.report_sxw('report.pos.payment.report', 'pos.order', 'addons/point_of_sale/report/pos_payment_report.rml', parser=pos_payment_report,header='internal')
6363
64# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
65\ No newline at end of file64\ No newline at end of file
65# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
6666
=== modified file 'point_of_sale/report/pos_payment_report_user.py'
--- point_of_sale/report/pos_payment_report_user.py 2011-01-14 00:11:01 +0000
+++ point_of_sale/report/pos_payment_report_user.py 2012-10-02 11:29:53 +0000
@@ -33,7 +33,7 @@
33 'pos_payment_user_total':self.__pos_payment_user__total__,33 'pos_payment_user_total':self.__pos_payment_user__total__,
34 })34 })
3535
36 def __pos_payment_user__(self,form):36 def __pos_payment_user__(self, form):
37 data={}37 data={}
38 ids = form['user_id']38 ids = form['user_id']
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, " \
@@ -61,4 +61,4 @@
6161
62report_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')62report_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')
6363
64# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
65\ No newline at end of file64\ No newline at end of file
65# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
6666
=== modified file 'point_of_sale/report/pos_receipt.py'
--- point_of_sale/report/pos_receipt.py 2012-03-30 09:08:37 +0000
+++ point_of_sale/report/pos_receipt.py 2012-10-02 11:29:53 +0000
@@ -74,4 +74,4 @@
7474
75report_sxw.report_sxw('report.pos.receipt', 'pos.order', 'addons/point_of_sale/report/pos_receipt.rml', parser=order, header=False)75report_sxw.report_sxw('report.pos.receipt', 'pos.order', 'addons/point_of_sale/report/pos_receipt.rml', parser=order, header=False)
7676
77# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
78\ No newline at end of file77\ No newline at end of file
78# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
7979
=== modified file 'point_of_sale/report/pos_sales_user.py'
--- point_of_sale/report/pos_sales_user.py 2012-08-21 08:23:43 +0000
+++ point_of_sale/report/pos_sales_user.py 2012-10-02 11:29:53 +0000
@@ -33,7 +33,7 @@
3333
34 })34 })
3535
36 def _get_data(self,form):36 def _get_data(self, form):
37 dt1 = form['date_start'] + ' 00:00:00'37 dt1 = form['date_start'] + ' 00:00:00'
38 dt2 = form['date_end'] + ' 23:59:59'38 dt2 = form['date_end'] + ' 23:59:59'
39 data={}39 data={}
4040
=== modified file 'point_of_sale/report/pos_sales_user_today.py'
--- point_of_sale/report/pos_sales_user_today.py 2011-01-14 00:11:01 +0000
+++ point_of_sale/report/pos_sales_user_today.py 2012-10-02 11:29:53 +0000
@@ -33,7 +33,7 @@
3333
34 })34 })
3535
36 def _get_data(self,form):36 def _get_data(self, form):
37 data={}37 data={}
38 ids = form['user_id']38 ids = form['user_id']
3939
@@ -47,4 +47,4 @@
4747
48report_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')48report_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')
4949
50# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
51\ No newline at end of file50\ No newline at end of file
51# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
5252
=== modified file 'point_of_sale/report/pos_users_product.py'
--- point_of_sale/report/pos_users_product.py 2011-01-14 00:11:01 +0000
+++ point_of_sale/report/pos_users_product.py 2012-10-02 11:29:53 +0000
@@ -60,9 +60,9 @@
60 data = self.cr.fetchone()60 data = self.cr.fetchone()
61 return data[0]61 return data[0]
6262
63 def _get_total(self,o):63 def _get_total(self, o):
64 return self.total64 return self.total
6565
66report_sxw.report_sxw('report.pos.user.product', 'account.bank.statement', 'addons/statement/report/pos_users_product.rml', parser=pos_user_product,header='internal')66report_sxw.report_sxw('report.pos.user.product', 'account.bank.statement', 'addons/statement/report/pos_users_product.rml', parser=pos_user_product,header='internal')
6767
68# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
69\ No newline at end of file68\ No newline at end of file
69# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
7070
=== modified file 'product/product.py'
--- product/product.py 2012-09-26 12:24:35 +0000
+++ product/product.py 2012-10-02 11:29:53 +0000
@@ -335,7 +335,7 @@
335 res = False335 res = False
336 return res336 return res
337337
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):
339 if uom_id:339 if uom_id:
340 return {'value': {'uom_po_id': uom_id}}340 return {'value': {'uom_po_id': uom_id}}
341 return {}341 return {}
@@ -594,7 +594,7 @@
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)
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)
596596
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):
598 if uom_id and uom_po_id:598 if uom_id and uom_po_id:
599 uom_obj=self.pool.get('product.uom')599 uom_obj=self.pool.get('product.uom')
600 uom=uom_obj.browse(cursor,user,[uom_id])[0]600 uom=uom_obj.browse(cursor,user,[uom_id])[0]
601601
=== modified file 'product/report/product_pricelist.py'
--- product/report/product_pricelist.py 2012-07-11 13:06:15 +0000
+++ product/report/product_pricelist.py 2012-10-02 11:29:53 +0000
@@ -24,6 +24,7 @@
24from osv import osv24from osv import osv
25import pooler25import pooler
26from tools.translate import _26from tools.translate import _
27
27class product_pricelist(report_sxw.rml_parse):28class product_pricelist(report_sxw.rml_parse):
28 def __init__(self, cr, uid, name, context):29 def __init__(self, cr, uid, name, context):
29 super(product_pricelist, self).__init__(cr, uid, name, context=context)30 super(product_pricelist, self).__init__(cr, uid, name, context=context)
@@ -39,7 +40,7 @@
39 'get_titles': self._get_titles,40 'get_titles': self._get_titles,
40 })41 })
4142
42 def _get_titles(self,form):43 def _get_titles(self, form):
43 lst = []44 lst = []
44 vals = {}45 vals = {}
45 qtys = 146 qtys = 1
@@ -51,7 +52,7 @@
51 lst.append(vals)52 lst.append(vals)
52 return lst53 return lst
5354
54 def _set_quantity(self,form):55 def _set_quantity(self, form):
55 for i in range(1,6):56 for i in range(1,6):
56 q = 'qty%d'%i57 q = 'qty%d'%i
57 if form[q] >0 and form[q] not in self.quantity:58 if form[q] >0 and form[q] not in self.quantity:
@@ -76,7 +77,7 @@
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]
77 return symbol['symbol'] or ''78 return symbol['symbol'] or ''
7879
79 def _get_categories(self, products,form):80 def _get_categories(self, products, form):
80 cat_ids=[]81 cat_ids=[]
81 res=[]82 res=[]
82 self.pricelist = form['price_list']83 self.pricelist = form['price_list']
@@ -111,7 +112,7 @@
111 res.append({'name':cat[1],'products': products})112 res.append({'name':cat[1],'products': products})
112 return res113 return res
113114
114 def _get_price(self,pricelist_id, product_id,qty):115 def _get_price(self, pricelist_id, product_id, qty):
115 sale_price_digits = self.get_digits(dp='Product Price')116 sale_price_digits = self.get_digits(dp='Product Price')
116 pool = pooler.get_pool(self.cr.dbname)117 pool = pooler.get_pool(self.cr.dbname)
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)
@@ -123,5 +124,5 @@
123 return price124 return price
124125
125report_sxw.report_sxw('report.product.pricelist','product.product','addons/product/report/product_pricelist.rml',parser=product_pricelist)126report_sxw.report_sxw('report.product.pricelist','product.product','addons/product/report/product_pricelist.rml',parser=product_pricelist)
127
126# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:128# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
127
128129
=== modified file 'product_manufacturer/product_manufacturer.py'
--- product_manufacturer/product_manufacturer.py 2011-01-14 00:11:01 +0000
+++ product_manufacturer/product_manufacturer.py 2012-10-02 11:29:53 +0000
@@ -40,4 +40,4 @@
40 }40 }
41product_attribute()41product_attribute()
4242
43# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
44\ No newline at end of file43\ No newline at end of file
44# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4545
=== modified file 'product_visible_discount/__init__.py'
--- product_visible_discount/__init__.py 2011-01-14 00:11:01 +0000
+++ product_visible_discount/__init__.py 2012-10-02 11:29:53 +0000
@@ -20,4 +20,4 @@
2020
21import product_visible_discount21import product_visible_discount
2222
23# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
24\ No newline at end of file23\ No newline at end of file
24# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2525
=== modified file 'project/project.py'
--- project/project.py 2012-09-29 19:58:25 +0000
+++ project/project.py 2012-10-02 11:29:53 +0000
@@ -55,7 +55,6 @@
55 }55 }
56 _order = 'sequence'56 _order = 'sequence'
5757
58
59def short_name(name):58def short_name(name):
60 """Keep first word(s) of name to make it small enough59 """Keep first word(s) of name to make it small enough
61 but distinctive"""60 but distinctive"""
@@ -191,7 +190,6 @@
191190
192 # Lambda indirection method to avoid passing a copy of the overridable method when declaring the field191 # Lambda indirection method to avoid passing a copy of the overridable method when declaring the field
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)
194
195 _columns = {193 _columns = {
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),
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."),
@@ -311,11 +309,12 @@
311 task_obj.duplicate_task(cr, uid, map_task_id, context=context)309 task_obj.duplicate_task(cr, uid, map_task_id, context=context)
312 return True310 return True
313311
314 def copy(self, cr, uid, id, default={}, context=None):312 def copy(self, cr, uid, id, default=None, context=None):
315 if context is None:313 if context is None:
316 context = {}314 context = {}
315 if default is None:
316 default = {}
317317
318 default = default or {}
319 context['active_test'] = False318 context['active_test'] = False
320 default['state'] = 'open'319 default['state'] = 'open'
321 default['tasks'] = []320 default['tasks'] = []
@@ -650,12 +649,12 @@
650 res[task.id]['progress'] = 100.0649 res[task.id]['progress'] = 100.0
651 return res650 return res
652651
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):
654 if remaining and not planned:653 if remaining and not planned:
655 return {'value':{'planned_hours': remaining}}654 return {'value':{'planned_hours': remaining}}
656 return {}655 return {}
657656
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):
659 return {'value':{'remaining_hours': planned - effective}}658 return {'value':{'remaining_hours': planned - effective}}
660659
661 def onchange_project(self, cr, uid, id, project_id):660 def onchange_project(self, cr, uid, id, project_id):
@@ -686,7 +685,9 @@
686 #FIXME why there is already the copy and the old one685 #FIXME why there is already the copy and the old one
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))]})
688687
689 def copy_data(self, cr, uid, id, default={}, context=None):688 def copy_data(self, cr, uid, id, default=None, context=None):
689 if default is None:
690 default = {}
690 default = default or {}691 default = default or {}
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})
692 if not default.get('remaining_hours', False):693 if not default.get('remaining_hours', False):
@@ -699,7 +700,6 @@
699 default.update({'name':new_name})700 default.update({'name':new_name})
700 return super(task, self).copy_data(cr, uid, id, default, context)701 return super(task, self).copy_data(cr, uid, id, default, context)
701702
702
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):
704 res = {}704 res = {}
705 for task in self.browse(cr, uid, ids, context=context):705 for task in self.browse(cr, uid, ids, context=context):
@@ -777,7 +777,6 @@
777 'color': fields.integer('Color Index'),777 'color': fields.integer('Color Index'),
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),
779 }779 }
780
781 _defaults = {780 _defaults = {
782 'stage_id': _get_default_stage_id,781 'stage_id': _get_default_stage_id,
783 'project_id': _get_default_project_id,782 'project_id': _get_default_project_id,
@@ -790,7 +789,6 @@
790 'user_id': lambda obj, cr, uid, context: uid,789 'user_id': lambda obj, cr, uid, context: uid,
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),
792 }791 }
793
794 _order = "priority, sequence, date_start, name, id"792 _order = "priority, sequence, date_start, name, id"
795793
796 def set_priority(self, cr, uid, ids, priority, *args):794 def set_priority(self, cr, uid, ids, priority, *args):
@@ -853,9 +851,8 @@
853 (_check_recursion, 'Error ! You cannot create recursive tasks.', ['parent_ids']),851 (_check_recursion, 'Error ! You cannot create recursive tasks.', ['parent_ids']),
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'])
855 ]853 ]
856 #854
857 # Override view according to the company definition855 # Override view according to the company definition
858 #
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):
860 users_obj = self.pool.get('res.users')857 users_obj = self.pool.get('res.users')
861 if context is None: context = {}858 if context is None: context = {}
@@ -887,9 +884,9 @@
887 res['fields'][f]['string'] = res['fields'][f]['string'].replace('Hours',tm)884 res['fields'][f]['string'] = res['fields'][f]['string'].replace('Hours',tm)
888 return res885 return res
889886
890 # ****************************************887 # ----------------------------------------
891 # Case management888 # Case management
892 # ****************************************889 # ----------------------------------------
893890
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):
895 """ Override of the base.stage method892 """ Override of the base.stage method
@@ -1021,10 +1018,12 @@
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))
1022 return new_attachment_ids1019 return new_attachment_ids
10231020
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):
1025 """1022 """
1026 Delegate Task to another users.1023 Delegate Task to another users.
1027 """1024 """
1025 if delegate_data is None:
1026 delegate_data = {}
1028 assert delegate_data['user_id'], _("Delegated User should be specified")1027 assert delegate_data['user_id'], _("Delegated User should be specified")
1029 delegated_tasks = {}1028 delegated_tasks = {}
1030 for task in self.browse(cr, uid, ids, context=context):1029 for task in self.browse(cr, uid, ids, context=context):
@@ -1170,7 +1169,7 @@
1170 return result1169 return result
11711170
1172 # ---------------------------------------------------1171 # ---------------------------------------------------
1173 # mail gateway1172 # Mail gateway
1174 # ---------------------------------------------------1173 # ---------------------------------------------------
11751174
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):
11771176
=== modified file 'project/wizard/project_task_reevaluate.py'
--- project/wizard/project_task_reevaluate.py 2011-12-19 16:54:40 +0000
+++ project/wizard/project_task_reevaluate.py 2012-10-02 11:29:53 +0000
@@ -26,7 +26,7 @@
26class project_task_reevaluate(osv.osv_memory):26class project_task_reevaluate(osv.osv_memory):
27 _name = 'project.task.reevaluate'27 _name = 'project.task.reevaluate'
2828
29 def _get_remaining(self,cr, uid, context=None):29 def _get_remaining(self, cr, uid, context=None):
30 if context is None:30 if context is None:
31 context = {}31 context = {}
32 active_id = context.get('active_id', False)32 active_id = context.get('active_id', False)
3333
=== modified file 'project_gtd/project_gtd.py'
--- project_gtd/project_gtd.py 2012-06-27 13:14:12 +0000
+++ project_gtd/project_gtd.py 2012-10-02 11:29:53 +0000
@@ -67,7 +67,7 @@
67 default['context_id'] = False67 default['context_id'] = False
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)
6969
70 def _get_context(self,cr, uid, context=None):70 def _get_context(self, cr, uid, context=None):
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)
72 return ids and ids[0] or False72 return ids and ids[0] or False
7373
7474
=== modified file 'project_gtd/wizard/project_gtd_empty.py'
--- project_gtd/wizard/project_gtd_empty.py 2012-08-07 11:31:37 +0000
+++ project_gtd/wizard/project_gtd_empty.py 2012-10-02 11:29:53 +0000
@@ -30,7 +30,7 @@
30 'name': fields.char('Name', size=32)30 'name': fields.char('Name', size=32)
31 }31 }
3232
33 def view_init(self, cr , uid , fields_list, context=None):33 def view_init(self, cr, uid, fields_list, context=None):
34 if context is None:34 if context is None:
35 context = {}35 context = {}
36 self._empty(cr, uid, context=context)36 self._empty(cr, uid, context=context)
3737
=== modified file 'project_mrp/project_procurement.py'
--- project_mrp/project_procurement.py 2012-09-30 10:59:00 +0000
+++ project_mrp/project_procurement.py 2012-10-02 11:29:53 +0000
@@ -42,7 +42,7 @@
42 return False42 return False
43 return True43 return True
4444
45 def check_produce_service(self, cr, uid, procurement, context=None): 45 def check_produce_service(self, cr, uid, procurement, context=None):
46 return True46 return True
4747
48 def _convert_qty_company_hours(self, cr, uid, procurement, context=None):48 def _convert_qty_company_hours(self, cr, uid, procurement, context=None):
4949
=== modified file 'project_timesheet/project_timesheet.py'
--- project_timesheet/project_timesheet.py 2012-09-29 20:13:26 +0000
+++ project_timesheet/project_timesheet.py 2012-10-02 11:29:53 +0000
@@ -225,7 +225,7 @@
225225
226 return super(task,self).unlink(cr, uid, ids, *args, **kwargs)226 return super(task,self).unlink(cr, uid, ids, *args, **kwargs)
227227
228 def write(self, cr, uid, ids,vals,context=None):228 def write(self, cr, uid, ids, vals, context=None):
229 if context is None:229 if context is None:
230 context = {}230 context = {}
231 if vals.get('project_id',False) or vals.get('name',False):231 if vals.get('project_id',False) or vals.get('name',False):
232232
=== modified file 'project_timesheet/report/task_report.py'
--- project_timesheet/report/task_report.py 2012-07-31 14:47:04 +0000
+++ project_timesheet/report/task_report.py 2012-10-02 11:29:53 +0000
@@ -29,7 +29,7 @@
29 _auto = False29 _auto = False
30 _order = "name"30 _order = "name"
3131
32 def get_hrs_timesheet(self, cr, uid, ids, name,args,context):32 def get_hrs_timesheet(self, cr, uid, ids, name, args, context):
33 result = {}33 result = {}
34 for record in self.browse(cr, uid, ids, context):34 for record in self.browse(cr, uid, ids, context):
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)
3636
=== modified file 'purchase/purchase.py'
--- purchase/purchase.py 2012-09-30 11:40:14 +0000
+++ purchase/purchase.py 2012-10-02 11:29:53 +0000
@@ -31,9 +31,6 @@
31from osv.orm import browse_record, browse_null31from osv.orm import browse_record, browse_null
32from tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT, DATETIME_FORMATS_MAP32from tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT, DATETIME_FORMATS_MAP
3333
34#
35# Model definition
36#
37class purchase_order(osv.osv):34class purchase_order(osv.osv):
3835
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):
@@ -239,7 +236,6 @@
239 else:236 else:
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.'))
241238
242 # TODO: temporary fix in 5.0, to remove in 5.2 when subflows support
243 # automatically sending subflow.delete upon deletion239 # automatically sending subflow.delete upon deletion
244 wf_service = netsvc.LocalService("workflow")240 wf_service = netsvc.LocalService("workflow")
245 for id in unlink_ids:241 for id in unlink_ids:
@@ -333,7 +329,7 @@
333 'view_id': view_id,329 'view_id': view_id,
334 'res_id': pick_ids[0]330 'res_id': pick_ids[0]
335 })331 })
336 332
337 action.update({333 action.update({
338 'context': ctx,334 'context': ctx,
339 })335 })
@@ -380,7 +376,7 @@
380 for line in po.order_line:376 for line in po.order_line:
381 if line.state=='draft':377 if line.state=='draft':
382 todo.append(line.id)378 todo.append(line.id)
383# current_name = self.name_get(cr, uid, ids)[0][1]379
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)
385 for id in ids:381 for id in ids:
386 self.write(cr, uid, [id], {'state' : 'confirmed', 'validator' : uid})382 self.write(cr, uid, [id], {'state' : 'confirmed', 'validator' : uid})
@@ -491,7 +487,7 @@
491 self.invoice_done_send_note(cr, uid, ids, context=context)487 self.invoice_done_send_note(cr, uid, ids, context=context)
492 return True488 return True
493489
494 def has_stockable_product(self,cr, uid, ids, *args):490 def has_stockable_product(self, cr, uid, ids, *args):
495 for order in self.browse(cr, uid, ids):491 for order in self.browse(cr, uid, ids):
496 for order_line in order.order_line:492 for order_line in order.order_line:
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'):
@@ -596,7 +592,7 @@
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)
597 return [picking_id]593 return [picking_id]
598594
599 def action_picking_create(self,cr, uid, ids, context=None):595 def action_picking_create(self, cr, uid, ids, context=None):
600 picking_ids = []596 picking_ids = []
601 for order in self.browse(cr, uid, ids):597 for order in self.browse(cr, uid, ids):
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))
@@ -665,7 +661,7 @@
665 list_key.sort()661 list_key.sort()
666 return tuple(list_key)662 return tuple(list_key)
667663
668 # compute what the new orders should contain664 # Compute what the new orders should contain
669665
670 new_orders = {}666 new_orders = {}
671667
@@ -1098,4 +1094,5 @@
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)
10991095
1100mail_mail()1096mail_mail()
1097
1101# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:1098# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
11021099
=== modified file 'purchase/wizard/purchase_order_group.py'
--- purchase/wizard/purchase_order_group.py 2012-08-07 11:34:14 +0000
+++ purchase/wizard/purchase_order_group.py 2012-10-02 11:29:53 +0000
@@ -88,4 +88,4 @@
8888
89purchase_order_group()89purchase_order_group()
9090
91# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
92\ No newline at end of file91\ No newline at end of file
92# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
9393
=== modified file 'purchase_requisition/purchase_requisition.py'
--- purchase_requisition/purchase_requisition.py 2012-09-29 09:07:50 +0000
+++ purchase_requisition/purchase_requisition.py 2012-10-02 11:29:53 +0000
@@ -207,7 +207,7 @@
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),
208 }208 }
209209
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):
211 """ Changes UoM and name if product_id changes.211 """ Changes UoM and name if product_id changes.
212 @param name: Name of the field212 @param name: Name of the field
213 @param product_id: Changed product_id213 @param product_id: Changed product_id
214214
=== modified file 'report_webkit/ir_report.py'
--- report_webkit/ir_report.py 2011-12-19 16:54:40 +0000
+++ report_webkit/ir_report.py 2012-10-02 11:29:53 +0000
@@ -35,7 +35,7 @@
35from report.report_sxw import rml_parse35from report.report_sxw import rml_parse
3636
37def register_report(name, model, tmpl_path, parser=rml_parse):37def register_report(name, model, tmpl_path, parser=rml_parse):
38 "Register the report into the services"38 """Register the report into the services"""
39 name = 'report.%s' % name39 name = 'report.%s' % name
40 if netsvc.Service._services.get(name, False):40 if netsvc.Service._services.get(name, False):
41 service = netsvc.Service._services[name]41 service = netsvc.Service._services[name]
4242
=== modified file 'report_webkit/report_helper.py'
--- report_webkit/report_helper.py 2011-12-19 16:54:40 +0000
+++ report_webkit/report_helper.py 2012-10-02 11:29:53 +0000
@@ -75,7 +75,7 @@
75 head = header_obj.browse(self.cursor, self.uid, header_img_id)75 head = header_obj.browse(self.cursor, self.uid, header_img_id)
76 return (head.img, head.type)76 return (head.img, head.type)
77 77
78 def embed_logo_by_name(self, name, width=0, height=0) :78 def embed_logo_by_name(self, name, width=0, height=0):
79 """Return HTML embedded logo by name"""79 """Return HTML embedded logo by name"""
80 img, type = self.get_logo_by_name(name)80 img, type = self.get_logo_by_name(name)
81 return self.embed_image(type, img, width, height)81 return self.embed_image(type, img, width, height)
8282
=== modified file 'resource/faces/task.py'
--- resource/faces/task.py 2012-07-25 12:49:45 +0000
+++ resource/faces/task.py 2012-10-02 11:29:53 +0000
@@ -567,7 +567,8 @@
567 return result567 return result
568 #@-node:_cmp568 #@-node:_cmp
569 #@+node:__getattr__569 #@+node:__getattr__
570 def __getattr__(self, name): return getattr(self._value, name)570 def __getattr__(self, name):
571 return getattr(self._value, name)
571 #@-node:__getattr__572 #@-node:__getattr__
572 #@+node:__getitem__573 #@+node:__getitem__
573 def __getitem__(self, slice):574 def __getitem__(self, slice):
574575
=== modified file 'resource/resource.py'
--- resource/resource.py 2012-09-24 16:26:45 +0000
+++ resource/resource.py 2012-10-02 11:29:53 +0000
@@ -438,7 +438,7 @@
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'])
439 ]439 ]
440440
441 def onchange_resource(self,cr, uid, ids, resource, context=None):441 def onchange_resource(self, cr, uid, ids, resource, context=None):
442 result = {}442 result = {}
443 if resource:443 if resource:
444 resource_pool = self.pool.get('resource.resource')444 resource_pool = self.pool.get('resource.resource')
445445
=== modified file 'sale/report/__init__.py'
--- sale/report/__init__.py 2011-01-14 00:11:01 +0000
+++ sale/report/__init__.py 2012-10-02 11:29:53 +0000
@@ -22,4 +22,4 @@
22import sale_order22import sale_order
23import sale_report23import sale_report
2424
25# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
26\ No newline at end of file25\ No newline at end of file
26# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2727
=== modified file 'sale/sale.py'
--- sale/sale.py 2012-09-30 11:40:14 +0000
+++ sale/sale.py 2012-10-02 11:29:53 +0000
@@ -253,7 +253,7 @@
253253
254 return osv.osv.unlink(self, cr, uid, unlink_ids, context=context)254 return osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
255255
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):
257 if (not pricelist_id) or (not order_lines):257 if (not pricelist_id) or (not order_lines):
258 return {}258 return {}
259 warning = {259 warning = {
@@ -262,7 +262,6 @@
262 }262 }
263 return {'warning': warning}263 return {'warning': warning}
264264
265
266 def onchange_partner_id(self, cr, uid, ids, part):265 def onchange_partner_id(self, cr, uid, ids, part):
267 if not part:266 if not part:
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}}
@@ -437,7 +436,9 @@
437 return False436 return False
438 return True437 return True
439438
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):
440 if states is None:
441 states = ['confirmed', 'done', 'exception']
441 res = False442 res = False
442 invoices = {}443 invoices = {}
443 invoice_ids = []444 invoice_ids = []
@@ -648,7 +649,7 @@
648 def cancel_send_note(self, cr, uid, ids, context=None):649 def cancel_send_note(self, cr, uid, ids, context=None):
649 for obj in self.browse(cr, uid, ids, context=context):650 for obj in self.browse(cr, uid, ids, context=context):
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)
651 652
652 def done_send_note(self, cr, uid, ids, context=None):653 def done_send_note(self, cr, uid, ids, context=None):
653 for obj in self.browse(cr, uid, ids, context=context):654 for obj in self.browse(cr, uid, ids, context=context):
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)
@@ -874,12 +875,12 @@
874 context_partner = {'lang': lang, 'partner_id': partner_id}875 context_partner = {'lang': lang, 'partner_id': partner_id}
875876
876 if not product:877 if not product:
877 return {'value': {'th_weight': 0, 878 return {'value': {'th_weight': 0,
878 'product_uos_qty': qty}, 'domain': {'product_uom': [],879 'product_uos_qty': qty}, 'domain': {'product_uom': [],
879 'product_uos': []}}880 'product_uos': []}}
880 if not date_order:881 if not date_order:
881 date_order = time.strftime(DEFAULT_SERVER_DATE_FORMAT)882 date_order = time.strftime(DEFAULT_SERVER_DATE_FORMAT)
882#883
883 result = {}884 result = {}
884 warning_msgs = {}885 warning_msgs = {}
885 product_obj = product_obj.browse(cr, uid, product, context=context)886 product_obj = product_obj.browse(cr, uid, product, context=context)
@@ -995,6 +996,7 @@
995 wf_service = netsvc.LocalService("workflow")996 wf_service = netsvc.LocalService("workflow")
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)
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)
999
998mail_compose_message()1000mail_compose_message()
9991001
1000# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:1002# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
10011003
=== modified file 'sale/wizard/__init__.py'
--- sale/wizard/__init__.py 2012-09-20 13:12:29 +0000
+++ sale/wizard/__init__.py 2012-10-02 11:29:53 +0000
@@ -23,4 +23,4 @@
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: