diff --git a/addons/account/models/account_journal_dashboard.py b/addons/account/models/account_journal_dashboard.py index 5b5d100407db2fc00c774c8d5efa72a3dc640acd..400906e0948b285cb03521ca3757996a34fe1b94 100644 --- a/addons/account/models/account_journal_dashboard.py +++ b/addons/account/models/account_journal_dashboard.py @@ -46,9 +46,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() diff --git a/addons/account/views/account_view.xml b/addons/account/views/account_view.xml index 1fa9d5f0e9387996dd65cd1e32dd59aace6029de..3b1e46df59162cf671bcf017483787386f8921c2 100644 --- a/addons/account/views/account_view.xml +++ b/addons/account/views/account_view.xml @@ -542,7 +542,7 @@ <button class="oe_stat_button" name="button_journal_entries" string="Journal Entries" type="object" attrs="{'invisible':[('move_line_ids','=',[])]}" icon="fa-bars"/> - <field name="move_line_ids" invisible="1"/> + <field name="move_line_ids" invisible="1" readonly="1"/> </div> <div class="oe_title oe_inline"> <label for="name" class="oe_edit_only"/> diff --git a/addons/crm/wizard/base_partner_merge.py b/addons/crm/wizard/base_partner_merge.py index b6044efc9908882ed06f889eb7124a6ff96da95b..82e980ba48c5862a7015cf3f0a55613c5dd9020d 100644 --- a/addons/crm/wizard/base_partner_merge.py +++ b/addons/crm/wizard/base_partner_merge.py @@ -163,14 +163,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: @@ -178,7 +178,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 diff --git a/addons/mail/static/src/js/utils.js b/addons/mail/static/src/js/utils.js index b4e0c01a23a610733983a6d9c133e0f2496ad572..a735d261d93f5455938ad61895fdfe7c51c2faf3 100644 --- a/addons/mail/static/src/js/utils.js +++ b/addons/mail/static/src/js/utils.js @@ -61,7 +61,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?:\/\/|(www\.))[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,13}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/gi; +var url_regexp = /\b(?:https?:\/\/|(www\.))[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,13}\b([-a-zA-Z0-9@:%_\+.~#?&//=;]*)/gi; function linkify(text, attrs) { attrs = attrs || {}; if (attrs.target === undefined) { diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index dd2eb8d9596f3ef5714cff434e129bee187638fc..fa6215ee0e87f1ad4eb86a06d2ea19c2458c3e84 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -2092,7 +2092,7 @@ exports.Order = Backbone.Model.extend({ this.assert_editable(); var newPaymentline = new exports.Paymentline({},{order: this, cashregister:cashregister, pos: this.pos}); if(cashregister.journal.type !== 'cash' || this.pos.config.iface_precompute_cash){ - newPaymentline.set_amount( Math.max(this.get_due(),0) ); + newPaymentline.set_amount( this.get_due() ); } this.paymentlines.add(newPaymentline); this.select_paymentline(newPaymentline); @@ -2256,10 +2256,10 @@ exports.Order = Backbone.Model.extend({ } } } - return round_pr(Math.max(0,due), this.pos.currency.rounding); + return round_pr(due, this.pos.currency.rounding); }, is_paid: function(){ - return this.get_due() === 0; + return this.get_due() <= 0; }, is_paid_with_cash: function(){ return !!this.paymentlines.find( function(pl){ diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 7c1cb9559a6d530c5a1e480fc76197bfbe5dc754..82e6fa0e7b25f2b0a2c5963a01a8c08d21f3c08d 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -1943,17 +1943,6 @@ var PaymentScreenWidget = ScreenWidget.extend({ return false; } - var plines = order.get_paymentlines(); - for (var i = 0; i < plines.length; i++) { - if (plines[i].get_type() === 'bank' && plines[i].get_amount() < 0) { - this.gui.show_popup('error',{ - 'message': _t('Negative Bank Payment'), - 'comment': _t('You cannot have a negative amount in a Bank payment. Use a cash payment method to return money to the customer.'), - }); - return false; - } - } - if (!order.is_paid() || this.invoicing) { return false; } diff --git a/addons/product/models/product.py b/addons/product/models/product.py index 9bd1a22ce2642802831758aaa2a15f2d4a15192c..67586615cc487261c39b1beaf52e95df322d956e 100644 --- a/addons/product/models/product.py +++ b/addons/product/models/product.py @@ -402,7 +402,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 @@ -419,7 +419,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 diff --git a/addons/survey/controllers/main.py b/addons/survey/controllers/main.py index 553fc5ad4b22cbbeadbe6e8e76d78a025dda38ad..331b8a8642ccc129b7b833348e4626bd2f397ade 100644 --- a/addons/survey/controllers/main.py +++ b/addons/survey/controllers/main.py @@ -252,6 +252,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, diff --git a/doc/cla/individual/i-vyshnevska.md b/doc/cla/individual/i-vyshnevska.md new file mode 100644 index 0000000000000000000000000000000000000000..0df4e78944d29f323ce37097bbee6bba1a74e6df --- /dev/null +++ b/doc/cla/individual/i-vyshnevska.md @@ -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/ \ No newline at end of file