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 @@
@@ -360,7 +359,6 @@