diff --git a/addons/mail/static/src/js/many2many_tags_email.js b/addons/mail/static/src/js/many2many_tags_email.js index 4b273b456e1..dc1a405444c 100644 --- a/addons/mail/static/src/js/many2many_tags_email.js +++ b/addons/mail/static/src/js/many2many_tags_email.js @@ -82,6 +82,21 @@ var FieldMany2ManyTagsEmail = form_relational.FieldMany2ManyTags.extend({ }); }); }, + + /** + * Override for res.partner + * name_get is dynamic (based on context) while display_name is static + * (stored) + */ + get_render_data: function(ids){ + this.dataset.cancel_read(); + return this.dataset.name_get(ids).then(function (names) { + return _.map(names, function(name) { + return {id: name[0], display_name: name[1]}; + }); + }); + }, + }); diff --git a/addons/procurement/models/procurement.py b/addons/procurement/models/procurement.py index c15fff06300..83a3cf05579 100644 --- a/addons/procurement/models/procurement.py +++ b/addons/procurement/models/procurement.py @@ -296,19 +296,19 @@ class ProcurementOrder(models.Model): ProcurementSudo = self.env['procurement.order'].sudo() # Run confirmed procurements procurements = ProcurementSudo.search([('state', '=', 'confirmed')] + (company_id and [('company_id', '=', company_id)] or [])) + run_procurements = [] while procurements: procurements.run(autocommit=use_new_cursor) + run_procurements.extend(procurements.ids) if use_new_cursor: self.env.cr.commit() - procurements = ProcurementSudo.search([('id', 'not in', procurements.ids), ('state', '=', 'confirmed')] + (company_id and [('company_id', '=', company_id)] or [])) + procurements = ProcurementSudo.search([('id', 'not in', run_procurements), ('state', '=', 'confirmed')] + (company_id and [('company_id', '=', company_id)] or [])) # Check done procurements procurements = ProcurementSudo.search([('state', '=', 'running')] + (company_id and [('company_id', '=', company_id)] or [])) - while procurements: - procurements.check(autocommit=use_new_cursor) - if use_new_cursor: - self.env.cr.commit() - procurements = ProcurementSudo.search([('id', 'not in', procurements.ids), ('state', '=', 'running')] + (company_id and [('company_id', '=', company_id)] or [])) + procurements.check(autocommit=use_new_cursor) + if use_new_cursor: + self.env.cr.commit() finally: if use_new_cursor: diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index b9c52991a84..719bf08ea1a 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -669,7 +669,8 @@ class StockMove(models.Model): self.ensure_one() if self.move_dest_id: if self.propagate: - self.move_dest_id.action_cancel() + if self.move_dest_id.state not in ('done', 'cancel'): + self.move_dest_id.action_cancel() elif self.move_dest_id.state == 'waiting': # If waiting, the chain will be broken and we are not sure if we can still wait for it (=> could take from stock instead) self.move_dest_id.write({'state': 'confirmed'}) diff --git a/addons/web/static/src/less/search_view.less b/addons/web/static/src/less/search_view.less index a34905cb929..c50cd58be83 100644 --- a/addons/web/static/src/less/search_view.less +++ b/addons/web/static/src/less/search_view.less @@ -139,6 +139,9 @@ // Filters .o_filters_menu { .o-selected-li; + + max-height: ~"calc(100vh - 125px)"; + overflow: auto; .o_filter_condition { .o-search-options-dropdown-custom-li; @@ -175,6 +178,9 @@ // Group By .o_group_by_menu { .o-selected-li; + + max-height: ~"calc(100vh - 125px)"; + overflow: auto; .divider {display: none;} // hide the divider by default (no group) .o_add_group { // add button @@ -186,6 +192,9 @@ // Favorites .o_favorites_menu { .o-selected-li; + + max-height: ~"calc(100vh - 125px)"; + overflow: auto; .divider {display: none;} // hide the divider by default (no favorite) .o-searchview-custom-private, .o-searchview-custom-public { diff --git a/odoo/addons/base/ir/ir_sequence.py b/odoo/addons/base/ir/ir_sequence.py index 5431a33eac2..140ff7e01bd 100644 --- a/odoo/addons/base/ir/ir_sequence.py +++ b/odoo/addons/base/ir/ir_sequence.py @@ -96,7 +96,7 @@ class IrSequence(models.Model): def _set_number_next_actual(self): for seq in self: - seq.write({'number_next': seq.number_next_actual or 0}) + seq.write({'number_next': seq.number_next_actual or 1}) name = fields.Char(required=True) code = fields.Char(string='Sequence Code') @@ -309,7 +309,7 @@ class IrSequenceDateRange(models.Model): def _set_number_next_actual(self): for seq in self: - seq.write({'number_next': seq.number_next_actual or 0}) + seq.write({'number_next': seq.number_next_actual or 1}) date_from = fields.Date(string='From', required=True) date_to = fields.Date(string='To', required=True) diff --git a/odoo/addons/base/res/res_partner.py b/odoo/addons/base/res/res_partner.py index 5c7a0d7a147..6f4d4409fac 100644 --- a/odoo/addons/base/res/res_partner.py +++ b/odoo/addons/base/res/res_partner.py @@ -510,7 +510,7 @@ class Partner(models.Model): result = True # To write in SUPERUSER on field is_company and avoid access rights problems. if 'is_company' in vals and self.user_has_groups('base.group_partner_manager') and not self.env.uid == SUPERUSER_ID: - result = super(Partner, self).sudo().write({'is_company': vals.get('is_company')}) + result = super(Partner, self.sudo()).write({'is_company': vals.get('is_company')}) del vals['is_company'] result = result and super(Partner, self).write(vals) for partner in self: