[MERGE] forward port branch saas-14 up to 17adccd95c

This commit is contained in:
Christophe Simonis
2019-01-17 18:07:26 +01:00
9 changed files with 27 additions and 25 deletions
@@ -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()
+1 -1
View File
@@ -535,7 +535,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"/>
+4 -4
View File
@@ -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
+1 -1
View File
@@ -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) {
+3 -3
View File
@@ -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){
@@ -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;
}
+2 -2
View File
@@ -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
+4
View File
@@ -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,
+9
View File
@@ -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/