diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py index 89d9212478c..14b628115f6 100644 --- a/addons/email_template/email_template.py +++ b/addons/email_template/email_template.py @@ -145,7 +145,7 @@ class email_template(osv.osv): # - img src -> check URL # - a href -> check URL for node in root.iter(): - if node.tag == 'a': + if node.tag == 'a' and node.get('href'): node.set('href', _process_link(node.get('href'))) elif node.tag == 'img' and not node.get('src', 'data').startswith('data'): node.set('src', _process_link(node.get('src'))) diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index eb8a09678e7..fe4d0ee5630 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -277,7 +277,6 @@ class hr_expense_expense(osv.osv): if not mres: continue res.append(mres) - tax_code_found= False #Calculate tax according to default tax on product taxes = [] @@ -295,32 +294,28 @@ class hr_expense_expense(osv.osv): a = product.categ_id.property_account_expense_categ.id a = fpos_obj.map_account(cr, uid, fpos, a) taxes = a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False - tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes) if not taxes: continue + tax_l = [] #Calculating tax on the line and creating move? for tax in tax_obj.compute_all(cr, uid, taxes, line.unit_amount , line.unit_quantity, line.product_id, exp.user_id.partner_id)['taxes']: tax_code_id = tax['base_code_id'] - tax_amount = line.total_amount * tax['base_sign'] - if tax_code_found: - if not tax_code_id: - continue - res.append(self.move_line_get_item(cr, uid, line, context)) - res[-1]['price'] = 0.0 - res[-1]['account_analytic_id'] = False - elif not tax_code_id: + if not tax_code_id: continue - tax_code_found = True res[-1]['tax_code_id'] = tax_code_id - res[-1]['tax_amount'] = cur_obj.compute(cr, uid, exp.currency_id.id, company_currency, tax_amount, context={'date': exp.date_confirm}) ## is_price_include = tax_obj.read(cr,uid,tax['id'],['price_include'],context)['price_include'] if is_price_include: ## We need to deduce the price for the tax res[-1]['price'] = res[-1]['price'] - (tax['amount'] * tax['base_sign'] or 0.0) + # tax amount countains base amount without the tax + tax_amount = (line.total_amount - tax['amount']) * tax['base_sign'] + else: + tax_amount = line.total_amount * tax['base_sign'] + res[-1]['tax_amount'] = cur_obj.compute(cr, uid, exp.currency_id.id, company_currency, tax_amount, context={'date': exp.date_confirm}) assoc_tax = { 'type':'tax', 'name':tax['name'], @@ -331,7 +326,8 @@ class hr_expense_expense(osv.osv): 'tax_code_id': tax['tax_code_id'], 'tax_amount': tax['amount'] * tax['base_sign'], } - res.append(assoc_tax) + tax_l.append(assoc_tax) + res += tax_l return res def move_line_get_item(self, cr, uid, line, context=None): diff --git a/addons/l10n_ro/res_partner.py b/addons/l10n_ro/res_partner.py index 610f629b5d4..89226125157 100755 --- a/addons/l10n_ro/res_partner.py +++ b/addons/l10n_ro/res_partner.py @@ -32,7 +32,7 @@ class res_partner(osv.osv): def _auto_init(self, cr, context=None): result = super(res_partner, self)._auto_init(cr, context=context) # Remove constrains for vat, nrc on "commercial entities" because is not mandatory by legislation - # Even that VAT numbers are unique, the NRC field is not unique, and there are certain entities that + # Even that VAT numbers are unique, the NRC field is not unique, and there are certain entities that # doesn't have a NRC number plus the formatting was changed few times, so we cannot have a base rule for # checking if available and emmited by the Ministry of Finance, only online on their website. diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 00a1bd18e42..cef0ac10e6b 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -111,7 +111,7 @@ class mail_thread(osv.AbstractModel): model = context.get('empty_list_help_model') res_id = context.get('empty_list_help_id') ir_config_parameter = self.pool.get("ir.config_parameter") - catchall_domain = ir_config_parameter.get_param(cr, uid, "mail.catchall.domain", context=context) + catchall_domain = ir_config_parameter.get_param(cr, SUPERUSER_ID, "mail.catchall.domain", context=context) document_name = context.get('empty_list_help_document_name', _('document')) alias = None diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index a349c82ba2d..04f4ef8b4ef 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -343,7 +343,7 @@ class mrp_repair(osv.osv): 'origin': repair.name, 'type': 'out_invoice', 'account_id': account_id, - 'partner_id': repair.partner_id.id, + 'partner_id': repair.partner_invoice_id.id or repair.partner_id.id, 'currency_id': repair.pricelist_id.currency_id.id, 'comment': repair.quotation_notes, 'fiscal_position': repair.partner_id.property_account_position.id diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 42064fb937e..2c729f4db56 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -296,6 +296,7 @@ kanban,tree,form form + {"search_default_filter_to_sell":1} +