diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index b01fc974bef..b37118c3baa 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -983,13 +983,13 @@ class account_invoice(osv.osv): for i in line: i[2]['period_id'] = period_id + ctx.update(invoice=inv) move_id = move_obj.create(cr, uid, move, context=ctx) new_move_name = move_obj.browse(cr, uid, move_id, context=ctx).name # make the invoice point to that move self.write(cr, uid, [inv.id], {'move_id': move_id,'period_id':period_id, 'move_name':new_move_name}, context=ctx) # Pass invoice in context in method post: used if you want to get the same # account move reference when creating the same invoice after a cancelled one: - ctx.update({'invoice':inv}) move_obj.post(cr, uid, [move_id], context=ctx) self._log_event(cr, uid, ids) return True diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 0b918d9874c..3ca45a1dd80 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -208,7 +208,7 @@ class account_move_line(osv.osv): if type(period_id) == str: ids = period_obj.search(cr, uid, [('name', 'ilike', period_id)]) context.update({ - 'period_id': ids[0] + 'period_id': ids and ids[0] or False }) return context diff --git a/addons/account/account_report.xml b/addons/account/account_report.xml index d258bb0b140..0017409f416 100644 --- a/addons/account/account_report.xml +++ b/addons/account/account_report.xml @@ -41,13 +41,5 @@ groups="group_account_user,group_account_manager" parent="account.menu_finance_generic_reporting" sequence="3"/> - - diff --git a/addons/account/report/account_financial_report.rml b/addons/account/report/account_financial_report.rml index 6f0ddd0d625..1ee8d5b1858 100644 --- a/addons/account/report/account_financial_report.rml +++ b/addons/account/report/account_financial_report.rml @@ -170,12 +170,12 @@ Chart of Accounts Fiscal Year - Filter By [[ get_filter(data)!='No Filter' and get_filter(data) ]] + Filter By [[ get_filter(data)!='No Filters' and get_filter(data) ]] [[ get_account(data) or removeParentNode('para') ]] [[ get_fiscalyear(data) or '' ]] - [[ get_filter(data)=='No Filter' and get_filter(data) or removeParentNode('para') ]] + [[ get_filter(data)=='No Filters' and get_filter(data) or removeParentNode('para') ]] [[ get_filter(data)=='Date' or removeParentNode('blockTable') ]] Start Date diff --git a/addons/account/report/account_general_ledger.py b/addons/account/report/account_general_ledger.py index 294c7fa99cf..38f2392f740 100644 --- a/addons/account/report/account_general_ledger.py +++ b/addons/account/report/account_general_ledger.py @@ -299,10 +299,10 @@ class general_ledger(report_sxw.rml_parse, common_report_header): def _get_sortby(self, data): if self.sortby == 'sort_date': - return 'Date' + return self._translate('Date') elif self.sortby == 'sort_journal_partner': - return 'Journal & Partner' - return 'Date' + return self._translate('Journal & Partner') + return self._translate('Date') report_sxw.report_sxw('report.account.general.ledger', 'account.account', 'addons/account/report/account_general_ledger.rml', parser=general_ledger, header='internal') report_sxw.report_sxw('report.account.general.ledger_landscape', 'account.account', 'addons/account/report/account_general_ledger_landscape.rml', parser=general_ledger, header='internal landscape') diff --git a/addons/account/report/common_report_header.py b/addons/account/report/common_report_header.py index c93c3e02ee3..c5719d98b96 100644 --- a/addons/account/report/common_report_header.py +++ b/addons/account/report/common_report_header.py @@ -94,10 +94,10 @@ class common_report_header(object): def _get_filter(self, data): if data.get('form', False) and data['form'].get('filter', False): if data['form']['filter'] == 'filter_date': - return 'Date' + return self._translate('Date') elif data['form']['filter'] == 'filter_period': - return 'Periods' - return 'No Filter' + return self._translate('Periods') + return self._translate('No Filters') def _sum_debit_period(self, period_id, journal_id=None): journals = journal_id or self.journal_ids diff --git a/addons/account/wizard/account_fiscalyear_close.py b/addons/account/wizard/account_fiscalyear_close.py index 196c14d3792..dbf815d5218 100644 --- a/addons/account/wizard/account_fiscalyear_close.py +++ b/addons/account/wizard/account_fiscalyear_close.py @@ -226,7 +226,7 @@ class account_fiscalyear_close(osv.osv_memory): for account in obj_acc_account.browse(cr, uid, account_ids, context={'fiscalyear': fy_id}): balance_in_currency = 0.0 if account.currency_id: - cr.execute('SELECT sum(amount_currency) as balance_in_currency FROM account_move_line ' \ + cr.execute('SELECT sum(COALESCE(amount_currency,0.0)) as balance_in_currency FROM account_move_line ' \ 'WHERE account_id = %s ' \ 'AND ' + query_line + ' ' \ 'AND currency_id = %s', (account.id, account.currency_id.id)) diff --git a/addons/account/wizard/account_report_common.py b/addons/account/wizard/account_report_common.py index 9acc09e9026..eea0650b6ff 100644 --- a/addons/account/wizard/account_report_common.py +++ b/addons/account/wizard/account_report_common.py @@ -119,7 +119,11 @@ class account_common_report(osv.osv_memory): def _get_fiscalyear(self, cr, uid, context=None): now = time.strftime('%Y-%m-%d') - fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, [('date_start', '<', now), ('date_stop', '>', now)], limit=1 ) + company_id = None + ids = context.get('active_ids', []) + for wiz in self.browse(cr, uid, ids, context=context): + company_id = wiz.company_id + fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, [('date_start', '<', now), ('date_stop', '>', now), ('company_id', '=', company_id)], limit=1 ) return fiscalyears and fiscalyears[0] or False def _get_all_journal(self, cr, uid, context=None): diff --git a/addons/account_analytic_plans/account_analytic_plans_view.xml b/addons/account_analytic_plans/account_analytic_plans_view.xml index 76d6aeed7b8..0b0142ef223 100644 --- a/addons/account_analytic_plans/account_analytic_plans_view.xml +++ b/addons/account_analytic_plans/account_analytic_plans_view.xml @@ -21,17 +21,17 @@ - + - + - + diff --git a/addons/account_anglo_saxon/invoice.py b/addons/account_anglo_saxon/invoice.py index 693283b870b..26271015b7e 100644 --- a/addons/account_anglo_saxon/invoice.py +++ b/addons/account_anglo_saxon/invoice.py @@ -40,7 +40,7 @@ class account_invoice_line(osv.osv): if inv.type in ('out_invoice','out_refund'): for i_line in inv.invoice_line: - if i_line.product_id: + if i_line.product_id and i_line.product_id.valuation == 'real_time': if inv.type == 'out_invoice': # debit account dacc will be the output account # first check the product, if empty check the category @@ -87,7 +87,7 @@ class account_invoice_line(osv.osv): }) elif inv.type in ('in_invoice','in_refund'): for i_line in inv.invoice_line: - if i_line.product_id: + if i_line.product_id and i_line.product_id.valuation == 'real_time': if i_line.product_id.type != 'service': # get the price difference account at the product acc = i_line.product_id.property_account_creditor_price_difference and i_line.product_id.property_account_creditor_price_difference.id diff --git a/addons/account_sequence/account_sequence_data.xml b/addons/account_sequence/account_sequence_data.xml index 1ad362b3979..b2d40412d0d 100644 --- a/addons/account_sequence/account_sequence_data.xml +++ b/addons/account_sequence/account_sequence_data.xml @@ -43,6 +43,18 @@ + + Account Journal + account.journal + + + + Account journal sequence + account.journal + AJ + + + diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 8bd9a48b1f4..650496e110e 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -953,6 +953,9 @@ class account_voucher(osv.osv): if voucher_brw.number: name = voucher_brw.number elif voucher_brw.journal_id.sequence_id: + if not voucher_brw.journal_id.sequence_id.active: + raise osv.except_osv(_('Configuration Error !'), + _('Please activate the sequence of selected journal !')) name = seq_obj.next_by_id(cr, uid, voucher_brw.journal_id.sequence_id.id, context=context) else: raise osv.except_osv(_('Error!'), diff --git a/addons/account_voucher/voucher_sales_purchase_view.xml b/addons/account_voucher/voucher_sales_purchase_view.xml index dd6917358a9..0a0ad94c870 100644 --- a/addons/account_voucher/voucher_sales_purchase_view.xml +++ b/addons/account_voucher/voucher_sales_purchase_view.xml @@ -50,7 +50,7 @@ account.voucher form [('journal_id.type', 'in', ['bank', 'cash']), ('type','=','receipt'), ('partner_id','=',partner_id)] - {'type':'receipt', 'partner_id': partner_id, 'default_reference':reference} + {'default_type':'receipt', 'type':'receipt', 'partner_id': partner_id, 'default_reference':reference} current diff --git a/addons/audittrail/audittrail.py b/addons/audittrail/audittrail.py index 9232a696da8..45ab0c4fbb1 100644 --- a/addons/audittrail/audittrail.py +++ b/addons/audittrail/audittrail.py @@ -388,6 +388,8 @@ class audittrail_objects_proxy(object_proxy): } # loop on all the fields for field_name, field_definition in pool.get(model.model)._all_columns.items(): + if field_name in ('__last_update', 'id'): + continue #if the field_list param is given, skip all the fields not in that list if field_list and field_name not in field_list: continue diff --git a/addons/audittrail/audittrail_view.xml b/addons/audittrail/audittrail_view.xml index c26e1b5b570..5d5bdcc6c21 100644 --- a/addons/audittrail/audittrail_view.xml +++ b/addons/audittrail/audittrail_view.xml @@ -99,7 +99,7 @@ -
diff --git a/addons/document/nodes.py b/addons/document/nodes.py index 6bcb2237a9e..aeb2e64fc97 100644 --- a/addons/document/nodes.py +++ b/addons/document/nodes.py @@ -823,6 +823,7 @@ class node_res_dir(node_class): uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) + ctx.update(self.context.extra_ctx) where = [] if self.domain: app = safe_eval(self.domain, ctx) diff --git a/addons/document_page/wizard/document_page_show_diff.py b/addons/document_page/wizard/document_page_show_diff.py index ab5572768f4..13e8e79b3b7 100644 --- a/addons/document_page/wizard/document_page_show_diff.py +++ b/addons/document_page/wizard/document_page_show_diff.py @@ -43,7 +43,7 @@ class showdiff(osv.osv_memory): elif len(ids) == 1: old = history.browse(cr, uid, ids[0]) - nids = history.search(cr, uid, [('document_id', '=', old.document_id.id)]) + nids = history.search(cr, uid, [('page_id', '=', old.page_id.id)]) nids.sort() diff = history.getDiff(cr, uid, ids[0], nids[-1]) else: diff --git a/addons/document_webdav/document_webdav.py b/addons/document_webdav/document_webdav.py index 3b604d6cffb..ad44a58ac26 100644 --- a/addons/document_webdav/document_webdav.py +++ b/addons/document_webdav/document_webdav.py @@ -51,9 +51,10 @@ class document_davdir(osv.osv): # that might be not worth preparing. nctx.extra_ctx['webdav_path'] = '/'+config.get_misc('webdav','vdir','webdav') usr_obj = self.pool.get('res.users') - res = usr_obj.read(cr, uid, uid, ['login']) + res = usr_obj.read(cr, uid, uid, ['login','context_lang']) if res: nctx.extra_ctx['username'] = res['login'] + nctx.extra_ctx['lang'] = res['context_lang'] # TODO group return diff --git a/addons/hr_attendance/report/attendance_by_month.py b/addons/hr_attendance/report/attendance_by_month.py index f104b9c287a..6d41869ff23 100644 --- a/addons/hr_attendance/report/attendance_by_month.py +++ b/addons/hr_attendance/report/attendance_by_month.py @@ -31,6 +31,7 @@ from report.interface import toxml from report import report_sxw from tools import ustr from tools.translate import _ +from tools import to_xml one_day = relativedelta(days=1) month2name = [0, 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] @@ -111,7 +112,7 @@ class report_custom(report_rml): %s %s - ''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,uid).company_id.name) + ''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),to_xml(pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,uid).company_id.name)) first_date = str(month) som = datetime.strptime(first_date, '%Y-%m-%d %H:%M:%S') diff --git a/addons/hr_holidays/report/holidays_summary_report.py b/addons/hr_holidays/report/holidays_summary_report.py index 8a782075853..cadd3a22ce6 100644 --- a/addons/hr_holidays/report/holidays_summary_report.py +++ b/addons/hr_holidays/report/holidays_summary_report.py @@ -31,6 +31,7 @@ import time from report import report_sxw from tools import ustr from tools.translate import _ +from tools import to_xml def lengthmonth(year, month): if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))): @@ -240,7 +241,7 @@ class report_custom(report_rml): %s %s - ''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,uid).company_id.name) + ''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),to_xml(pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,uid).company_id.name)) # Computing the xml xml=''' diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index 53c84c65ee6..640d4ed3cfd 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -326,6 +326,7 @@ class hr_payslip(osv.osv): return self.write(cr, uid, ids, {'paid': True, 'state': 'done'}, context=context) def hr_verify_sheet(self, cr, uid, ids, context=None): + self.compute_sheet(cr, uid, ids, context) return self.write(cr, uid, ids, {'state': 'verify'}, context=context) def refund_sheet(self, cr, uid, ids, context=None): diff --git a/addons/hr_timesheet/report/user_timesheet.py b/addons/hr_timesheet/report/user_timesheet.py index 7699f94f41b..8d2a7d35678 100644 --- a/addons/hr_timesheet/report/user_timesheet.py +++ b/addons/hr_timesheet/report/user_timesheet.py @@ -28,6 +28,7 @@ import time import pooler from report import report_sxw from tools import ustr +from tools import to_xml def lengthmonth(year, month): if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))): @@ -94,7 +95,7 @@ class report_custom(report_rml): %s %s - ''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,user_id).company_id.name) + ''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),to_xml(pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,user_id).company_id.name)) account_xml = [] for account, telems in accounts.iteritems(): diff --git a/addons/hr_timesheet/wizard/hr_timesheet_print_employee.py b/addons/hr_timesheet/wizard/hr_timesheet_print_employee.py index 75bb089bbc7..96ce23fb855 100644 --- a/addons/hr_timesheet/wizard/hr_timesheet_print_employee.py +++ b/addons/hr_timesheet/wizard/hr_timesheet_print_employee.py @@ -27,8 +27,9 @@ class analytical_timesheet_employee(osv.osv_memory): _name = 'hr.analytical.timesheet.employee' _description = 'Print Employee Timesheet & Print My Timesheet' _columns = { - 'month': fields.selection([(x, datetime.date(2000, x, 1).strftime('%B')) for x in range(1, 13)], - 'Month', required=True), + 'month': fields.selection([(1,'January'), (2,'February'), (3,'March'), (4,'April'), + (5,'May'), (6,'June'), (7,'July'), (8,'August'), (9,'September'), + (10,'October'), (11,'November'), (12,'December')], 'Month', required=True), 'year': fields.integer('Year', required=True), 'employee_id': fields.many2one('hr.employee', 'Employee', required=True) diff --git a/addons/hr_timesheet/wizard/hr_timesheet_print_users.py b/addons/hr_timesheet/wizard/hr_timesheet_print_users.py index 865ccacb393..2a91bb607a4 100644 --- a/addons/hr_timesheet/wizard/hr_timesheet_print_users.py +++ b/addons/hr_timesheet/wizard/hr_timesheet_print_users.py @@ -27,8 +27,9 @@ class analytical_timesheet_employees(osv.osv_memory): _name = 'hr.analytical.timesheet.users' _description = 'Print Employees Timesheet' _columns = { - 'month': fields.selection([(x, datetime.date(2000, x, 1).strftime('%B')) for x in range(1, 13)], - 'Month', required=True), + 'month': fields.selection([(1,'January'), (2,'February'), (3,'March'), (4,'April'), + (5,'May'), (6,'June'), (7,'July'), (8,'August'), (9,'September'), + (10,'October'), (11,'November'), (12,'December')], 'Month', required=True), 'year': fields.integer('Year', required=True), 'employee_ids': fields.many2many('hr.employee', 'timesheet_employee_rel', 'timesheet_id', 'employee_id', 'employees', required=True) } diff --git a/addons/l10n_ch/bank.py b/addons/l10n_ch/bank.py index 79dcb1a6834..4e4c0e0aa8c 100644 --- a/addons/l10n_ch/bank.py +++ b/addons/l10n_ch/bank.py @@ -52,21 +52,6 @@ class ResPartnerBank(osv.osv): 'my_bank': fields.boolean('Use my account to print BVR ?', help="Check to print BVR invoices"), } - def name_get(self, cursor, uid, ids, context=None): - if not len(ids): - return [] - bank_type_obj = self.pool.get('res.partner.bank.type') - - type_ids = bank_type_obj.search(cursor, uid, []) - bank_type_names = {} - for bank_type in bank_type_obj.browse(cursor, uid, type_ids, - context=context): - bank_type_names[bank_type.code] = bank_type.name - res = [] - for r in self.read(cursor, uid, ids, ['name','state'], context): - res.append((r['id'], r['name']+' : '+bank_type_names.get(r['state'], ''))) - return res - def _prepare_name(self, bank): "Hook to get bank number of bank account" res = u'' diff --git a/addons/l10n_it/data/account.tax.code.template.csv b/addons/l10n_it/data/account.tax.code.template.csv index 290396052f4..d6d6667f43b 100644 --- a/addons/l10n_it/data/account.tax.code.template.csv +++ b/addons/l10n_it/data/account.tax.code.template.csv @@ -60,6 +60,3 @@ IVC21det40,template_ivacode_pagata_21det40,IVA a credito 21% detraibile 40%,temp IVC21Idet40,template_impcode_pagata_21det40,IVA a credito 21% detraibile 40% (imponibile),template_impcode_pagata IVC21det50,template_ivacode_pagata_21det50,IVA a credito 21% detraibile 50%,template_ivacode_pagata IVC21Idet50,template_impcode_pagata_21det50,IVA a credito 21% detraibile 50% (imponibile),template_impcode_pagata -Rit,template_ra,Ritenute d'acconto,vat_code_chart_root -RitD20,template_ritcode_20,Ritenute a debito 20%,template_ra -RitD20I,template_ritimpcode_20,Ritenute a debito 20% (imponibile),template_ra diff --git a/addons/l10n_it/data/account.tax.template.csv b/addons/l10n_it/data/account.tax.template.csv index 36c4f99db79..641f495dd72 100644 --- a/addons/l10n_it/data/account.tax.template.csv +++ b/addons/l10n_it/data/account.tax.template.csv @@ -62,4 +62,3 @@ id,description,chart_template_id:id,name,sequence,amount,parent_id:id,child_depe 21I5,21I5,l10n_it_chart_template_generic,IVA al 21% detraibile al 50%,,0.21,,True,percent,,,purchase,template_impcode_pagata_21det50,,template_impcode_pagata_21det50,,,,False,-1,-1 21I5b,21I5b,l10n_it_chart_template_generic,IVA al 21% detraibile al 50% (I),1,0.5,21I5,False,percent,,,purchase,,,,,,,False,, 21I5a,21I5a,l10n_it_chart_template_generic,IVA al 21% detraibile al 50% (D),2,0,21I5,False,balance,1601,1601,purchase,,template_ivacode_pagata_21det50,,template_ivacode_pagata_21det50,,,False,, -rit-20,rit-20,l10n_it_chart_template_generic,Ritenuta d'acconto al 20% (debito),,-0.2,,False,percent,2602,2602,purchase,template_ritimpcode_20,template_ritcode_20,template_ritimpcode_20,template_ritcode_20,-1,1,False,1,-1 diff --git a/addons/mrp/report/price.py b/addons/mrp/report/price.py index 527505d8ea5..b1e04749ab2 100644 --- a/addons/mrp/report/price.py +++ b/addons/mrp/report/price.py @@ -111,7 +111,7 @@ class report_custom(report_rml): 595.27 841.88 55.00mm,58.00mm,29.00mm,29.00mm,29.00mm - """ % (user_pool.browse(cr, uid, uid).company_id.name) + """ % to_xml(user_pool.browse(cr, uid, uid).company_id.name) config_stop = """ Generated by OpenERP diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index bc9b9413c65..d79620ce93c 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -690,7 +690,7 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): 'repair_id': fields.many2one('mrp.repair', 'Repair Order Reference',ondelete='cascade', select=True), 'type': fields.selection([('add','Add'),('remove','Remove')],'Type', required=True), 'to_invoice': fields.boolean('To Invoice'), - 'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok','=',True)], required=True), + 'product_id': fields.many2one('product.product', 'Product', required=True), 'invoiced': fields.boolean('Invoiced',readonly=True), 'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Product Price')), 'price_subtotal': fields.function(_amount_line, string='Subtotal',digits_compute= dp.get_precision('Account')), diff --git a/addons/point_of_sale/report/pos_receipt.py b/addons/point_of_sale/report/pos_receipt.py index 2ee6b2e3360..58044c28c77 100644 --- a/addons/point_of_sale/report/pos_receipt.py +++ b/addons/point_of_sale/report/pos_receipt.py @@ -34,7 +34,7 @@ class order(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(order, self).__init__(cr, uid, name, context=context) - user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid) + user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context) partner = user.company_id.partner_id self.localcontext.update({ diff --git a/addons/portal/wizard/share_wizard.py b/addons/portal/wizard/share_wizard.py index b1b6e980dec..51e5e59eb0e 100644 --- a/addons/portal/wizard/share_wizard.py +++ b/addons/portal/wizard/share_wizard.py @@ -35,8 +35,8 @@ class share_wizard_portal(osv.TransientModel): def _user_type_selection(self, cr, uid, context=None): selection = super(share_wizard_portal, self)._user_type_selection(cr, uid, context=context) - selection.extend([('existing','Users you already shared with'), - ('groups','Existing Groups (e.g Portal Groups)')]) + selection.extend([('existing',_('Users you already shared with')), + ('groups',_('Existing Groups (e.g Portal Groups)'))]) return selection _columns = { diff --git a/addons/project/project.py b/addons/project/project.py index df422f4cc8f..42df632851a 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -166,17 +166,17 @@ class project(osv.osv): res[id]['progress_rate'] = 0.0 return res - def unlink(self, cr, uid, ids, *args, **kwargs): + def unlink(self, cr, uid, ids, context=None): alias_ids = [] mail_alias = self.pool.get('mail.alias') - for proj in self.browse(cr, uid, ids): + for proj in self.browse(cr, uid, ids, context=context): if proj.tasks: raise osv.except_osv(_('Invalid Action!'), _('You cannot delete a project containing tasks. You can either delete all the project\'s tasks and then delete the project or simply deactivate the project.')) elif proj.alias_id: alias_ids.append(proj.alias_id.id) - res = super(project, self).unlink(cr, uid, ids, *args, **kwargs) - mail_alias.unlink(cr, uid, alias_ids, *args, **kwargs) + res = super(project, self).unlink(cr, uid, ids, context=context) + mail_alias.unlink(cr, uid, alias_ids, context=context) return res def _get_attached_docs(self, cr, uid, ids, field_name, arg, context): diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 200be4a593a..0227e74905f 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -46,7 +46,7 @@ class purchase_order(osv.osv): cur = order.pricelist_id.currency_id for line in order.order_line: val1 += line.price_subtotal - for c in self.pool.get('account.tax').compute_all(cr, uid, line.taxes_id, line.price_unit, line.product_qty, line.product_id.id, order.partner_id)['taxes']: + for c in self.pool.get('account.tax').compute_all(cr, uid, line.taxes_id, line.price_unit, line.product_qty, line.product_id, order.partner_id)['taxes']: val += c.get('amount', 0.0) res[order.id]['amount_tax']=cur_obj.round(cr, uid, cur, val) res[order.id]['amount_untaxed']=cur_obj.round(cr, uid, cur, val1) @@ -823,7 +823,7 @@ class purchase_order_line(osv.osv): cur_obj=self.pool.get('res.currency') tax_obj = self.pool.get('account.tax') for line in self.browse(cr, uid, ids, context=context): - taxes = tax_obj.compute_all(cr, uid, line.taxes_id, line.price_unit, line.product_qty) + taxes = tax_obj.compute_all(cr, uid, line.taxes_id, line.price_unit, line.product_qty, line.product_id, line.order_id.partner_id) cur = line.order_id.pricelist_id.currency_id res[line.id] = cur_obj.round(cr, uid, cur, taxes['total']) return res diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 033dd778f1f..543bd9a9173 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -903,7 +903,7 @@ class sale_order_line(osv.osv): result = {} warning_msgs = {} - product_obj = product_obj.browse(cr, uid, product, context=context) + product_obj = product_obj.browse(cr, uid, product, context=context_partner) uom2 = False if uom: @@ -922,7 +922,7 @@ class sale_order_line(osv.osv): result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_obj.taxes_id) if not flag: - result['name'] = self.pool.get('product.product').name_get(cr, uid, [product_obj.id], context=context_partner)[0][1] + result['name'] = product_obj.name_get(cr, uid, [product_obj.id], context=context_partner)[0][1] if product_obj.description_sale: result['name'] += '\n'+product_obj.description_sale domain = {} diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py index 360b1eff159..6a1f5681f4f 100644 --- a/addons/share/wizard/share_wizard.py +++ b/addons/share/wizard/share_wizard.py @@ -74,7 +74,7 @@ class share_wizard(osv.TransientModel): def _user_type_selection(self, cr, uid, context=None): """Selection values may be easily overridden/extended via inheritance""" - return [('embedded', 'Direct link or embed code'), ('emails','Emails'), ] + return [('embedded', _('Direct link or embed code')), ('emails',_('Emails')), ] """Override of create() to auto-compute the action name""" def create(self, cr, uid, values, context=None): diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 606cb9247d5..ee8d57a50c7 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1351,14 +1351,14 @@ class stock_picking(osv.osv): wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr) # Then we finish the good picking self.write(cr, uid, [pick.id], {'backorder_id': new_picking}) - self.action_move(cr, uid, [new_picking]) + self.action_move(cr, uid, [new_picking], context=context) wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_done', cr) wf_service.trg_write(uid, 'stock.picking', pick.id, cr) delivered_pack_id = new_picking back_order_name = self.browse(cr, uid, delivered_pack_id, context=context).name self.back_order_send_note(cr, uid, ids, back_order_name, context) else: - self.action_move(cr, uid, [pick.id]) + self.action_move(cr, uid, [pick.id], context=context) wf_service.trg_validate(uid, 'stock.picking', pick.id, 'button_done', cr) delivered_pack_id = pick.id self.ship_done_send_note(cr, uid, ids, context) @@ -2123,7 +2123,7 @@ class stock_move(osv.osv): old_ptype = location_obj.picking_type_get(cr, uid, picking.move_lines[0].location_id, picking.move_lines[0].location_dest_id) if old_ptype != picking.type: old_pick_name = seq_obj.get(cr, uid, 'stock.picking.' + old_ptype) - self.pool.get('stock.picking').write(cr, uid, [picking.id], {'name': old_pick_name}, context=context) + self.pool.get('stock.picking').write(cr, uid, [picking.id], {'name': old_pick_name, 'type': old_ptype}, context=context) else: pickid = False for move, (loc, dummy, delay, dummy, company_id, ptype) in todo: diff --git a/addons/stock/wizard/stock_fill_inventory.py b/addons/stock/wizard/stock_fill_inventory.py index 11907b674a1..8422412a254 100644 --- a/addons/stock/wizard/stock_fill_inventory.py +++ b/addons/stock/wizard/stock_fill_inventory.py @@ -79,8 +79,6 @@ class stock_fill_inventory(osv.osv_memory): inventory_line_obj = self.pool.get('stock.inventory.line') location_obj = self.pool.get('stock.location') - product_obj = self.pool.get('product.product') - stock_location_obj = self.pool.get('stock.location') move_obj = self.pool.get('stock.move') uom_obj = self.pool.get('product.uom') if ids and len(ids):