diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 3755689cf5e..d09e1600f87 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -1477,6 +1477,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 abd637d87d5..f040f3482b9 100644 --- a/addons/account/views/web_planner_data.xml +++ b/addons/account/views/web_planner_data.xml @@ -200,7 +200,7 @@

diff --git a/addons/mass_mailing/models/mail_mail.py b/addons/mass_mailing/models/mail_mail.py index d4891e9820b..9d1fa377b83 100644 --- a/addons/mass_mailing/models/mail_mail.py +++ b/addons/mass_mailing/models/mail_mail.py @@ -55,15 +55,14 @@ class MailMail(models.Model): self.ensure_one() body = super(MailMail, self).send_get_mail_body(partner=partner) - links_blacklist = ['/unsubscribe_from_list'] - if self.mailing_id and body and self.statistics_ids: for match in re.findall(URL_REGEX, self.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(self.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 8f495eb96f5..82dd7251a1d 100644 --- a/addons/stock/i18n/stock.pot +++ b/addons/stock/i18n/stock.pot @@ -6713,6 +6713,12 @@ msgstr "" msgid "You should provide a different serial number for each piece" msgstr "" +#. module: stock +#: code:addons/stock/models/product.py:371 +#, 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:226 #, python-format diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index b48d4f8570d..c77d8ced1a4 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -364,6 +364,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'