[MERGE] forward port branch 10.0 up to 251b2fdc54
This commit is contained in:
@@ -197,7 +197,7 @@ class Channel(models.Model):
|
||||
# http://blogs.technet.com/b/exchange/archive/2006/10/06/3395024.aspx
|
||||
headers['X-Auto-Response-Suppress'] = 'OOF'
|
||||
if self.alias_domain and self.alias_name:
|
||||
headers['List-Id'] = '%s.%s' % (self.alias_name, self.alias_domain)
|
||||
headers['List-Id'] = '<%s.%s>' % (self.alias_name, self.alias_domain)
|
||||
headers['List-Post'] = '<mailto:%s@%s>' % (self.alias_name, self.alias_domain)
|
||||
# Avoid users thinking it was a personal message
|
||||
# X-Forge-To: will replace To: after SMTP envelope is determined by ir.mail.server
|
||||
|
||||
@@ -197,10 +197,14 @@ class PosOrder(models.Model):
|
||||
return InvoiceLine.sudo().create(inv_line)
|
||||
|
||||
def _create_account_move_line(self, session=None, move=None):
|
||||
def _flatten_tax_and_children(taxes):
|
||||
def _flatten_tax_and_children(taxes, group_done=None):
|
||||
children = self.env['account.tax']
|
||||
for tax in taxes:
|
||||
children |= _flatten_tax_and_children(tax.children_tax_ids)
|
||||
if group_done is None:
|
||||
group_done = set()
|
||||
for tax in taxes.filtered(lambda t: t.amount_type == 'group'):
|
||||
if tax.id not in group_done:
|
||||
group_done.add(tax.id)
|
||||
children |= _flatten_tax_and_children(tax.children_tax_ids, group_done)
|
||||
return taxes + children
|
||||
|
||||
# Tricky, via the workflow, we only have one id in the ids variable
|
||||
|
||||
@@ -1228,9 +1228,14 @@ var ClientListScreenWidget = ScreenWidget.extend({
|
||||
self.saved_client_details(partner_id);
|
||||
},function(err,event){
|
||||
event.preventDefault();
|
||||
var error_body = _t('Your Internet connection is probably down.');
|
||||
if (err.data) {
|
||||
var except = err.data;
|
||||
error_body = except.arguments && except.arguments[0] || except.message || error_body;
|
||||
}
|
||||
self.gui.show_popup('error',{
|
||||
'title': _t('Error: Could not Save Changes'),
|
||||
'body': _t('Your Internet connection is probably down.'),
|
||||
'body': error_body,
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
@@ -371,8 +371,14 @@ class Product(models.Model):
|
||||
@api.multi
|
||||
def write(self, values):
|
||||
res = super(Product, self).write(values)
|
||||
if 'active' in values and not values['active'] and self.mapped('orderpoint_ids').filtered(lambda r: r.active):
|
||||
raise UserError(_('You still have some active reordering rules on this product. Please archive or delete them first.'))
|
||||
if 'active' in values and not values['active']:
|
||||
products = self.mapped('orderpoint_ids').filtered(lambda r: r.active).mapped('product_id')
|
||||
if products:
|
||||
msg = _('You still have some active reordering rules on this product. Please archive or delete them first.')
|
||||
msg += '\n\n'
|
||||
for product in products:
|
||||
msg += '- %s \n' % product.display_name
|
||||
raise UserError(msg)
|
||||
return res
|
||||
|
||||
class ProductTemplate(models.Model):
|
||||
|
||||
Reference in New Issue
Block a user