[MERGE] forward port branch 9.0 up to da388aa
This commit is contained in:
@@ -84,7 +84,7 @@ class CompanyLDAP(osv.osv):
|
|||||||
_logger.warning('Could not format LDAP filter. Your filter should contain one \'%s\'.')
|
_logger.warning('Could not format LDAP filter. Your filter should contain one \'%s\'.')
|
||||||
return False
|
return False
|
||||||
try:
|
try:
|
||||||
results = self.query(conf, filter)
|
results = self.query(conf, filter.encode('utf-8'))
|
||||||
|
|
||||||
# Get rid of (None, attrs) for searchResultReference replies
|
# Get rid of (None, attrs) for searchResultReference replies
|
||||||
results = [i for i in results if i[0]]
|
results = [i for i in results if i[0]]
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class config(osv.Model):
|
|||||||
req = urllib2.Request('https://accounts.google.com/o/oauth2/token', data, headers)
|
req = urllib2.Request('https://accounts.google.com/o/oauth2/token', data, headers)
|
||||||
content = urllib2.urlopen(req, timeout=TIMEOUT).read()
|
content = urllib2.urlopen(req, timeout=TIMEOUT).read()
|
||||||
except urllib2.HTTPError:
|
except urllib2.HTTPError:
|
||||||
if user_is_admin:
|
if self.pool['res.users']._is_admin(cr, uid, [uid]):
|
||||||
model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'base_setup', 'action_general_configuration')
|
model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'base_setup', 'action_general_configuration')
|
||||||
msg = _("Something went wrong during the token generation. Please request again an authorization code .")
|
msg = _("Something went wrong during the token generation. Please request again an authorization code .")
|
||||||
raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
|
raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
|
||||||
|
|||||||
@@ -701,7 +701,7 @@ msgstr "R.S.Z. 4de kwartaal"
|
|||||||
#. module: l10n_be
|
#. module: l10n_be
|
||||||
#: model:account.account.template,name:l10n_be.a4540
|
#: model:account.account.template,name:l10n_be.a4540
|
||||||
msgid "ONSS. Arriérés"
|
msgid "ONSS. Arriérés"
|
||||||
msgstr ""
|
msgstr "Achterstallige bijdragen RSZ"
|
||||||
|
|
||||||
#. module: l10n_be
|
#. module: l10n_be
|
||||||
#: model:account.account.template,name:l10n_be.a4553
|
#: model:account.account.template,name:l10n_be.a4553
|
||||||
@@ -879,7 +879,7 @@ msgstr "Waardeverminderingen op voorraden"
|
|||||||
#. module: l10n_be
|
#. module: l10n_be
|
||||||
#: model:account.fiscal.position.template,name:l10n_be.fiscal_position_template_4
|
#: model:account.fiscal.position.template,name:l10n_be.fiscal_position_template_4
|
||||||
msgid "Régime Cocontractant"
|
msgid "Régime Cocontractant"
|
||||||
msgstr ""
|
msgstr "Medecontractant"
|
||||||
|
|
||||||
#. module: l10n_be
|
#. module: l10n_be
|
||||||
#: model:account.fiscal.position.template,name:l10n_be.fiscal_position_template_2
|
#: model:account.fiscal.position.template,name:l10n_be.fiscal_position_template_2
|
||||||
|
|||||||
+3
-4
@@ -179,9 +179,7 @@ class SaleOrder(models.Model):
|
|||||||
"""
|
"""
|
||||||
Trigger the change of fiscal position when the shipping address is modified.
|
Trigger the change of fiscal position when the shipping address is modified.
|
||||||
"""
|
"""
|
||||||
fiscal_position = self.env['account.fiscal.position'].get_fiscal_position(self.partner_id.id, self.partner_shipping_id.id)
|
self.fiscal_position_id = self.env['account.fiscal.position'].get_fiscal_position(self.partner_id.id, self.partner_shipping_id.id)
|
||||||
if fiscal_position:
|
|
||||||
self.fiscal_position_id = fiscal_position
|
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
@@ -892,7 +890,8 @@ class MailComposeMessage(models.TransientModel):
|
|||||||
order = self.env['sale.order'].browse([self._context['default_res_id']])
|
order = self.env['sale.order'].browse([self._context['default_res_id']])
|
||||||
if order.state == 'draft':
|
if order.state == 'draft':
|
||||||
order.state = 'sent'
|
order.state = 'sent'
|
||||||
return super(MailComposeMessage, self.with_context(mail_post_autofollow=True)).send_mail(auto_commit=auto_commit)
|
self = self.with_context(mail_post_autofollow=True)
|
||||||
|
return super(MailComposeMessage, self).send_mail(auto_commit=auto_commit)
|
||||||
|
|
||||||
|
|
||||||
class AccountInvoice(models.Model):
|
class AccountInvoice(models.Model):
|
||||||
|
|||||||
@@ -56,11 +56,11 @@ class stock_history(osv.osv):
|
|||||||
for ids in group_lines.values():
|
for ids in group_lines.values():
|
||||||
for product_id in ids:
|
for product_id in ids:
|
||||||
line_ids.add(product_id)
|
line_ids.add(product_id)
|
||||||
line_ids = list(line_ids)
|
|
||||||
lines_rec = {}
|
lines_rec = {}
|
||||||
if line_ids:
|
if line_ids:
|
||||||
cr.execute('SELECT id, product_id, price_unit_on_quant, company_id, quantity FROM stock_history WHERE id in %s', (tuple(line_ids),))
|
move_ids = tuple(abs(line_id) for line_id in line_ids)
|
||||||
lines_rec = cr.dictfetchall()
|
cr.execute('SELECT id, product_id, price_unit_on_quant, company_id, quantity FROM stock_history WHERE move_id in %s', (move_ids,))
|
||||||
|
lines_rec = tuple(rec for rec in cr.dictfetchall() if rec['id'] in line_ids)
|
||||||
lines_dict = dict((line['id'], line) for line in lines_rec)
|
lines_dict = dict((line['id'], line) for line in lines_rec)
|
||||||
product_ids = list(set(line_rec['product_id'] for line_rec in lines_rec))
|
product_ids = list(set(line_rec['product_id'] for line_rec in lines_rec))
|
||||||
products_rec = self.pool['product.product'].read(cr, uid, product_ids, ['cost_method', 'id'], context=context)
|
products_rec = self.pool['product.product'].read(cr, uid, product_ids, ['cost_method', 'id'], context=context)
|
||||||
|
|||||||
@@ -13,10 +13,11 @@ from openerp.addons.website_mail.controllers.main import _message_post_helper
|
|||||||
|
|
||||||
|
|
||||||
class sale_quote(http.Controller):
|
class sale_quote(http.Controller):
|
||||||
@http.route([
|
@http.route("/quote/<int:order_id>", type='http', auth="user", website=True)
|
||||||
"/quote/<int:order_id>",
|
def view_user(self, *args, **kwargs):
|
||||||
"/quote/<int:order_id>/<token>"
|
return self.view(*args, **kwargs)
|
||||||
], type='http', auth="public", website=True)
|
|
||||||
|
@http.route("/quote/<int:order_id>/<token>", type='http', auth="public", website=True)
|
||||||
def view(self, order_id, pdf=None, token=None, message=False, **post):
|
def view(self, order_id, pdf=None, token=None, message=False, **post):
|
||||||
# use SUPERUSER_ID allow to access/view order for public user
|
# use SUPERUSER_ID allow to access/view order for public user
|
||||||
# only if he knows the private token
|
# only if he knows the private token
|
||||||
|
|||||||
@@ -593,9 +593,6 @@ class WebsiteSale(http.Controller):
|
|||||||
if checkout.get('shipping_id'):
|
if checkout.get('shipping_id'):
|
||||||
order.write({'partner_shipping_id': checkout['shipping_id']})
|
order.write({'partner_shipping_id': checkout['shipping_id']})
|
||||||
|
|
||||||
order.onchange_partner_shipping_id()
|
|
||||||
order.order_line._compute_tax_id()
|
|
||||||
|
|
||||||
order_info = {
|
order_info = {
|
||||||
'message_partner_ids': [(4, partner.id), (3, request.website.partner_id.id)],
|
'message_partner_ids': [(4, partner.id), (3, request.website.partner_id.id)],
|
||||||
}
|
}
|
||||||
@@ -636,6 +633,9 @@ class WebsiteSale(http.Controller):
|
|||||||
if not int(post.get('shipping_id', 0)):
|
if not int(post.get('shipping_id', 0)):
|
||||||
order.partner_shipping_id = order.partner_invoice_id
|
order.partner_shipping_id = order.partner_invoice_id
|
||||||
|
|
||||||
|
order.onchange_partner_shipping_id()
|
||||||
|
order.order_line._compute_tax_id()
|
||||||
|
|
||||||
request.session['sale_last_order_id'] = order.id
|
request.session['sale_last_order_id'] = order.id
|
||||||
|
|
||||||
request.website.sale_get_order(update_pricelist=True)
|
request.website.sale_get_order(update_pricelist=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user