[MERGE] forward port branch saas-15 up to ca2b46c2d1

This commit is contained in:
Christophe Simonis
2018-11-05 15:52:38 +01:00
5 changed files with 16 additions and 6 deletions
+3 -1
View File
@@ -259,7 +259,7 @@ class AccountMove(models.Model):
aml = ac_move.line_ids.filtered(lambda x: x.account_id.reconcile or x.account_id.internal_type == 'liquidity')
aml.remove_move_reconcile()
#reconcile together the reconciliable (or the liquidity aml) and their newly created counterpart
for account in list(set([x.account_id for x in aml])):
for account in set([x.account_id for x in aml]):
to_rec = aml.filtered(lambda y: y.account_id == account)
to_rec |= reversed_move.line_ids.filtered(lambda y: y.account_id == account)
#reconciliation will be full, so speed up the computation by using skip_full_reconcile_check in the context
@@ -1311,6 +1311,8 @@ class AccountMoveLine(models.Model):
ctx = {}
if 'date' in vals:
ctx['date'] = vals['date']
elif 'date_maturity' in vals:
ctx['date'] = vals['date_maturity']
temp['currency_id'] = bank.currency_id.id
temp['amount_currency'] = bank.company_id.currency_id.with_context(ctx).compute(tax_vals['amount'], bank.currency_id, round=True)
if vals.get('tax_exigible'):
+4 -2
View File
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.osv import expression
from odoo import api, fields, models, _
from odoo.addons import decimal_precision as dp
from odoo.exceptions import UserError, ValidationError
@@ -108,6 +109,7 @@ class ProductAttributeLine(models.Model):
# search on a m2o and one on a m2m, probably this will quickly become
# difficult to compute - check if performance optimization is required
if name and operator in ('=', 'ilike', '=ilike', 'like', '=like'):
args = expression.AND([['|', ('attribute_id', operator, name), ('value_ids', operator, name)], args])
return self.search(args, limit=limit).name_get()
args = args or []
domain = ['|', ('attribute_id', operator, name), ('value_ids', operator, name)]
return self.search(expression.AND([domain, args]), limit=limit).name_get()
return super(ProductAttributeLine, self).name_search(name=name, args=args, operator=operator, limit=limit)
@@ -200,7 +200,7 @@ class PurchaseOrder(models.Model):
self.partner_id = partner.id
self.fiscal_position_id = fpos.id
self.payment_term_id = payment_term.id,
self.payment_term_id = payment_term.id
self.company_id = requisition.company_id.id
self.currency_id = currency.id
if not self.origin or requisition.name not in self.origin.split(', '):
+4 -1
View File
@@ -356,6 +356,9 @@ class WebsiteSale(http.Controller):
revive: Revival method when abandoned cart. Can be 'merge' or 'squash'
"""
order = request.website.sale_get_order()
if order and order.state != 'draft':
request.session['sale_order_id'] = None
order = request.website.sale_get_order()
values = {}
if access_token:
abandoned_order = request.env['sale.order'].sudo().search([('access_token', '=', access_token)], limit=1)
@@ -398,7 +401,7 @@ class WebsiteSale(http.Controller):
@http.route(['/shop/cart/update'], type='http', auth="public", methods=['POST'], website=True, csrf=False)
def cart_update(self, product_id, add_qty=1, set_qty=0, **kw):
sale_order = request.website.sale_get_order(force_create=1)
sale_order = request.website.sale_get_order(force_create=True)
if sale_order.state != 'draft':
request.session['sale_order_id'] = None
sale_order = request.website.sale_get_order(force_create=True)
@@ -19,7 +19,10 @@ class WebsiteSaleOptions(WebsiteSale):
if lang:
request.website = request.website.with_context(lang=lang)
order = request.website.sale_get_order(force_create=1)
order = request.website.sale_get_order(force_create=True)
if order.state != 'draft':
request.session['sale_order_id'] = None
order = request.website.sale_get_order(force_create=True)
product = request.env['product.product'].browse(int(product_id))
option_ids = product.optional_product_ids.mapped('product_variant_ids').ids