diff --git a/addons/website_sale/models/sale_order.py b/addons/website_sale/models/sale_order.py
index 2624a2f50ca..1d83cdb28ff 100644
--- a/addons/website_sale/models/sale_order.py
+++ b/addons/website_sale/models/sale_order.py
@@ -17,8 +17,9 @@ class SaleOrder(models.Model):
_inherit = "sale.order"
website_order_line = fields.One2many(
- 'sale.order.line', 'order_id',
- string='Order Lines displayed on Website', readonly=True,
+ 'sale.order.line',
+ compute='_compute_website_order_line',
+ string='Order Lines displayed on Website',
help='Order Lines to be displayed on the website. They should not be used for computation purpose.',
)
cart_quantity = fields.Integer(compute='_compute_cart_info', string='Cart Quantity')
@@ -29,6 +30,10 @@ class SaleOrder(models.Model):
help='Website through which this order was placed.',
store=True, readonly=True)
+ @api.one
+ def _compute_website_order_line(self):
+ self.website_order_line = self.order_line
+
@api.multi
@api.depends('website_order_line.product_uom_qty', 'website_order_line.product_id')
def _compute_cart_info(self):
diff --git a/addons/website_sale/models/website.py b/addons/website_sale/models/website.py
index 570ef96c45f..4f8f7b15519 100644
--- a/addons/website_sale/models/website.py
+++ b/addons/website_sale/models/website.py
@@ -177,7 +177,7 @@ class Website(models.Model):
'partner_id': partner.id,
'pricelist_id': pricelist.id,
'payment_term_id': self.sale_get_payment_term(partner),
- 'team_id': self.salesteam_id.id,
+ 'team_id': self.salesteam_id.id or partner.parent_id.team_id.id or partner.team_id.id,
'partner_invoice_id': partner.id,
'partner_shipping_id': addr['delivery'],
'user_id': salesperson_id or self.salesperson_id.id or default_user_id,
diff --git a/addons/website_sale_delivery/models/sale_order.py b/addons/website_sale_delivery/models/sale_order.py
index a44c18fa07d..4cf21e3b587 100644
--- a/addons/website_sale_delivery/models/sale_order.py
+++ b/addons/website_sale_delivery/models/sale_order.py
@@ -17,11 +17,11 @@ class SaleOrder(models.Model):
has_delivery = fields.Boolean(
compute='_compute_has_delivery', string='Has delivery',
help="Has an order line set for delivery", store=True)
- website_order_line = fields.One2many(
- 'sale.order.line', 'order_id',
- string='Order Lines displayed on Website', readonly=True,
- domain=[('is_delivery', '=', False)],
- help='Order Lines to be displayed on the website. They should not be used for computation purpose.')
+
+ @api.one
+ def _compute_website_order_line(self):
+ super(SaleOrder, self)._compute_website_order_line()
+ self.website_order_line = self.website_order_line.filtered(lambda l: not l.is_delivery)
@api.depends('order_line.price_unit', 'order_line.tax_id', 'order_line.discount', 'order_line.product_uom_qty')
def _compute_amount_delivery(self):
diff --git a/doc/cla/corporate/dreambits.md b/doc/cla/corporate/dreambits.md
new file mode 100644
index 00000000000..d1dd942436c
--- /dev/null
+++ b/doc/cla/corporate/dreambits.md
@@ -0,0 +1,16 @@
+India, 2018-09-18
+
+Dreambits Technologies Pvt. Ltd. agrees to the terms of the Odoo Corporate Contributor License
+Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+Karan Shah admin@dreambits.in https://github.com/karan-dreambits
+
+List of contributors:
+
+Karan Shah admin@dreambits.in https://github.com/karan-dreambits
+Devang Pipaliya devang@dreambits.in https://github.com/devang-dreambits
diff --git a/doc/cla/corporate/inspur.md b/doc/cla/corporate/inspur.md
new file mode 100644
index 00000000000..88999bdf10b
--- /dev/null
+++ b/doc/cla/corporate/inspur.md
@@ -0,0 +1,17 @@
+China, 2018-09-28
+
+Inspur Genersoft Co., Ltd agrees to the terms of the Odoo Corporate Contributor
+License Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+David Yu, yudw@inspur.com
+
+List of contributors:
+
+Brain Wang wangbuke@inspur.com
+David Yu yudw@inspur.com
+Alex Aisin-Gioro wubai@inspur.com
diff --git a/doc/reference/cmdline.rst b/doc/reference/cmdline.rst
index 18c1efb4656..83df644f150 100644
--- a/doc/reference/cmdline.rst
+++ b/doc/reference/cmdline.rst
@@ -56,7 +56,7 @@ Running the server
Maximum allowed virtual memory per worker. If the limit is exceeded,
the worker is killed and recycled at the end of the current request.
- Defaults to 2048MB.
+ Defaults to 2048MiB.
.. option:: --limit-memory-hard
@@ -64,7 +64,7 @@ Running the server
immediately killed without waiting for the end of the current request
processing.
- Defaults to 2560MB.
+ Defaults to 2560MiB.
.. option:: --limit-time-cpu
diff --git a/odoo/addons/base/data/res_country_data.xml b/odoo/addons/base/data/res_country_data.xml
index 2eaa0d0abf3..3e0db583e3e 100644
--- a/odoo/addons/base/data/res_country_data.xml
+++ b/odoo/addons/base/data/res_country_data.xml
@@ -653,6 +653,7 @@
+ NIT
Guam
@@ -1127,6 +1128,7 @@
RFC
+
Malaysia
@@ -1732,6 +1734,7 @@
+
Vanuatu
diff --git a/odoo/addons/base/models/ir_actions.py b/odoo/addons/base/models/ir_actions.py
index 8d820da5d9f..18951749f61 100644
--- a/odoo/addons/base/models/ir_actions.py
+++ b/odoo/addons/base/models/ir_actions.py
@@ -568,6 +568,9 @@ class IrActionsServer(models.Model):
active_id = self._context.get('active_id')
if not active_id and self._context.get('onchange_self'):
active_id = self._context['onchange_self']._origin.id
+ if not active_id: # onchange on new record
+ func = getattr(self, 'run_action_%s' % action.state)
+ res = func(action, eval_context=eval_context)
active_ids = self._context.get('active_ids', [active_id] if active_id else [])
for active_id in active_ids:
# run context dedicated to a particular active_id
diff --git a/odoo/addons/base/models/ir_http.py b/odoo/addons/base/models/ir_http.py
index 23bd0af4df1..84b29147f40 100644
--- a/odoo/addons/base/models/ir_http.py
+++ b/odoo/addons/base/models/ir_http.py
@@ -298,16 +298,18 @@ class IrHttp(models.AbstractModel):
obj = cls._xmlid_to_obj(env, xmlid)
if access_mode:
obj = cls.check_access_mode(env, id, access_mode, model, access_token=access_token, related_id=related_id)
- elif id and model == 'ir.attachment' and access_token:
- obj = env[model].sudo().browse(int(id))
- if not consteq(obj.access_token or '', access_token):
- return (403, [], None)
elif id and model in env.registry:
obj = env[model].browse(int(id))
# obj exists
if not obj or not obj.exists() or field not in obj:
return (404, [], None)
+ # access token grant access
+ if model == 'ir.attachment' and access_token:
+ obj = obj.sudo()
+ if not consteq(obj.access_token or '', access_token):
+ return (403, [], None)
+
# check read access
try:
last_update = obj['__last_update']
diff --git a/odoo/addons/base/models/res_users.py b/odoo/addons/base/models/res_users.py
index b1aee2245f0..247fb367334 100644
--- a/odoo/addons/base/models/res_users.py
+++ b/odoo/addons/base/models/res_users.py
@@ -1038,7 +1038,7 @@ class GroupsView(models.Model):
def linearize(app, gs):
# 'User Type' is an exception
if app.xml_id == 'base.module_category_user_type':
- return (app, 'selection', gs)
+ return (app, 'selection', gs.sorted('id'))
# determine sequence order: a group appears after its implied groups
order = {g: len(g.trans_implied_ids & gs) for g in gs}
# check whether order is total, i.e., sequence orders are distinct
diff --git a/odoo/addons/base/tests/test_ir_http.py b/odoo/addons/base/tests/test_ir_http.py
index 313a86f308d..2cdcaf74dcf 100644
--- a/odoo/addons/base/tests/test_ir_http.py
+++ b/odoo/addons/base/tests/test_ir_http.py
@@ -80,3 +80,53 @@ class test_ir_http_mimetype(common.TransactionCase):
mimetype = dict(headers).get('Content-Type')
self.assertEqual(mimetype, 'image/gif')
+ def test_ir_http_attachment_access(self):
+ """ Test attachment access with and without access token """
+ public_user = self.env.ref('base.public_user')
+ attachment = self.env['ir.attachment'].create({
+ 'datas': GIF,
+ 'name': 'Test valid access token with image',
+ 'datas_fname': 'image.gif'
+ })
+
+ defaults = {
+ 'id': attachment.id,
+ 'default_mimetype': 'image/gif',
+ 'env': public_user.sudo(public_user.id).env,
+ }
+
+ def test_access(**kwargs):
+ status, _, _ = self.env['ir.http'].binary_content(
+ **defaults, **kwargs
+ )
+ return status
+
+ status = test_access()
+ self.assertEqual(status, 403, "no access")
+
+ status = test_access(access_token='Secret')
+ self.assertEqual(status, 403,
+ "no access if access token for attachment without access token")
+
+ attachment.access_token = 'Secret'
+ status = test_access(access_token='Secret')
+ self.assertEqual(status, 200, "access for correct access token")
+
+ status = test_access(access_token='Wrong')
+ self.assertEqual(status, 403, "no access for wrong access token")
+
+ attachment.public = True
+ status = test_access()
+ self.assertEqual(status, 200, "access for attachment with access")
+
+ status = test_access(access_token='Wrong')
+ self.assertEqual(status, 403,
+ "no access for wrong access token for attachment with access")
+
+ attachment.unlink()
+ status = test_access()
+ self.assertEqual(status, 404, "no access for deleted attachment")
+
+ status = test_access(access_token='Secret')
+ self.assertEqual(status, 404,
+ "no access with access token for deleted attachment")
diff --git a/odoo/addons/test_new_api/demo_data.xml b/odoo/addons/test_new_api/demo_data.xml
index 9edab779fcc..ff048467183 100644
--- a/odoo/addons/test_new_api/demo_data.xml
+++ b/odoo/addons/test_new_api/demo_data.xml
@@ -16,6 +16,7 @@
Hey dude!
+ hello
@@ -27,6 +28,11 @@
This is a much longer message
+
+
+ first@example.localhost
+
+
diff --git a/odoo/addons/test_new_api/models.py b/odoo/addons/test_new_api/models.py
index a932197afc9..bc0a3e45876 100644
--- a/odoo/addons/test_new_api/models.py
+++ b/odoo/addons/test_new_api/models.py
@@ -74,7 +74,7 @@ class Discussion(models.Model):
categories = fields.Many2many('test_new_api.category',
'test_new_api_discussion_category', 'discussion', 'category')
participants = fields.Many2many('res.users', context={'active_test': False})
- messages = fields.One2many('test_new_api.message', 'discussion')
+ messages = fields.One2many('test_new_api.message', 'discussion', copy=True)
message_concat = fields.Text(string='Message concatenate')
important_messages = fields.One2many('test_new_api.message', 'discussion',
domain=[('important', '=', True)])
@@ -128,6 +128,7 @@ class Message(models.Model):
'res.partner', compute='_compute_author_partner',
search='_search_author_partner')
important = fields.Boolean()
+ label = fields.Char(translate=True)
@api.one
@api.constrains('author', 'discussion')
diff --git a/odoo/addons/test_new_api/tests/test_new_fields.py b/odoo/addons/test_new_api/tests/test_new_fields.py
index 79dab154941..8284f4652c6 100644
--- a/odoo/addons/test_new_api/tests/test_new_fields.py
+++ b/odoo/addons/test_new_api/tests/test_new_fields.py
@@ -964,6 +964,40 @@ class TestFields(common.TransactionCase):
self.assertEqual(len(discussion.important_messages), 2)
self.assertEqual(len(discussion.very_important_messages), 2)
+ def test_80_copy(self):
+ Translations = self.env['ir.translation']
+ discussion = self.env.ref('test_new_api.discussion_0')
+ message = self.env.ref('test_new_api.message_0_0')
+ message1 = self.env.ref('test_new_api.message_0_1')
+
+ email = self.env.ref('test_new_api.emailmessage_0_0')
+ self.assertEqual(email.message, message)
+
+ french = self.env['res.lang']._lang_get('fr_FR')
+ french.active = True
+
+ def count(msg):
+ # return the number of translations of msg.label
+ return Translations.search_count([
+ ('name', '=', 'test_new_api.message,label'),
+ ('res_id', '=', msg.id),
+ ])
+
+ # set a translation for message.label
+ email.with_context(lang='fr_FR').label = "bonjour"
+ self.assertEqual(count(message), 1)
+ self.assertEqual(count(message1), 0)
+
+ # setting the parent record should not copy its translations
+ email.copy({'message': message1.id})
+ self.assertEqual(count(message), 1)
+ self.assertEqual(count(message1), 0)
+
+ # setting a one2many should not copy translations on the lines
+ discussion.copy({'messages': [(6, 0, message1.ids)]})
+ self.assertEqual(count(message), 1)
+ self.assertEqual(count(message1), 0)
+
class TestX2many(common.TransactionCase):
def test_search_many2many(self):
diff --git a/odoo/addons/test_translation_import/i18n/dot.csv b/odoo/addons/test_translation_import/i18n/dot.csv
new file mode 100644
index 00000000000..5c4fc6ae34d
--- /dev/null
+++ b/odoo/addons/test_translation_import/i18n/dot.csv
@@ -0,0 +1,2 @@
+module,type,name,res_id,src,value,comments
+test_translation_import,code,addons/test_translation_import/models.py,20,Accounting,samva,
diff --git a/odoo/addons/test_translation_import/i18n/tlh.po b/odoo/addons/test_translation_import/i18n/tlh.po
new file mode 100644
index 00000000000..758a27ffa08
--- /dev/null
+++ b/odoo/addons/test_translation_import/i18n/tlh.po
@@ -0,0 +1,20 @@
+# This is a test PO file, not a complete one. It is manually maintained
+# to test the import translation behavior of Odoo.
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server saas~11.4\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2018-09-18 13:20+0000\n"
+"PO-Revision-Date: 2018-09-18 13:20+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: test_translation_import
+#: code:addons/test_translation_import/models.py:18
+#, python-format
+msgid "Klingon"
+msgstr "tlhIngan"
diff --git a/odoo/addons/test_translation_import/models.py b/odoo/addons/test_translation_import/models.py
index 58d17c8c162..9e803190eea 100644
--- a/odoo/addons/test_translation_import/models.py
+++ b/odoo/addons/test_translation_import/models.py
@@ -15,3 +15,7 @@ class m(models.TransientModel):
# With the name label above, this source string should be generated twice.
_('1XBUO5PUYH2RYZSA1FTLRYS8SPCNU1UYXMEYMM25ASV7JC2KTJZQESZYRV9L8CGB')
+
+ _('Klingon')
+
+ _('Accounting')
diff --git a/odoo/addons/test_translation_import/tests/test_term_count.py b/odoo/addons/test_translation_import/tests/test_term_count.py
index c89bf44ed25..7e224bfdd7b 100644
--- a/odoo/addons/test_translation_import/tests/test_term_count.py
+++ b/odoo/addons/test_translation_import/tests/test_term_count.py
@@ -1,10 +1,13 @@
# -*- coding: utf-8 -*-
from contextlib import closing
+import base64
import io
import odoo
from odoo.tests import common
+from odoo.tools.misc import file_open, mute_logger
+from odoo.tools.translate import _
class TestTermCount(common.TransactionCase):
@@ -79,3 +82,49 @@ class TestTermCount(common.TransactionCase):
menu.with_context(lang='fr_FR').name = "Nouveau nom"
update_translations()
self.assertEqual(menu.with_context(lang='fr_FR').name, "Nouveau nom", 'The translation of "New Name" should be "Nouveau nom"')
+
+ def test_import_from_po_file(self):
+ """Test the import from a single po file works"""
+ with file_open('test_translation_import/i18n/tlh.po', 'rb') as f:
+ po_file = base64.encodestring(f.read())
+
+ import_tlh = self.env["base.language.import"].create({
+ 'name': 'Klingon',
+ 'code': 'tlh',
+ 'data': po_file,
+ 'filename': 'tlh.po',
+ })
+ with mute_logger('odoo.addons.base.models.res_lang'):
+ import_tlh.import_lang()
+
+ lang_count = self.env['res.lang'].search_count([('code', '=', 'tlh')])
+ self.assertEqual(lang_count, 1, "The imported language was not creates")
+
+ trans_count = self.env['ir.translation'].search_count([('lang', '=', 'tlh')])
+ self.assertEqual(trans_count, 1, "The imported translations were not created")
+
+ self.env.context = dict(self.env.context, lang="tlh")
+ self.assertEqual(_("Klingon"), "tlhIngan", "The code translation was not applied")
+
+ def test_import_from_csv_file(self):
+ """Test the import from a single CSV file works"""
+ with file_open('test_translation_import/i18n/dot.csv', 'rb') as f:
+ po_file = base64.encodestring(f.read())
+
+ import_tlh = self.env["base.language.import"].create({
+ 'name': 'Dothraki',
+ 'code': 'dot',
+ 'data': po_file,
+ 'filename': 'dot.csv',
+ })
+ with mute_logger('odoo.addons.base.models.res_lang'):
+ import_tlh.import_lang()
+
+ lang_count = self.env['res.lang'].search_count([('code', '=', 'dot')])
+ self.assertEqual(lang_count, 1, "The imported language was not creates")
+
+ trans_count = self.env['ir.translation'].search_count([('lang', '=', 'dot')])
+ self.assertEqual(trans_count, 1, "The imported translations were not created")
+
+ self.env.context = dict(self.env.context, lang="dot")
+ self.assertEqual(_("Accounting"), "samva", "The code translation was not applied")
diff --git a/odoo/fields.py b/odoo/fields.py
index deee1492315..8d2f939fd88 100644
--- a/odoo/fields.py
+++ b/odoo/fields.py
@@ -1754,7 +1754,10 @@ class Binary(Field):
return None
if isinstance(value, bytes):
return psycopg2.Binary(value)
- return psycopg2.Binary(pycompat.text_type(value).encode('ascii'))
+ try:
+ return psycopg2.Binary(pycompat.text_type(value).encode('ascii'))
+ except UnicodeEncodeError:
+ raise UserError(_("ASCII characters are required for %s in %s") % (value, self.name))
def convert_to_cache(self, value, record, validate=True):
if isinstance(value, _BINARY):
diff --git a/odoo/models.py b/odoo/models.py
index 48e17c487e3..c0e5aa8033a 100644
--- a/odoo/models.py
+++ b/odoo/models.py
@@ -4133,7 +4133,13 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
return [default]
@api.multi
- def copy_translations(old, new):
+ def copy_translations(old, new, excluded=()):
+ """ Recursively copy the translations from original to new record
+
+ :param old: the original record
+ :param new: the new record (copy of the original one)
+ :param excluded: a container of user-provided field names
+ """
# avoid recursion through already copied records in case of circular relationship
if '__copy_translations_seen' not in old._context:
old = old.with_context(__copy_translations_seen=defaultdict(set))
@@ -4159,13 +4165,20 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
if not field.copy:
continue
- if field.type == 'one2many':
+ if field.inherited and field.related[0] in excluded:
+ # inherited fields that come from a user-provided parent record
+ # must not copy translations, as the parent record is not a copy
+ # of the old parent record
+ continue
+
+ if field.type == 'one2many' and field.name not in excluded:
# we must recursively copy the translations for o2m; here we
# rely on the order of the ids to match the translations as
# foreseen in copy_data()
old_lines = old[name].sorted(key='id')
new_lines = new[name].sorted(key='id')
for (old_line, new_line) in pycompat.izip(old_lines, new_lines):
+ # don't pass excluded as it is not about those lines
old_line.copy_translations(new_line)
elif field.translate:
@@ -4207,7 +4220,7 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
vals = self.copy_data(default)[0]
# To avoid to create a translation in the lang of the user, copy_translation will do it
new = self.with_context(lang=None).create(vals)
- self.with_context(from_copy_translation=True).copy_translations(new)
+ self.with_context(from_copy_translation=True).copy_translations(new, excluded=default or ())
return new
@api.multi
diff --git a/odoo/tools/config.py b/odoo/tools/config.py
index 778fcc1def1..0f4c0d0761d 100644
--- a/odoo/tools/config.py
+++ b/odoo/tools/config.py
@@ -286,10 +286,12 @@ class configmanager(object):
help="Specify the number of workers, 0 disable prefork mode.",
type="int")
group.add_option("--limit-memory-soft", dest="limit_memory_soft", my_default=2048 * 1024 * 1024,
- help="Maximum allowed virtual memory per worker, when reached the worker be reset after the current request (default 671088640 aka 640MB).",
+ help="Maximum allowed virtual memory per worker, when reached the worker be "
+ "reset after the current request (default 2048MiB).",
type="int")
group.add_option("--limit-memory-hard", dest="limit_memory_hard", my_default=2560 * 1024 * 1024,
- help="Maximum allowed virtual memory per worker, when reached, any memory allocation will fail (default 805306368 aka 768MB).",
+ help="Maximum allowed virtual memory per worker, when reached, any memory "
+ "allocation will fail (default 2560MiB).",
type="int")
group.add_option("--limit-time-cpu", dest="limit_time_cpu", my_default=60,
help="Maximum allowed CPU time per request (default 60).",
diff --git a/odoo/tools/translate.py b/odoo/tools/translate.py
index 4ff7f559cf6..cb672b9d3b4 100644
--- a/odoo/tools/translate.py
+++ b/odoo/tools/translate.py
@@ -1038,6 +1038,7 @@ def trans_load_data(cr, fileobj, fileformat, lang, lang_name=None, verbose=True,
# (Because the POT comments are correct on Launchpad but not the
# PO comments due to a Launchpad limitation. See LP bug 933496.)
pot_reader = []
+ use_pot_reference = False
# now, the serious things: we read the language file
fileobj.seek(0)
@@ -1066,6 +1067,7 @@ def trans_load_data(cr, fileobj, fileformat, lang, lang_name=None, verbose=True,
pot_handle = file_open(os.path.join(
addons, module, i18n_dir, module + '.pot'), mode='rb')
pot_reader = PoFile(pot_handle)
+ use_pot_reference = True
except:
pass
@@ -1100,17 +1102,18 @@ def trans_load_data(cr, fileobj, fileformat, lang, lang_name=None, verbose=True,
dic['lang'] = lang
dic.update(pycompat.izip(fields, row))
- # discard the target from the POT targets.
- src = dic['src']
- target_key = (dic['type'], dic['name'], dic['type'] != 'code' and dic['res_id'] or 0)
- target = pot_targets.get(src)
- if not target or target_key not in target.targets:
- _logger.info("Translation '%s' (%s, %s, %s) not found in reference pot, skipping",
- src[:60], dic['type'], dic['name'], dic['res_id'])
- return
+ if use_pot_reference:
+ # discard the target from the POT targets.
+ src = dic['src']
+ target_key = (dic['type'], dic['name'], dic['type'] != 'code' and dic['res_id'] or 0)
+ target = pot_targets.get(src)
+ if not target or target_key not in target.targets:
+ _logger.info("Translation '%s' (%s, %s, %s) not found in reference pot, skipping",
+ src[:60], dic['type'], dic['name'], dic['res_id'])
+ return
- target.value = dic['value']
- target.targets.discard(target_key)
+ target.value = dic['value']
+ target.targets.discard(target_key)
# This would skip terms that fail to specify a res_id
res_id = dic['res_id']
@@ -1138,15 +1141,16 @@ def trans_load_data(cr, fileobj, fileformat, lang, lang_name=None, verbose=True,
for row in reader:
process_row(row)
- # Then process the entries implied by the POT file (which is more
- # correct w.r.t. the targets) if some of them remain.
- pot_rows = []
- for src, target in pot_targets.items():
- if target.value:
- for type, name, res_id in target.targets:
- pot_rows.append((type, name, res_id, src, target.value, target.comments))
- for row in pot_rows:
- process_row(row)
+ if use_pot_reference:
+ # Then process the entries implied by the POT file (which is more
+ # correct w.r.t. the targets) if some of them remain.
+ pot_rows = []
+ for src, target in pot_targets.items():
+ if target.value:
+ for type, name, res_id in target.targets:
+ pot_rows.append((type, name, res_id, src, target.value, target.comments))
+ for row in pot_rows:
+ process_row(row)
irt_cursor.finish()
Translation.clear_caches()