diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 0cd76e1fd05..49687275e82 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -393,7 +393,7 @@ class AccountInvoice(models.Model): default_model='account.invoice', default_res_id=self.id, default_use_template=bool(template), - default_template_id=template.id, + default_template_id=template and template.id or False, default_composition_mode='comment', mark_invoice_as_sent=True, ) diff --git a/addons/anonymization/anonymization.py b/addons/anonymization/anonymization.py index 728745354b7..c4ef22f8a80 100644 --- a/addons/anonymization/anonymization.py +++ b/addons/anonymization/anonymization.py @@ -399,7 +399,7 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory): table_name = self.pool[model_name]._table # get the current value - sql = "select id, %s from %s" % (field_name, table_name) + sql = "select id, \"%s\" from \"%s\"" % (field_name, table_name) cr.execute(sql) records = cr.dictfetchall() for record in records: @@ -436,7 +436,7 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory): if anonymized_value is None: self._raise_after_history_update(cr, uid, history_id, _('Error !'), _("Anonymized value can not be empty.")) - sql = "update %(table)s set %(field)s = %%(anonymized_value)s where id = %%(id)s" % { + sql = "update \"%(table)s\" set \"%(field)s\" = %%(anonymized_value)s where id = %%(id)s" % { 'table': table_name, 'field': field_name, } @@ -544,7 +544,7 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory): custom_updates.sort(key=itemgetter('sequence')) queries = [(record['query'], record['query_type']) for record in custom_updates if record['query_type']] elif table_name: - queries = [("update %(table)s set %(field)s = %%(value)s where id = %%(id)s" % { + queries = [("update \"%(table)s\" set \"%(field)s\" = %%(value)s where id = %%(id)s" % { 'table': table_name, 'field': line['field_id'], }, 'sql')] diff --git a/addons/mail/models/mail_message.py b/addons/mail/models/mail_message.py index c6d306c65a9..52e8d22fc5b 100644 --- a/addons/mail/models/mail_message.py +++ b/addons/mail/models/mail_message.py @@ -858,7 +858,7 @@ class Message(models.Model): def _invalidate_documents(self): """ Invalidate the cache of the documents followed by ``self``. """ for record in self: - if record.res_id: + if record.model and record.res_id: self.env[record.model].invalidate_cache(ids=[record.res_id]) @api.model diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index 4904dde752d..cbfa135066f 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -189,6 +189,7 @@ td { height: 100%; display: table; border: none; + overflow: hidden; } .pos .window .subwindow{ display: table-row; @@ -213,6 +214,19 @@ td { position: relative; } +.pos .clientlist-screen .window, +.pos .clientlist-screen .full-content .subwindow{ + display: block; +} +.pos .clientlist-screen .full-content .subwindow-container{ + display: block; + height: 100%; +} +.pos .clientlist-screen .full-content .subwindow.collapsed, +.pos .clientlist-screen .full-content .subwindow-container.collapsed{ + height: auto; +} + /* ---- Scrollers ----- */ .pos .scroller-container{ @@ -701,6 +715,7 @@ td { display: inline-block; float: right; text-align: center; + width: 216px; margin: 16px; margin-top: 8px; margin-left: 0px; diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 5bfa8f1e309..b28e5642121 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -1309,6 +1309,9 @@ var ClientListScreenWidget = ScreenWidget.extend({ var new_height = contents.height(); if(!this.details_visible){ + // resize client list to take into account client details + parent.height('-=' + new_height); + if(clickpos < scroll + new_height + 20 ){ parent.scrollTop( clickpos - 20 ); }else{ @@ -1338,6 +1341,7 @@ var ClientListScreenWidget = ScreenWidget.extend({ }); } else if (visibility === 'hide') { contents.empty(); + parent.height('100%'); if( height > scroll ){ contents.css({height:height+'px'}); contents.animate({height:0},400,function(){ diff --git a/addons/portal/wizard/portal_wizard.py b/addons/portal/wizard/portal_wizard.py index 27bc21835e5..ebd34af2b02 100644 --- a/addons/portal/wizard/portal_wizard.py +++ b/addons/portal/wizard/portal_wizard.py @@ -141,7 +141,10 @@ class wizard_user(osv.osv_memory): user_id = False # create a user if necessary, and make sure it is in the portal group if not user: - company_id = wizard_user.partner_id.company_id.id + if wizard_user.partner_id.company_id: + company_id = wizard_user.partner_id.company_id.id + else: + company_id = self.pool['res.company']._company_default_get(cr, uid, 'res.users', context=context) user_id = self._create_user(cr, SUPERUSER_ID, wizard_user.id, dict(context, company_id=company_id)) else: user_id = user.id diff --git a/addons/project/web_planner_data.xml b/addons/project/web_planner_data.xml index 10716495060..4c96a2ebc2b 100644 --- a/addons/project/web_planner_data.xml +++ b/addons/project/web_planner_data.xml @@ -246,7 +246,6 @@
Need help with defining your Projects? Contact us now.
- Website Live Chat Email Our Project Expert
@@ -360,7 +359,6 @@
Need help to structure your projects?
- Website Live Chat on
Email Our Project Expert
@@ -569,9 +567,6 @@
Need help with Timesheets management? Contact us now:
- - Website Live Chat on - Email Our Project Expert
@@ -650,7 +645,6 @@
Contact us now:
- Website Live Chat on
Email Our Project Expert
@@ -1046,7 +1040,6 @@
Contact us now:
- Website Live Chat on
Email Our Project Expert
diff --git a/doc/cla/individual/anothingguy.md b/doc/cla/individual/anothingguy.md new file mode 100644 index 00000000000..496f7a2b0e8 --- /dev/null +++ b/doc/cla/individual/anothingguy.md @@ -0,0 +1,11 @@ +Vietnam, 2016-10-14 + +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, + +Hoang Diep Huu mr.diephuuhoang@gmail.com https://github.com/anothingguy diff --git a/doc/cla/individual/sergiocorato.md b/doc/cla/individual/sergiocorato.md new file mode 100644 index 00000000000..5ac26c3f7ea --- /dev/null +++ b/doc/cla/individual/sergiocorato.md @@ -0,0 +1,9 @@ +Italy, 2017-01-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, + +Sergio Corato sergiocorato@gmail.com https://github.com/sergiocorato diff --git a/openerp/__init__.py b/openerp/__init__.py index 5bb2fd18611..d31eb04d654 100644 --- a/openerp/__init__.py +++ b/openerp/__init__.py @@ -6,11 +6,17 @@ #---------------------------------------------------------- # Running mode flags (gevent, prefork) #---------------------------------------------------------- -# Is the server running with gevent. -import sys -evented = False -if sys.modules.get("gevent") is not None: - evented = True +def is_server_running_with_gevent(): + import sys + if sys.modules.get("gevent") is not None: + import socket + import gevent.socket + if socket.socket is gevent.socket.socket: + # gevent is loaded and activated + return True + return False + +evented = is_server_running_with_gevent() # Is the server running in pefork mode (e.g. behind Gunicorn). # If this is True, the processes have to communicate some events,