[MERGE] forward port branch 9.0 up to 2662739187
This commit is contained in:
@@ -479,7 +479,7 @@ class MassMailing(osv.Model):
|
|||||||
'create_date': fields.datetime('Creation Date'),
|
'create_date': fields.datetime('Creation Date'),
|
||||||
'sent_date': fields.datetime('Sent Date', oldname='date', copy=False),
|
'sent_date': fields.datetime('Sent Date', oldname='date', copy=False),
|
||||||
'schedule_date': fields.datetime('Schedule in the Future'),
|
'schedule_date': fields.datetime('Schedule in the Future'),
|
||||||
'body_html': fields.html('Body', translate=html_translate, sanitize=False),
|
'body_html': fields.html('Body', sanitize=False),
|
||||||
'attachment_ids': fields.many2many(
|
'attachment_ids': fields.many2many(
|
||||||
'ir.attachment', 'mass_mailing_ir_attachments_rel',
|
'ir.attachment', 'mass_mailing_ir_attachments_rel',
|
||||||
'mass_mailing_id', 'attachment_id', 'Attachments'
|
'mass_mailing_id', 'attachment_id', 'Attachments'
|
||||||
|
|||||||
@@ -761,7 +761,8 @@ class PosOrderLine(models.Model):
|
|||||||
fiscal_position_id = line.order_id.fiscal_position_id
|
fiscal_position_id = line.order_id.fiscal_position_id
|
||||||
if fiscal_position_id:
|
if fiscal_position_id:
|
||||||
taxes = fiscal_position_id.map_tax(taxes)
|
taxes = fiscal_position_id.map_tax(taxes)
|
||||||
price = line.price_unit * (1 - (line.discount or 0.0) / 100.0)
|
price = self.env['account.tax']._fix_tax_included_price(
|
||||||
|
line.price_unit * (1 - (line.discount or 0.0) / 100.0), line.product_id.taxes_id, taxes)
|
||||||
line.price_subtotal = line.price_subtotal_incl = price * line.qty
|
line.price_subtotal = line.price_subtotal_incl = price * line.qty
|
||||||
if taxes:
|
if taxes:
|
||||||
taxes = taxes.compute_all(price, currency, line.qty, product=line.product_id, partner=line.order_id.partner_id or False)
|
taxes = taxes.compute_all(price, currency, line.qty, product=line.product_id, partner=line.order_id.partner_id or False)
|
||||||
|
|||||||
@@ -2329,7 +2329,6 @@ td {
|
|||||||
}
|
}
|
||||||
.pos .popup-password .popup-input {
|
.pos .popup-password .popup-input {
|
||||||
width: 70%;
|
width: 70%;
|
||||||
-webkit-text-security: disc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.pos .popup .body ul,
|
.pos .popup .body ul,
|
||||||
|
|||||||
@@ -238,6 +238,11 @@ var PasswordPopupWidget = NumberPopupWidget.extend({
|
|||||||
this._super();
|
this._super();
|
||||||
this.$('.popup').addClass('popup-password');
|
this.$('.popup').addClass('popup-password');
|
||||||
},
|
},
|
||||||
|
click_numpad: function(event){
|
||||||
|
this._super.apply(this, arguments);
|
||||||
|
var $value = this.$('.value');
|
||||||
|
$value.text($value.text().replace(/./g, '•'));
|
||||||
|
},
|
||||||
});
|
});
|
||||||
gui.define_popup({name:'password', widget: PasswordPopupWidget});
|
gui.define_popup({name:'password', widget: PasswordPopupWidget});
|
||||||
|
|
||||||
|
|||||||
@@ -183,6 +183,11 @@ var FieldTextHtml = widget.extend({
|
|||||||
template: 'web_editor.FieldTextHtml',
|
template: 'web_editor.FieldTextHtml',
|
||||||
willStart: function () {
|
willStart: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
if (this.field.translate === false) {
|
||||||
|
this.languages = [];
|
||||||
|
return $.when();
|
||||||
|
}
|
||||||
return new Model('res.lang').call("search_read", [[['code', '!=', 'en_US']], ["name", "code"]]).then(function (res) {
|
return new Model('res.lang').call("search_read", [[['code', '!=', 'en_US']], ["name", "code"]]).then(function (res) {
|
||||||
self.languages = res;
|
self.languages = res;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ class IrTranslationImport(object):
|
|||||||
# of ir_translation, so this copy will be much faster.
|
# of ir_translation, so this copy will be much faster.
|
||||||
query = """ CREATE TEMP TABLE %s (
|
query = """ CREATE TEMP TABLE %s (
|
||||||
imd_model VARCHAR(64),
|
imd_model VARCHAR(64),
|
||||||
imd_name VARCHAR(128)
|
imd_name VARCHAR(128),
|
||||||
|
noupdate BOOLEAN
|
||||||
) INHERITS (%s) """ % (self._table, self._model_table)
|
) INHERITS (%s) """ % (self._table, self._model_table)
|
||||||
self._cr.execute(query)
|
self._cr.execute(query)
|
||||||
|
|
||||||
@@ -104,7 +105,8 @@ class IrTranslationImport(object):
|
|||||||
|
|
||||||
# Step 1: resolve ir.model.data references to res_ids
|
# Step 1: resolve ir.model.data references to res_ids
|
||||||
cr.execute(""" UPDATE %s AS ti
|
cr.execute(""" UPDATE %s AS ti
|
||||||
SET res_id = imd.res_id
|
SET res_id = imd.res_id,
|
||||||
|
noupdate = imd.noupdate
|
||||||
FROM ir_model_data AS imd
|
FROM ir_model_data AS imd
|
||||||
WHERE ti.res_id IS NULL
|
WHERE ti.res_id IS NULL
|
||||||
AND ti.module IS NOT NULL AND ti.imd_name IS NOT NULL
|
AND ti.module IS NOT NULL AND ti.imd_name IS NOT NULL
|
||||||
@@ -150,7 +152,10 @@ class IrTranslationImport(object):
|
|||||||
src = ti.src,
|
src = ti.src,
|
||||||
state = 'translated'
|
state = 'translated'
|
||||||
FROM %s AS ti
|
FROM %s AS ti
|
||||||
WHERE %s AND ti.value IS NOT NULL AND ti.value != ''
|
WHERE %s
|
||||||
|
AND ti.value IS NOT NULL
|
||||||
|
AND ti.value != ''
|
||||||
|
AND noupdate IS NOT TRUE
|
||||||
""" % (self._model_table, self._table, find_expr),
|
""" % (self._model_table, self._table, find_expr),
|
||||||
(tuple(src_relevant_fields), tuple(src_relevant_fields)))
|
(tuple(src_relevant_fields), tuple(src_relevant_fields)))
|
||||||
|
|
||||||
|
|||||||
@@ -13,3 +13,20 @@ class TestTermCount(common.TransactionCase):
|
|||||||
ids = self.registry('ir.translation').search(self.cr, self.uid,
|
ids = self.registry('ir.translation').search(self.cr, self.uid,
|
||||||
[('src', '=', '1XBUO5PUYH2RYZSA1FTLRYS8SPCNU1UYXMEYMM25ASV7JC2KTJZQESZYRV9L8CGB')])
|
[('src', '=', '1XBUO5PUYH2RYZSA1FTLRYS8SPCNU1UYXMEYMM25ASV7JC2KTJZQESZYRV9L8CGB')])
|
||||||
self.assertEqual(len(ids), 2)
|
self.assertEqual(len(ids), 2)
|
||||||
|
|
||||||
|
def test_noupdate(self):
|
||||||
|
"""
|
||||||
|
Make sure no update do not overwrite translations
|
||||||
|
"""
|
||||||
|
menu = self.env.ref('test_translation_import.menu_test_translation_import')
|
||||||
|
menu.name = "New Name"
|
||||||
|
# install french and change translation content
|
||||||
|
odoo.tools.trans_load(self.cr, 'test_translation_import/i18n/fr.po', 'fr_FR', verbose=False)
|
||||||
|
menu.with_context(lang='fr_FR').name = "Nouveau nom"
|
||||||
|
# reload with overwrite
|
||||||
|
odoo.tools.trans_load(self.cr, 'test_translation_import/i18n/fr.po', 'fr_FR', verbose=False, context={'overwrite': True})
|
||||||
|
|
||||||
|
# trans_load invalidates ormcache but not record cache
|
||||||
|
menu.refresh()
|
||||||
|
self.assertEqual(menu.name, "New Name")
|
||||||
|
self.assertEqual(menu.with_context(lang='fr_FR').name, "Nouveau nom")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<openerp>
|
<openerp>
|
||||||
<data>
|
<data noupdate="1">
|
||||||
|
|
||||||
<record id="action_test_translation_import" model="ir.actions.act_window">
|
<record id="action_test_translation_import" model="ir.actions.act_window">
|
||||||
<field name="name">Test translation import</field>
|
<field name="name">Test translation import</field>
|
||||||
|
|||||||
Reference in New Issue
Block a user