diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py index bb5cfdd67eb..bda14f6b089 100644 --- a/addons/account/models/account_payment.py +++ b/addons/account/models/account_payment.py @@ -218,6 +218,19 @@ class account_payment(models.Model): # FIXME: ondelete='restrict' not working (eg. cancel a bank statement reconciliation with a payment) move_line_ids = fields.One2many('account.move.line', 'payment_id', readonly=True, copy=False, ondelete='restrict') + def open_payment_matching_screen(self): + # Open reconciliation view for customers/suppliers + action_context = {'company_ids': [self.company_id.id], 'partner_ids': [self.partner_id.commercial_partner_id.id]} + if self.partner_type == 'customer': + action_context.update({'mode': 'customers'}) + elif self.partner_type == 'supplier': + action_context.update({'mode': 'suppliers'}) + return { + 'type': 'ir.actions.client', + 'tag': 'manual_reconciliation_view', + 'context': action_context, + } + @api.one @api.depends('invoice_ids', 'payment_type', 'partner_type', 'partner_id') def _compute_destination_account_id(self): diff --git a/addons/account/models/partner.py b/addons/account/models/partner.py index d59883d99e1..bb90a2b2bfe 100644 --- a/addons/account/models/partner.py +++ b/addons/account/models/partner.py @@ -268,7 +268,7 @@ class ResPartner(models.Model): all_partner_ids = [] for partner in self: # price_total is in the company currency - all_partners_and_children[partner] = self.search([('id', 'child_of', partner.id)]).ids + all_partners_and_children[partner] = self.with_context(active_test=False).search([('id', 'child_of', partner.id)]).ids all_partner_ids += all_partners_and_children[partner] # searching account.invoice.report via the orm is comparatively expensive diff --git a/addons/hr_expense/models/hr_expense.py b/addons/hr_expense/models/hr_expense.py index fbf6b8ae755..ca045d82da6 100644 --- a/addons/hr_expense/models/hr_expense.py +++ b/addons/hr_expense/models/hr_expense.py @@ -284,7 +284,7 @@ class HrExpense(models.Model): account_move.append(move_line) # Calculate tax lines and adjust base line - taxes = expense.tax_ids.compute_all(expense.unit_amount, expense.currency_id, expense.quantity, expense.product_id) + taxes = expense.tax_ids.with_context(round=True).compute_all(expense.unit_amount, expense.currency_id, expense.quantity, expense.product_id) account_move[-1]['price'] = taxes['total_excluded'] account_move[-1]['tax_ids'] = [(6, 0, expense.tax_ids.ids)] for tax in taxes['taxes']: diff --git a/addons/hr_expense/wizard/hr_expense_register_payment.py b/addons/hr_expense/wizard/hr_expense_register_payment.py index b608b234144..6bd7e1d3b44 100644 --- a/addons/hr_expense/wizard/hr_expense_register_payment.py +++ b/addons/hr_expense/wizard/hr_expense_register_payment.py @@ -88,6 +88,10 @@ class HrExpenseRegisterPaymentWizard(models.TransientModel): for line in payment.move_line_ids + expense_sheet.account_move_id.line_ids: if line.account_id.internal_type == 'payable': account_move_lines_to_reconcile |= line - account_move_lines_to_reconcile.reconcile() + # DO NOT FORWARD-PORT! ONLY FOR v10 + if len(expense_sheet.expense_line_ids) > 1: + return payment.open_payment_matching_screen() + else: + account_move_lines_to_reconcile.reconcile() return {'type': 'ir.actions.act_window_close'} diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index bf7d41ffc72..c25c8a36b30 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -174,10 +174,10 @@ class MailThread(models.AbstractModel): RIGHT JOIN mail_channel_partner cp ON (cp.channel_id = rel.mail_channel_id AND cp.partner_id = %s AND (cp.seen_message_id IS NULL OR cp.seen_message_id < msg.id)) - WHERE msg.model = %s AND msg.res_id in %s AND + WHERE msg.model = %s AND msg.res_id = ANY(%s) AND (msg.author_id IS NULL OR msg.author_id != %s) AND (msg.message_type != 'notification' OR msg.model != 'mail.channel')""", - (partner_id, self._name, tuple(self.ids) or (None,), partner_id,)) + (partner_id, self._name, list(self.ids), partner_id,)) for result in self._cr.fetchall(): res[result[0]] += 1 diff --git a/addons/pos_cache/models/pos_cache.py b/addons/pos_cache/models/pos_cache.py index fb0fb20641e..eed948b7981 100644 --- a/addons/pos_cache/models/pos_cache.py +++ b/addons/pos_cache/models/pos_cache.py @@ -23,10 +23,10 @@ class pos_cache(models.Model): @api.one def refresh_cache(self): - products = self.env['product.product'].search(self.get_product_domain()) + Product = self.env['product.product'].sudo(self.compute_user_id.id) + products = Product.search(self.get_product_domain()) prod_ctx = products.with_context(pricelist=self.config_id.pricelist_id.id, display_default_code=False, lang=self.compute_user_id.lang) - prod_ctx = prod_ctx.sudo(self.compute_user_id.id) res = prod_ctx.read(self.get_product_fields()) datas = { 'cache': base64.encodestring(cPickle.dumps(res)), diff --git a/addons/sale/models/account_invoice.py b/addons/sale/models/account_invoice.py index 57e2dc7d70a..1ed8cda461b 100644 --- a/addons/sale/models/account_invoice.py +++ b/addons/sale/models/account_invoice.py @@ -102,6 +102,5 @@ class AccountInvoiceLine(models.Model): 'invoice_line_id', 'order_line_id', string='Sales Order Lines', readonly=True, copy=False) layout_category_id = fields.Many2one('sale.layout_category', string='Section') - layout_category_sequence = fields.Integer( - related='layout_category_id.sequence', - string='Layout Sequence', store=True) + layout_category_sequence = fields.Integer(string='Layout Sequence') + # TODO: remove layout_category_sequence in master or make it work properly diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index 344bd0a05da..ae96b2323f4 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -802,8 +802,8 @@ class SaleOrderLine(models.Model): procurement_ids = fields.One2many('procurement.order', 'sale_line_id', string='Procurements') layout_category_id = fields.Many2one('sale.layout_category', string='Section') - layout_category_sequence = fields.Integer(related='layout_category_id.sequence', string='Layout Sequence', store=True) - # Store is intentionally set in order to keep the "historic" order. + layout_category_sequence = fields.Integer(string='Layout Sequence') + # TODO: remove layout_category_sequence in master or make it work properly @api.multi def _prepare_invoice_line(self, qty): diff --git a/addons/stock/models/stock_quant.py b/addons/stock/models/stock_quant.py index eac6318e0d7..5932f9558af 100644 --- a/addons/stock/models/stock_quant.py +++ b/addons/stock/models/stock_quant.py @@ -682,7 +682,8 @@ class QuantPackage(models.Model): def action_view_picking(self): action = self.env.ref('stock.action_picking_tree_all').read()[0] - pickings = self.env['stock.pack.operation'].search([('result_package_id', 'in', self.ids)]).mapped('picking_id') + domain = ['|', ('result_package_id', 'in', self.ids), ('package_id', 'in', self.ids)] + pickings = self.env['stock.pack.operation'].search(domain).mapped('picking_id') action['domain'] = [('id', 'in', pickings.ids)] return action diff --git a/addons/web/i18n/es_EC.po b/addons/web/i18n/es_EC.po index f9e2bfa8c05..6017a7f5f2f 100644 --- a/addons/web/i18n/es_EC.po +++ b/addons/web/i18n/es_EC.po @@ -2221,7 +2221,7 @@ msgstr "" #: code:addons/web/static/src/js/views/form_widgets.js:1199 #, python-format msgid "The selected file exceed the maximum file size of %s." -msgstr "El archivo seleccionado supera el tamaño máximo de% s." +msgstr "El archivo seleccionado supera el tamaño máximo de %s." #. module: web #. openerp-web diff --git a/addons/web/i18n/hi.po b/addons/web/i18n/hi.po index 8bd0cafa5f3..b4439effdaa 100644 --- a/addons/web/i18n/hi.po +++ b/addons/web/i18n/hi.po @@ -1240,7 +1240,7 @@ msgstr "" #: code:addons/web/static/src/js/widgets/loading.js:44 #, python-format msgid "Loading (%d)" -msgstr "लोड हो रहा है (% d)" +msgstr "लोड हो रहा है (%d)" #. module: web #. openerp-web diff --git a/addons/website_hr_recruitment/controllers/main.py b/addons/website_hr_recruitment/controllers/main.py index 71968b3d850..a74fd9d4631 100644 --- a/addons/website_hr_recruitment/controllers/main.py +++ b/addons/website_hr_recruitment/controllers/main.py @@ -6,16 +6,17 @@ from odoo.addons.website.models.website import slug from odoo.http import request +# NB: DO NOT FORWARD PORT THE FALSY LEAVES IN 11.0 class WebsiteHrRecruitment(http.Controller): @http.route([ '/jobs', - '/jobs/country/', - '/jobs/department/', - '/jobs/country//department/', + '''/jobs/country//department/', - '/jobs/country//office/', - '/jobs/department//office/', - '/jobs/country//department//office/', + '''/jobs/country//department/ .page-header > a:hover { diff --git a/addons/website_quote/models/sale_order.py b/addons/website_quote/models/sale_order.py index d5f3f2483ab..b3e17b42827 100644 --- a/addons/website_quote/models/sale_order.py +++ b/addons/website_quote/models/sale_order.py @@ -111,15 +111,20 @@ class SaleOrder(models.Model): order_lines = [(5, 0, 0)] for line in template.quote_line: + discount = 0 if self.pricelist_id: price = self.pricelist_id.with_context(uom=line.product_uom_id.id).get_product_price(line.product_id, 1, False) + if self.pricelist_id.discount_policy == 'without_discount' and line.price_unit: + discount = (line.price_unit - price) / line.price_unit * 100 + price = line.price_unit + else: price = line.price_unit data = { 'name': line.name, 'price_unit': price, - 'discount': line.discount, + 'discount': 100 - ((100 - discount) * (100 - line.discount)/100), 'product_uom_qty': line.product_uom_qty, 'product_id': line.product_id.id, 'layout_category_id': line.layout_category_id, diff --git a/addons/website_sale/models/product.py b/addons/website_sale/models/product.py index 1b017ff67d1..6c50e86c2b1 100644 --- a/addons/website_sale/models/product.py +++ b/addons/website_sale/models/product.py @@ -192,7 +192,9 @@ class Product(models.Model): def _website_price(self): qty = self._context.get('quantity', 1.0) partner = self.env.user.partner_id - pricelist = self.env['website'].get_current_website().get_current_pricelist() + current_website = self.env['website'].get_current_website() + pricelist = current_website.get_current_pricelist() + company_id = current_website.company_id context = dict(self._context, pricelist=pricelist.id, partner=partner) self2 = self.with_context(context) if self._context != context else self @@ -200,7 +202,7 @@ class Product(models.Model): ret = self.env.user.has_group('sale.group_show_price_subtotal') and 'total_excluded' or 'total_included' for p, p2 in zip(self, self2): - taxes = partner.property_account_position_id.map_tax(p.taxes_id) + taxes = partner.property_account_position_id.map_tax(p.taxes_id.sudo().filtered(lambda x: x.company_id == company_id)) p.website_price = taxes.compute_all(p2.price, pricelist.currency_id, quantity=qty, product=p2, partner=partner)[ret] p.website_public_price = taxes.compute_all(p2.lst_price, quantity=qty, product=p2, partner=partner)[ret] diff --git a/addons/website_sale/static/src/css/website_sale.css b/addons/website_sale/static/src/css/website_sale.css index e2604b1b796..8f71e5bbfbd 100644 --- a/addons/website_sale/static/src/css/website_sale.css +++ b/addons/website_sale/static/src/css/website_sale.css @@ -336,6 +336,10 @@ min-width: 76px; } +.oe_cart > .oe_structure { + clear: both; +} + div#payment_method div.list-group { margin-left: 40px; } diff --git a/addons/website_sale/static/src/css/website_sale.sass b/addons/website_sale/static/src/css/website_sale.sass index e723493b5c6..3c1abfeb323 100644 --- a/addons/website_sale/static/src/css/website_sale.sass +++ b/addons/website_sale/static/src/css/website_sale.sass @@ -296,6 +296,8 @@ .oe_cart table td:first-child min-width: 76px +.oe_cart > .oe_structure + clear: both div#payment_method div.list-group diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml index e1157fd9de4..42fc4b30623 100644 --- a/addons/website_sale/views/templates.xml +++ b/addons/website_sale/views/templates.xml @@ -84,7 +84,7 @@ @@ -99,7 +99,7 @@
- +
@@ -406,7 +406,7 @@
- + @@ -450,7 +450,7 @@

Product Name

-