summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-10-29 12:27:14 +0100
committerChristophe Simonis <chs@odoo.com>2018-10-29 12:27:14 +0100
commit1916fdc1d00a1376c351aa5d62de37abb326bc9c (patch)
treed0b61b314efef22b8364b85e4073df354caa07c2
parent29e36457b29b9f8e919f58d246f734f44d8752b4 (diff)
parentac08e2ba53297b303c00be25ba46af3e727db625 (diff)
[MERGE] forward port branch 10.0 up to ac08e2ba532
-rw-r--r--addons/delivery/models/sale_order.py3
-rw-r--r--addons/hr_attendance/models/hr_attendance.py2
-rw-r--r--addons/mail/static/src/xml/thread.xml4
-rw-r--r--addons/mrp/models/mrp_production.py8
-rw-r--r--addons/point_of_sale/static/src/css/pos.css13
-rw-r--r--addons/point_of_sale/static/src/js/chrome.js3
-rw-r--r--addons/point_of_sale/static/src/js/devices.js19
-rw-r--r--addons/point_of_sale/static/src/js/models.js22
-rw-r--r--addons/point_of_sale/static/src/xml/pos.xml2
-rw-r--r--doc/_extensions/odoo_ext/translator.py2
-rw-r--r--doc/cla/individual/anilkesariya.md12
-rw-r--r--doc/cla/individual/ark74.md11
-rw-r--r--odoo/addons/base/module/module.py7
-rw-r--r--odoo/cli/templates/default/__manifest__.py.template2
-rw-r--r--odoo/modules/migration.py4
15 files changed, 85 insertions, 29 deletions
diff --git a/addons/delivery/models/sale_order.py b/addons/delivery/models/sale_order.py
index fb911b88627..5c0572b97f4 100644
--- a/addons/delivery/models/sale_order.py
+++ b/addons/delivery/models/sale_order.py
@@ -23,7 +23,8 @@ class SaleOrder(models.Model):
# Prevent SOAP call to external shipping provider when SO has no lines yet
continue
else:
- order.delivery_price = order.carrier_id.with_context(order_id=order.id).price
+ order.delivery_price = order.company_id.currency_id.with_context(date=order.date_order).compute(
+ order.carrier_id.with_context(order_id=order.id).price, order.pricelist_id.currency_id)
@api.onchange('partner_id')
def onchange_partner_id_dtype(self):
diff --git a/addons/hr_attendance/models/hr_attendance.py b/addons/hr_attendance/models/hr_attendance.py
index e8772aeba10..55fbcf9102e 100644
--- a/addons/hr_attendance/models/hr_attendance.py
+++ b/addons/hr_attendance/models/hr_attendance.py
@@ -81,7 +81,7 @@ class HrAttendance(models.Model):
('employee_id', '=', attendance.employee_id.id),
('check_out', '=', False),
('id', '!=', attendance.id),
- ])
+ ], order='check_in desc', limit=1)
if no_check_out_attendances:
raise exceptions.ValidationError(_("Cannot create new attendance record for %(empl_name)s, the employee hasn't checked out since %(datetime)s") % {
'empl_name': attendance.employee_id.name_related,
diff --git a/addons/mail/static/src/xml/thread.xml b/addons/mail/static/src/xml/thread.xml
index b9579be0790..5ec1d754100 100644
--- a/addons/mail/static/src/xml/thread.xml
+++ b/addons/mail/static/src/xml/thread.xml
@@ -121,6 +121,7 @@
t-att-data-message-id="message.id" title="Mark as Read"/>
</span>
</p>
+ <t t-raw="message.body"/>
<t t-if="message.tracking_value_ids &amp;&amp; message.tracking_value_ids.length &gt; 0">
<t t-if="message.subtype_description">
<p t-esc="message.subtype_description"/>
@@ -128,9 +129,6 @@
<t t-call="mail.ChatThread.MessageTracking"/>
</t>
<p t-if="options.display_subject &amp;&amp; message.display_subject" class="o_mail_subject">Subject: <t t-esc="message.subject"/></p>
- <t t-if="!(message.tracking_value_ids &amp;&amp; message.tracking_value_ids.length &gt; 0)">
- <t t-raw="message.body"/>
- </t>
<t t-foreach="message.attachment_ids" t-as="attachment">
<t t-call="mail.Attachment"/>
</t>
diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py
index c7d41c90057..bf2882532fb 100644
--- a/addons/mrp/models/mrp_production.py
+++ b/addons/mrp/models/mrp_production.py
@@ -435,10 +435,16 @@ class MrpProduction(models.Model):
@api.multi
def _generate_workorders(self, exploded_boms):
workorders = self.env['mrp.workorder']
+ original_one = False
for bom, bom_data in exploded_boms:
# If the routing of the parent BoM and phantom BoM are the same, don't recreate work orders, but use one master routing
if bom.routing_id.id and (not bom_data['parent_line'] or bom_data['parent_line'].bom_id.routing_id.id != bom.routing_id.id):
- workorders += self._workorders_create(bom, bom_data)
+ temp_workorders = self._workorders_create(bom, bom_data)
+ workorders += temp_workorders
+ if temp_workorders: # In order to avoid two "ending work orders"
+ if original_one:
+ temp_workorders[-1].next_work_order_id = original_one
+ original_one = temp_workorders[0]
return workorders
def _workorders_create(self, bom, bom_data):
diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css
index 6f7186035d8..61b50830617 100644
--- a/addons/point_of_sale/static/src/css/pos.css
+++ b/addons/point_of_sale/static/src/css/pos.css
@@ -2147,6 +2147,19 @@ td {
overflow: auto;
height: 120px;
}
+.pos .modal-dialog .popup-textinput{
+ display: flex;
+ flex-direction: column;
+}
+.pos .modal-dialog .popup-textinput .title,
+.pos .modal-dialog .popup-textinput .footer{
+ flex: none;
+}
+.pos .modal-dialog .popup-textinput textarea{
+ resize: none;
+ flex: auto;
+ margin: 0 20px 80px;
+}
.pos .popup .title {
background: rgba(255,255,255,0.5);
margin: 0;
diff --git a/addons/point_of_sale/static/src/js/chrome.js b/addons/point_of_sale/static/src/js/chrome.js
index 3c2bf4519a1..ee7e4d9d9de 100644
--- a/addons/point_of_sale/static/src/js/chrome.js
+++ b/addons/point_of_sale/static/src/js/chrome.js
@@ -630,6 +630,9 @@ var Chrome = PosBaseWidget.extend({
if(err.message === 'XmlHttpRequestError '){
title = 'Network Failure (XmlHttpRequestError)';
body = 'The Point of Sale could not be loaded due to a network problem.\n Please check your internet connection.';
+ }else if(err.message === 'TLSError'){
+ title = 'Https connection to IoT Box failed';
+ body = 'Make sure you are using IoT Box v18.10 or higher.\n\n Navigate to ' + err.url + ' to accept the certificate of your IoT Box.';
}else if(err.code === 200){
title = err.data.message;
body = err.data.debug;
diff --git a/addons/point_of_sale/static/src/js/devices.js b/addons/point_of_sale/static/src/js/devices.js
index e8bd95bc117..26371ff01f4 100644
--- a/addons/point_of_sale/static/src/js/devices.js
+++ b/addons/point_of_sale/static/src/js/devices.js
@@ -188,11 +188,15 @@ var ProxyDevice = core.Class.extend(core.mixins.PropertiesMixin,{
// try harder when we remember a good proxy url
found_url = this.try_hard_to_connect(localStorage.hw_proxy_url, options)
.then(null,function(){
- return self.find_proxy(options);
+ if (window.location.protocol != 'https:'){
+ return self.find_proxy(options);
+ }
});
}else{
// just find something quick
- found_url = this.find_proxy(options);
+ if (window.location.protocol != 'https:'){
+ found_url = this.find_proxy(options);
+ }
}
success = found_url.then(function(url){
@@ -244,16 +248,17 @@ var ProxyDevice = core.Class.extend(core.mixins.PropertiesMixin,{
// try several time to connect to a known proxy url
try_hard_to_connect: function(url,options){
options = options || {};
- var port = ':' + (options.port || '8069');
+ var protocol = window.location.protocol;
+ var port = ( !options.port && protocol == "https:") ? ':443' : ':' + (options.port || '8069');
this.set_connection_status('connecting');
if(url.indexOf('//') < 0){
- url = 'http://'+url;
+ url = protocol + '//' + url;
}
if(url.indexOf(':',5) < 0){
- url = url+port;
+ url = url + port;
}
// try real hard to connect to url, with a 1sec timeout and up to 'retries' retries
@@ -269,11 +274,11 @@ var ProxyDevice = core.Class.extend(core.mixins.PropertiesMixin,{
.done(function(){
done.resolve(url);
})
- .fail(function(){
+ .fail(function(resp){
if(retries > 0){
try_real_hard_to_connect(url,retries-1,done);
}else{
- done.reject();
+ done.reject(resp.statusText, url);
}
});
return done;
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js
index 8b938738e85..dd2eb8d9596 100644
--- a/addons/point_of_sale/static/src/js/models.js
+++ b/addons/point_of_sale/static/src/js/models.js
@@ -121,13 +121,21 @@ exports.PosModel = Backbone.Model.extend({
progress: function(prog){
self.chrome.loading_progress(prog);
},
- }).then(function(){
- if(self.config.iface_scan_via_proxy){
- self.barcode_reader.connect_to_proxy();
- }
- }).always(function(){
- done.resolve();
- });
+ }).then(
+ function(){
+ if(self.config.iface_scan_via_proxy){
+ self.barcode_reader.connect_to_proxy();
+ }
+ done.resolve();
+ },
+ function(statusText, url){
+ if (statusText == 'error' && window.location.protocol == 'https:') {
+ var error = {message: 'TLSError', url: url};
+ self.chrome.loading_error(error);
+ } else {
+ done.resolve();
+ }
+ });
return done;
},
diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml
index c6627159262..b3122705a2c 100644
--- a/addons/point_of_sale/static/src/xml/pos.xml
+++ b/addons/point_of_sale/static/src/xml/pos.xml
@@ -1076,7 +1076,7 @@
<div class="modal-dialog">
<div class="popup popup-textinput">
<p class="title"><t t-esc=" widget.options.title || '' " /></p>
- <textarea rows="10" cols="40"><t t-esc="widget.options.value" /></textarea>
+ <textarea><t t-esc="widget.options.value" /></textarea>
<div class="footer">
<div class="button confirm">
Ok
diff --git a/doc/_extensions/odoo_ext/translator.py b/doc/_extensions/odoo_ext/translator.py
index 48c5e901f28..f466b9ad6d0 100644
--- a/doc/_extensions/odoo_ext/translator.py
+++ b/doc/_extensions/odoo_ext/translator.py
@@ -196,7 +196,7 @@ class BootstrapTranslator(nodes.NodeVisitor, object):
else:
opts = {}
- def warner(msg):
+ def warner(msg, **kw):
self.builder.warn(msg, (self.builder.current_docname, node.line))
highlighted = self.builder.highlighter.highlight_block(
node.rawsource, lang, opts=opts, warn=warner, linenos=linenos,
diff --git a/doc/cla/individual/anilkesariya.md b/doc/cla/individual/anilkesariya.md
new file mode 100644
index 00000000000..2b4158360eb
--- /dev/null
+++ b/doc/cla/individual/anilkesariya.md
@@ -0,0 +1,12 @@
+India, 17, Sept - 2018
+
+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,
+
+Anil Kesariya anil.r.kesariya@gmail.com https://github.com/AnilKesariya
+
diff --git a/doc/cla/individual/ark74.md b/doc/cla/individual/ark74.md
new file mode 100644
index 00000000000..e729859d95f
--- /dev/null
+++ b/doc/cla/individual/ark74.md
@@ -0,0 +1,11 @@
+Mexico, 2018-10-24
+
+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,
+
+Luis Guzman ark@switnet.org https://github.com/ark74
diff --git a/odoo/addons/base/module/module.py b/odoo/addons/base/module/module.py
index 82893800496..22ae3ca2c58 100644
--- a/odoo/addons/base/module/module.py
+++ b/odoo/addons/base/module/module.py
@@ -624,11 +624,10 @@ class Module(models.Model):
mod.write(updated_values)
else:
mod_path = modules.get_module_path(mod_name)
- if not mod_path:
+ if not mod_path or not terp:
continue
- if not terp or not terp.get('installable', True):
- continue
- mod = self.create(dict(name=mod_name, state='uninstalled', **values))
+ state = "uninstalled" if terp.get('installable', True) else "uninstallable"
+ mod = self.create(dict(name=mod_name, state=state, **values))
res[1] += 1
mod._update_dependencies(terp.get('depends', []))
diff --git a/odoo/cli/templates/default/__manifest__.py.template b/odoo/cli/templates/default/__manifest__.py.template
index 024d23c74d5..9c545b6b218 100644
--- a/odoo/cli/templates/default/__manifest__.py.template
+++ b/odoo/cli/templates/default/__manifest__.py.template
@@ -14,7 +14,7 @@
'website': "http://www.yourcompany.com",
# Categories can be used to filter modules in modules listing
- # Check https://github.com/odoo/odoo/blob/master/odoo/addons/base/module/module_data.xml
+ # Check https://github.com/odoo/odoo/blob/saas-14/odoo/addons/base/module/module_data.xml
# for the full list
'category': 'Uncategorized',
'version': '0.1',
diff --git a/odoo/modules/migration.py b/odoo/modules/migration.py
index 7f86b73a0da..78025cbfa11 100644
--- a/odoo/modules/migration.py
+++ b/odoo/modules/migration.py
@@ -25,8 +25,8 @@ class MigrationManager(object):
function. Theses files must respect a directory tree structure: A 'migrations' folder
which containt a folder by version. Version can be 'module' version or 'server.module'
version (in this case, the files will only be processed by this version of the server).
- Python file names must start by `pre` or `post` and will be executed, respectively,
- before and after the module initialisation. `end` scripts are run after all modules have
+ Python file names must start by `pre-` or `post-` and will be executed, respectively,
+ before and after the module initialisation. `end-` scripts are run after all modules have
been updated.
Example:
<moduledir>