+
diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py
index 0a22f3aa518..eae57d4a6cf 100644
--- a/addons/website_sale/controllers/main.py
+++ b/addons/website_sale/controllers/main.py
@@ -383,8 +383,8 @@ class WebsiteSale(http.Controller):
def cart_update(self, product_id, add_qty=1, set_qty=0, **kw):
request.website.sale_get_order(force_create=1)._cart_update(
product_id=int(product_id),
- add_qty=float(add_qty),
- set_qty=float(set_qty),
+ add_qty=add_qty,
+ set_qty=set_qty,
attributes=self._filter_attributes(**kw),
)
return request.redirect("/shop/cart")
@@ -398,7 +398,6 @@ class WebsiteSale(http.Controller):
if order.state != 'draft':
request.website.sale_reset()
return {}
-
value = order._cart_update(product_id=product_id, line_id=line_id, add_qty=add_qty, set_qty=set_qty)
if not order.cart_quantity:
diff --git a/addons/website_sale/models/sale_order.py b/addons/website_sale/models/sale_order.py
index 70a37fd775e..987bdaa6a66 100644
--- a/addons/website_sale/models/sale_order.py
+++ b/addons/website_sale/models/sale_order.py
@@ -139,6 +139,17 @@ class SaleOrder(models.Model):
""" Add or set product quantity, add_qty can be negative """
self.ensure_one()
SaleOrderLineSudo = self.env['sale.order.line'].sudo()
+
+ try:
+ if add_qty:
+ add_qty = float(add_qty)
+ except ValueError:
+ add_qty = 1
+ try:
+ if set_qty:
+ set_qty = float(set_qty)
+ except ValueError:
+ set_qty = 0
quantity = 0
order_line = False
if self.state != 'draft':
diff --git a/addons/website_sale/static/src/js/website_sale.js b/addons/website_sale/static/src/js/website_sale.js
index c48d1588353..29f3652a185 100644
--- a/addons/website_sale/static/src/js/website_sale.js
+++ b/addons/website_sale/static/src/js/website_sale.js
@@ -133,6 +133,9 @@ odoo.define('website_sale.website_sale', function (require) {
return;
}
var value = parseInt($input.val() || 0, 10);
+ if (isNaN(value)) {
+ value = 1;
+ }
var $dom = $(this).closest('tr');
//var default_price = parseFloat($dom.find('.text-danger > span.oe_currency_value').text());
var $dom_optional = $dom.nextUntil(':not(.optional_product.info)');
@@ -151,7 +154,11 @@ odoo.define('website_sale.website_sale', function (require) {
'set_qty': value
}).then(function (data) {
$input.data('update_change', false);
- if (value !== parseInt($input.val() || 0, 10)) {
+ var check_value = parseInt($input.val() || 0, 10);
+ if (isNaN(check_value)) {
+ check_value = 1;
+ }
+ if (value !== check_value) {
$input.trigger('change');
return;
}
diff --git a/addons/website_sale/static/src/js/website_sale_validate.js b/addons/website_sale/static/src/js/website_sale_validate.js
index 2518766f488..6630044a6a4 100644
--- a/addons/website_sale/static/src/js/website_sale_validate.js
+++ b/addons/website_sale/static/src/js/website_sale_validate.js
@@ -16,8 +16,13 @@ $(document).ready(function () {
return ajax.jsonRpc('/shop/payment/get_status/' + order_id, 'call', {
}).then(function (result) {
_poll_nbr += 1;
- if(result.recall && _poll_nbr <= 5){
- setTimeout(function () { payment_transaction_poll_status(); }, 1000);
+ if(result.recall) {
+ if (_poll_nbr < 20){
+ setTimeout(function () { payment_transaction_poll_status(); }, Math.ceil(_poll_nbr / 3) * 1000);
+ }
+ else {
+ result.message = "";
+ }
}
$('div.oe_website_sale_tx_status').html(result.message);
});
diff --git a/addons/website_sale_options/controllers/main.py b/addons/website_sale_options/controllers/main.py
index af48c17f2e1..1f151f0dcf7 100644
--- a/addons/website_sale_options/controllers/main.py
+++ b/addons/website_sale_options/controllers/main.py
@@ -34,8 +34,8 @@ class WebsiteSaleOptions(WebsiteSale):
if add_qty or set_qty:
value = order._cart_update(
product_id=int(product_id),
- add_qty=int(add_qty),
- set_qty=int(set_qty),
+ add_qty=add_qty,
+ set_qty=set_qty,
attributes=attributes,
optional_product_ids=optional_product_ids
)
diff --git a/doc/cla/corporate/it-projects-llc.md b/doc/cla/corporate/it-projects-llc.md
new file mode 100644
index 00000000000..038323173c3
--- /dev/null
+++ b/doc/cla/corporate/it-projects-llc.md
@@ -0,0 +1,20 @@
+Russia, 2017-11-25
+
+IT-Projects LLC agrees to the terms of the Odoo Corporate Contributor License
+Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+Ivan Yelizariev https://github.com/yelizariev
+
+List of contributors:
+
+Ivan Yelizariev yelizariev@it-projects.info https://github.com/yelizariev
+Ildar Nasyrov nasyrov@it-projects.info https://github.com/iledarn
+Ilmir Karamov karamov@it-projects.info https://github.com/ilmir-k
+Dinar Gabbasov gabbasov@it-projects.info https://github.com/GabbasovDinar
+Artyom Losev losev@it-projects.info https://github.com/ArtyomLosev
+Alexandr Kolushov kolushov@it-projects.info https://github.com/KolushovAlexandr
diff --git a/doc/cla/individual/adekock11.md b/doc/cla/individual/adekock11.md
new file mode 100644
index 00000000000..999190ef207
--- /dev/null
+++ b/doc/cla/individual/adekock11.md
@@ -0,0 +1,11 @@
+South Africa, 2017-11-25
+
+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,
+
+Andre de Kock adekock11@gmail.com https://github.com/adekock11
diff --git a/doc/cla/individual/elgow.md b/doc/cla/individual/elgow.md
new file mode 100644
index 00000000000..930d08bcec9
--- /dev/null
+++ b/doc/cla/individual/elgow.md
@@ -0,0 +1,11 @@
+USA, 16 Nov 2017
+
+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,
+
+Edward Gow elgow@users.noreply.github.com https://github.com/elgow
diff --git a/doc/cla/individual/flyingL123.md b/doc/cla/individual/flyingL123.md
new file mode 100644
index 00000000000..ba93055493d
--- /dev/null
+++ b/doc/cla/individual/flyingL123.md
@@ -0,0 +1,11 @@
+USA, 2017-11-27
+
+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,
+
+Michael Leff leff.michael@gmail.com https://github.com/flyingL123
diff --git a/odoo/addons/base/ir/ir_translation.py b/odoo/addons/base/ir/ir_translation.py
index f77d84e758b..b38f3fae8e0 100644
--- a/odoo/addons/base/ir/ir_translation.py
+++ b/odoo/addons/base/ir/ir_translation.py
@@ -680,6 +680,16 @@ class IrTranslation(models.Model):
action['context'] = {
'search_default_name': "%s,%s" % (fld.model_name, fld.name),
}
+ else:
+ rec = record
+ try:
+ while fld.related:
+ rec, fld = fld.traverse_related(rec)
+ if rec:
+ action['context'] = {'search_default_name': "%s,%s" % (fld.model_name, fld.name),}
+ except AccessError:
+ pass
+
return action
@api.model
diff --git a/odoo/addons/base/ir/ir_translation_view.xml b/odoo/addons/base/ir/ir_translation_view.xml
index 9e4937a74b1..0cfd592d40b 100644
--- a/odoo/addons/base/ir/ir_translation_view.xml
+++ b/odoo/addons/base/ir/ir_translation_view.xml
@@ -70,6 +70,7 @@
+
diff --git a/odoo/addons/base/res/res_country_data.xml b/odoo/addons/base/res/res_country_data.xml
index 92c77080c9f..031af455c5b 100644
--- a/odoo/addons/base/res/res_country_data.xml
+++ b/odoo/addons/base/res/res_country_data.xml
@@ -424,6 +424,7 @@
Denmark
dk
+
VAT
diff --git a/odoo/addons/base/res/res_currency_data.xml b/odoo/addons/base/res/res_currency_data.xml
index d158a91ce9b..f286190872d 100644
--- a/odoo/addons/base/res/res_currency_data.xml
+++ b/odoo/addons/base/res/res_currency_data.xml
@@ -338,6 +338,7 @@
ZAR
R
0.01
+ before
Rand
Cents
diff --git a/odoo/addons/test_impex/tests/test_export.py b/odoo/addons/test_impex/tests/test_export.py
index 9c7311319e8..a360cfd0ef4 100644
--- a/odoo/addons/test_impex/tests/test_export.py
+++ b/odoo/addons/test_impex/tests/test_export.py
@@ -382,9 +382,13 @@ class test_o2m(CreatorCase):
def test_multiple_records_name(self):
self.assertEqual(
self.export(self.commands, fields=['const', 'value']),
- [[
- u'4', u','.join(self.names)
- ]])
+ [
+ [u'4', u'export.one2many.child:4'],
+ [u'', u'export.one2many.child:42'],
+ [u'', u'export.one2many.child:36'],
+ [u'', u'export.one2many.child:4'],
+ [u'', u'export.one2many.child:13'],
+ ])
def test_multiple_records_id(self):
export = self.export(self.commands, fields=['const', 'value/.id'])
@@ -402,19 +406,23 @@ class test_o2m(CreatorCase):
def test_multiple_records_with_name_before(self):
self.assertEqual(
self.export(self.commands, fields=['const', 'value', 'value/value']),
- [[ # exports sub-fields of very first o2m
- u'4', u','.join(self.names), u'4'
- ]])
+ [
+ [u'4', u'export.one2many.child:4', u'4'],
+ ['', u'export.one2many.child:42', u'42'],
+ ['', u'export.one2many.child:36', u'36'],
+ ['', u'export.one2many.child:4', u'4'],
+ ['', u'export.one2many.child:13', u'13'],
+ ])
def test_multiple_records_with_name_after(self):
self.assertEqual(
self.export(self.commands, fields=['const', 'value/value', 'value']),
- [ # completely ignores name_get request
- [u'4', u'4', ''],
- ['', u'42', ''],
- ['', u'36', ''],
- ['', u'4', ''],
- ['', u'13', ''],
+ [
+ [u'4', u'4', u'export.one2many.child:4'],
+ ['', u'42', u'export.one2many.child:42'],
+ ['', u'36', u'export.one2many.child:36'],
+ ['', u'4', u'export.one2many.child:4'],
+ ['', u'13', u'export.one2many.child:13'],
])
def test_multiple_subfields_neighbour(self):
@@ -585,10 +593,13 @@ class test_m2m(CreatorCase):
def test_multiple_records_name(self):
self.assertEqual(
self.export(self.commands, fields=['const', 'value']),
- [[ # FIXME: hardcoded comma, import uses config.csv_internal_sep
- # resolution: remove configurable csv_internal_sep
- u'4', u','.join(self.names)
- ]])
+ [
+ [u'4', u'export.many2many.other:4'],
+ ['', u'export.many2many.other:42'],
+ ['', u'export.many2many.other:36'],
+ ['', u'export.many2many.other:4'],
+ ['', u'export.many2many.other:13'],
+ ])
# essentially same as o2m, so boring
diff --git a/odoo/models.py b/odoo/models.py
index dea095cd4c9..ec219398d78 100644
--- a/odoo/models.py
+++ b/odoo/models.py
@@ -689,22 +689,18 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
current[i] = ','.join(xml_ids) or False
continue
- # recursively export the fields that follow name
- fields2 = [(p[1:] if p and p[0] == name else []) for p in fields]
+ # recursively export the fields that follow name; use
+ # 'display_name' where no subfield is exported
+ fields2 = [(p[1:] or ['display_name'] if p and p[0] == name else [])
+ for p in fields]
lines2 = value._export_rows(fields2)
if lines2:
# merge first line with record's main line
for j, val in enumerate(lines2[0]):
if val or isinstance(val, bool):
current[j] = val
- # check value of current field
- if not current[i] and not isinstance(current[i], bool):
- # assign xml_ids, and forget about remaining lines
- xml_ids = [item[1] for item in value.name_get()]
- current[i] = ','.join(xml_ids)
- else:
- # append the other lines at the end
- lines += lines2[1:]
+ # append the other lines at the end
+ lines += lines2[1:]
else:
current[i] = False
diff --git a/requirements.txt b/requirements.txt
index 16eda9e10ec..311aaea0e8b 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -16,7 +16,7 @@ ofxparse==0.16
passlib==1.6.5
Pillow==3.4.1
psutil==4.3.1
-psycopg2==2.7.3
+psycopg2==2.7.3.1
pydot==1.2.3
pyldap==2.4.28
pyparsing==2.1.10