[MERGE] forward port branch 10.0 up to 1022e4fb25

This commit is contained in:
Christophe Simonis
2017-12-13 15:56:15 +01:00
6 changed files with 35 additions and 10 deletions
@@ -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]};
});
});
},
});
+6 -6
View File
@@ -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:
+2 -1
View File
@@ -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'})
@@ -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 {
+2 -2
View File
@@ -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)
+1 -1
View File
@@ -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: