[MERGE] forward port branch 9.0 up to ba294a397e
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
</p>
|
||||
<div class="alert alert-info info_icon" role="alert">
|
||||
<span class="fa fa-lightbulb-o fa-lg"/>
|
||||
<p>Exchange rates can be automatically updated once a day from <strong>Yahoo Finance</strong> or the <strong>European Central Bank</strong>. You can activate this feature in the bottom of the <a t-att-href="prepare_backend_url('account.action_account_config')">Accounting Settings</a><a t-att-href="prepare_backend_url('account.action_account_config')">accounting settings</a>.</p>
|
||||
<p>Exchange rates can be automatically updated once a day from <strong>Yahoo Finance</strong> or the <strong>European Central Bank</strong>. You can activate this feature in the bottom of the <a t-att-href="prepare_backend_url('account.action_account_config')">Accounting Settings</a>.</p>
|
||||
</div>
|
||||
</t>
|
||||
<t t-call="web_planner.page">
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user