[MERGE] forward port branch saas-15 up to c0471dd857
This commit is contained in:
@@ -54,9 +54,9 @@ class account_journal(models.Model):
|
||||
WHERE c.journal_id = %s
|
||||
AND c.date > %s
|
||||
AND c.date <= %s
|
||||
GROUP BY date, id
|
||||
ORDER BY date, id) AS b
|
||||
WHERE a.id = b.stmt_id;"""
|
||||
GROUP BY date) AS b
|
||||
WHERE a.id = b.stmt_id
|
||||
ORDER BY date;"""
|
||||
|
||||
self.env.cr.execute(query, (self.id, last_month, today))
|
||||
bank_stmt = self.env.cr.dictfetchall()
|
||||
|
||||
@@ -127,14 +127,14 @@ class MergePartnerAutomatic(models.TransientModel):
|
||||
# unique key treated
|
||||
query = """
|
||||
UPDATE "%(table)s" as ___tu
|
||||
SET %(column)s = %%s
|
||||
SET "%(column)s" = %%s
|
||||
WHERE
|
||||
%(column)s = %%s AND
|
||||
"%(column)s" = %%s AND
|
||||
NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM "%(table)s" as ___tw
|
||||
WHERE
|
||||
%(column)s = %%s AND
|
||||
"%(column)s" = %%s AND
|
||||
___tu.%(value)s = ___tw.%(value)s
|
||||
)""" % query_dic
|
||||
for partner in src_partners:
|
||||
@@ -142,7 +142,7 @@ class MergePartnerAutomatic(models.TransientModel):
|
||||
else:
|
||||
try:
|
||||
with mute_logger('odoo.sql_db'), self._cr.savepoint():
|
||||
query = 'UPDATE "%(table)s" SET %(column)s = %%s WHERE %(column)s IN %%s' % query_dic
|
||||
query = 'UPDATE "%(table)s" SET "%(column)s" = %%s WHERE "%(column)s" IN %%s' % query_dic
|
||||
self._cr.execute(query, (dst_partner.id, tuple(src_partners.ids),))
|
||||
|
||||
# handle the recursivity with parent relation
|
||||
|
||||
@@ -60,7 +60,7 @@ function _parse_and_transform(nodes, transform_function) {
|
||||
|
||||
// Suggested URL Javascript regex of http://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url
|
||||
// Adapted to make http(s):// not required if (and only if) www. is given. So `should.notmatch` does not match.
|
||||
var url_regexp = /\b(?:https?:\/\/\d{1,3}(?:\.\d{1,3}){3}|(?:https?:\/\/|(?:www\.))[-a-z0-9@:%._\+~#=]{2,256}\.[a-z]{2,13})\b(?:[-a-z0-9@:%_\+.~#?&'$//=]*)/gi;
|
||||
var url_regexp = /\b(?:https?:\/\/\d{1,3}(?:\.\d{1,3}){3}|(?:https?:\/\/|(?:www\.))[-a-z0-9@:%._\+~#=]{2,256}\.[a-z]{2,13})\b(?:[-a-z0-9@:%_\+.~#?&'$//=;]*)/gi;
|
||||
function linkify(text, attrs) {
|
||||
attrs = attrs || {};
|
||||
if (attrs.target === undefined) {
|
||||
|
||||
@@ -386,7 +386,7 @@ class ProductProduct(models.Model):
|
||||
|
||||
# Prefetch the fields used by the `name_get`, so `browse` doesn't fetch other fields
|
||||
# Use `load=False` to not call `name_get` for the `product_tmpl_id`
|
||||
self.sudo().read(['name', 'default_code', 'product_tmpl_id', 'attribute_value_ids'], load=False)
|
||||
self.sudo().read(['name', 'default_code', 'product_tmpl_id', 'attribute_value_ids', 'attribute_line_ids'], load=False)
|
||||
|
||||
product_template_ids = self.sudo().mapped('product_tmpl_id').ids
|
||||
|
||||
@@ -403,7 +403,7 @@ class ProductProduct(models.Model):
|
||||
supplier_info_by_template.setdefault(r.product_tmpl_id, []).append(r)
|
||||
for product in self.sudo():
|
||||
# display only the attributes with multiple possible values on the template
|
||||
variable_attributes = product.attribute_value_ids.filtered(lambda v: len(v.attribute_id.value_ids) > 1).mapped('attribute_id')
|
||||
variable_attributes = product.attribute_line_ids.filtered(lambda l: len(l.value_ids) > 1).mapped('attribute_id')
|
||||
variant = product.attribute_value_ids._variant_name(variable_attributes)
|
||||
|
||||
name = variant and "%s (%s)" % (product.name, variant) or product.name
|
||||
|
||||
@@ -251,6 +251,10 @@ class WebsiteSurvey(http.Controller):
|
||||
def print_survey(self, survey, token=None, **post):
|
||||
'''Display an survey in printable view; if <token> is set, it will
|
||||
grab the answers of the user_input_id that has <token>.'''
|
||||
|
||||
if survey.auth_required and request.env.user == request.website.user_id:
|
||||
return request.render("survey.auth_required", {'survey': survey, 'token': token})
|
||||
|
||||
return request.render('survey.survey_print',
|
||||
{'survey': survey,
|
||||
'token': token,
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
Ukraine, 2019-01-09
|
||||
|
||||
I hereby agree to the terms of the Odoo Individual Contributor License Agreement v1.0.
|
||||
|
||||
I declare that I am authorized and able to make this agreement and sign this declaration.
|
||||
|
||||
Signed,
|
||||
|
||||
Vyshnevska Iryna i.vyshnevska@mobilunity.com https://github.com/i-vyshnevska/
|
||||
Reference in New Issue
Block a user