diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 7b34ed360d5..1eb08906e47 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -1407,6 +1407,12 @@ class AccountPaymentTerm(models.Model): result.append((last_date, dist)) return result + @api.multi + def unlink(self): + property_recs = self.env['ir.property'].search([('value_reference', 'in', ['account.payment.term,%s'%payment_term.id for payment_term in self])]) + property_recs.unlink() + return super(AccountPaymentTerm, self).unlink() + class AccountPaymentTermLine(models.Model): _name = "account.payment.term.line" diff --git a/addons/account/views/web_planner_data.xml b/addons/account/views/web_planner_data.xml index f8cf2953d58..b4e9be0cd30 100644 --- a/addons/account/views/web_planner_data.xml +++ b/addons/account/views/web_planner_data.xml @@ -199,7 +199,7 @@

diff --git a/addons/mass_mailing/models/mail_mail.py b/addons/mass_mailing/models/mail_mail.py index 29837c02040..f4611a3250c 100644 --- a/addons/mass_mailing/models/mail_mail.py +++ b/addons/mass_mailing/models/mail_mail.py @@ -62,15 +62,14 @@ class MailMail(osv.Model): body = super(MailMail, self).send_get_mail_body(cr, uid, ids, partner=partner, context=context) mail = self.browse(cr, uid, ids[0], context=context) - links_blacklist = ['/unsubscribe_from_list'] - if mail.mailing_id and body and mail.statistics_ids: for match in re.findall(URL_REGEX, mail.body_html): - href = match[0] url = match[1] - if not [s for s in links_blacklist if s in href]: + parsed = urlparse.urlparse(url, scheme='http') + + if parsed.scheme.startswith('http') and parsed.path.startswith('/r/'): new_href = href.replace(url, url + '/m/' + str(mail.statistics_ids[0].id)) body = body.replace(href, new_href) diff --git a/addons/stock/i18n/stock.pot b/addons/stock/i18n/stock.pot index a283f506dc9..4322dd198b8 100644 --- a/addons/stock/i18n/stock.pot +++ b/addons/stock/i18n/stock.pot @@ -6489,6 +6489,12 @@ msgstr "" msgid "You should provide a different serial number for each piece" msgstr "" +#. module: stock +#: code:addons/stock/models/product.py:351 +#, python-format +msgid "You still have some active reordering rules on this product. Please archive or delete them first." +msgstr "" + #. module: stock #: code:addons/stock/models/stock_move.py:225 #, python-format diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index 8c9e5246aaf..dae15aa4f1d 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -344,6 +344,12 @@ class Product(models.Model): def action_view_routes(self): return self.mapped('product_tmpl_id').action_view_routes() + @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.')) + return res class ProductTemplate(models.Model): _inherit = 'product.template' diff --git a/openerp/addons/base/ir/ir_qweb.py b/openerp/addons/base/ir/ir_qweb.py index 9e1b322c48b..a3db07a2ccd 100644 --- a/openerp/addons/base/ir/ir_qweb.py +++ b/openerp/addons/base/ir/ir_qweb.py @@ -1043,8 +1043,7 @@ class QwebWidgetMonetary(models.AbstractModel): def _format(self, inner, options, qwebcontext): inner = qwebcontext.env['ir.qweb'].eval(inner, qwebcontext) display = qwebcontext.env['ir.qweb'].eval_object(options['display_currency'], qwebcontext) - precision = int(round(math.log10(display.rounding))) - fmt = "%.{0}f".format(-precision if precision < 0 else 0) + fmt = "%.{0}f".format(display.decimal_places) lang_code = qwebcontext.context.get('lang') or 'en_US' lang = qwebcontext.env['res.lang']._lang_get(lang_code) formatted_amount = lang.format(fmt, inner, grouping=True, monetary=True).replace(r' ', u'\N{NO-BREAK SPACE}').replace(r'-', u'\u2011')