[FIX] stock: correctly translate route name

Translating a variable does not work, the call must be translated

Reexport the source terms to reflect the changes

closes odoo/odoo#28099
This commit is contained in:
Martin Trigaux
2018-10-24 09:38:45 +00:00
parent 585846d20a
commit d0213a6fec
9 changed files with 57 additions and 26 deletions
+13 -3
View File
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-10-08 06:48+0000\n"
"PO-Revision-Date: 2018-10-08 06:48+0000\n"
"POT-Creation-Date: 2018-10-24 09:34+0000\n"
"PO-Revision-Date: 2018-10-24 09:34+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -1663,6 +1663,13 @@ msgstr ""
msgid "Main Attachment"
msgstr ""
#. module: mrp
#: code:addons/mrp/models/mrp_production.py:465
#: code:addons/mrp/models/stock_warehouse.py:130
#, python-format
msgid "Make To Order"
msgstr ""
#. module: mrp
#: model:res.groups,name:mrp.group_mrp_routings
msgid "Manage Work Order Operations"
@@ -1679,10 +1686,13 @@ msgid "Manual Duration"
msgstr ""
#. module: mrp
#: code:addons/mrp/models/stock_warehouse.py:114
#: code:addons/mrp/models/stock_warehouse.py:154
#: model:ir.model.fields,field_description:mrp.field_stock_warehouse__manufacture_steps
#: model_terms:ir.ui.view,arch_db:mrp.mrp_report_stock_rule
#: model:stock.location.route,name:mrp.route_warehouse0_manufacture
#: selection:stock.rule,action:0
#, python-format
msgid "Manufacture"
msgstr ""
@@ -2498,7 +2508,6 @@ msgid "Product to Track"
msgstr ""
#. module: mrp
#: model:ir.model,name:mrp.model_mrp_production
#: model:ir.model.fields,field_description:mrp.field_mrp_product_produce__production_id
#: model_terms:ir.ui.view,arch_db:mrp.view_mrp_production_filter
#: model_terms:ir.ui.view,arch_db:mrp.view_mrp_production_workorder_form_view_filter
@@ -2524,6 +2533,7 @@ msgstr ""
#. module: mrp
#: model:ir.actions.report,name:mrp.action_report_production_order
#: model:ir.model,name:mrp.model_mrp_production
#: model:ir.model.fields,field_description:mrp.field_stock_move_line__production_id
#: model_terms:ir.ui.view,arch_db:mrp.stock_production_type_kanban
msgid "Production Order"
+1 -1
View File
@@ -462,7 +462,7 @@ class MrpProduction(models.Model):
@api.multi
def _adjust_procure_method(self):
try:
mto_route = self.env['stock.warehouse']._find_global_route('stock.route_warehouse0_mto', 'Make To Order')
mto_route = self.env['stock.warehouse']._find_global_route('stock.route_warehouse0_mto', _('Make To Order'))
except:
mto_route = False
for move in self.move_raw_ids:
+3 -3
View File
@@ -111,7 +111,7 @@ class StockWarehouse(models.Model):
'action': 'manufacture',
'procure_method': 'make_to_order',
'picking_type_id': self.manu_type_id.id,
'route_id': self._find_global_route('mrp.route_warehouse0_manufacture', 'Manufacture').id
'route_id': self._find_global_route('mrp.route_warehouse0_manufacture', _('Manufacture')).id
},
'update_values': {
'active': self.manufacture_to_resupply,
@@ -127,7 +127,7 @@ class StockWarehouse(models.Model):
'action': 'pull',
'auto': 'manual',
'propagate': True,
'route_id': self._find_global_route('stock.route_warehouse0_mto', 'Make To Order').id,
'route_id': self._find_global_route('stock.route_warehouse0_mto', _('Make To Order')).id,
'name': self._format_rulename(self.lot_stock_id, self.pbm_loc_id, 'MTO'),
'location_id': self.pbm_loc_id.id,
'location_src_id': self.lot_stock_id.id,
@@ -151,7 +151,7 @@ class StockWarehouse(models.Model):
'action': 'pull',
'auto': 'manual',
'propagate': True,
'route_id': self._find_global_route('mrp.route_warehouse0_manufacture', 'Manufacture').id,
'route_id': self._find_global_route('mrp.route_warehouse0_manufacture', _('Manufacture')).id,
'name': self._format_rulename(self.sam_loc_id, self.lot_stock_id, False),
'location_id': self.lot_stock_id.id,
'location_src_id': self.sam_loc_id.id,
@@ -4,10 +4,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server saas~11.5\n"
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-09-21 13:17+0000\n"
"PO-Revision-Date: 2018-09-21 13:17+0000\n"
"POT-Creation-Date: 2018-10-24 09:34+0000\n"
"PO-Revision-Date: 2018-10-24 09:34+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -26,9 +26,11 @@ msgid "Action"
msgstr ""
#. module: purchase_stock
#: code:addons/purchase_stock/models/stock.py:127
#: model_terms:ir.ui.view,arch_db:purchase_stock.purchase_report_stock_rule
#: model:stock.location.route,name:purchase_stock.route_warehouse0_buy
#: selection:stock.rule,action:0
#, python-format
msgid "Buy"
msgstr ""
+1 -1
View File
@@ -124,7 +124,7 @@ class StockWarehouse(models.Model):
'create_values': {
'action': 'buy',
'picking_type_id': self.in_type_id.id,
'route_id': self._find_global_route('purchase_stock.route_warehouse0_buy', 'Buy').id
'route_id': self._find_global_route('purchase_stock.route_warehouse0_buy', _('Buy')).id
},
'update_values': {
'active': self.buy_to_resupply,
+9 -3
View File
@@ -4,10 +4,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server saas~11.5\n"
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-10-02 10:06+0000\n"
"PO-Revision-Date: 2018-10-02 10:06+0000\n"
"POT-Creation-Date: 2018-10-24 09:34+0000\n"
"PO-Revision-Date: 2018-10-24 09:34+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -235,6 +235,12 @@ msgstr ""
msgid "Lot/Serial"
msgstr ""
#. module: sale_stock
#: code:addons/sale_stock/models/sale_order.py:418
#, python-format
msgid "Make To Order"
msgstr ""
#. module: sale_stock
#: selection:sale.order.line,qty_delivered_method:0
msgid "Manual"
+1 -1
View File
@@ -415,7 +415,7 @@ class SaleOrderLine(models.Model):
else:
mto_route = False
try:
mto_route = self.env['stock.warehouse']._find_global_route('stock.route_warehouse0_mto', 'Make To Order')
mto_route = self.env['stock.warehouse']._find_global_route('stock.route_warehouse0_mto', _('Make To Order'))
except UserError:
# if route MTO not found in ir_model_data, we treat the product as in MTS
pass
+21 -8
View File
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-10-08 06:48+0000\n"
"PO-Revision-Date: 2018-10-08 06:48+0000\n"
"POT-Creation-Date: 2018-10-24 09:34+0000\n"
"PO-Revision-Date: 2018-10-24 09:34+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -372,6 +372,11 @@ msgstr ""
msgid "Add a new route"
msgstr ""
#. module: stock
#: model_terms:ir.ui.view,arch_db:stock.view_picking_form
msgid "Add an internal note that will be printed on the Picking Operations sheet"
msgstr ""
#. module: stock
#: model:ir.model.fields,help:stock.field_res_config_settings__group_stock_adv_location
msgid "Add and customize route operations to process product moves in your warehouse(s): e.g. unload > quality control > stock for incoming products, pick > pack > ship for outgoing products. \n"
@@ -1245,7 +1250,7 @@ msgstr ""
#. module: stock
#: model:ir.model.fields,field_description:stock.field_res_config_settings__module_delivery_dhl
msgid "DHL Connector"
msgid "DHL USA"
msgstr ""
#. module: stock
@@ -1671,7 +1676,7 @@ msgstr ""
#. module: stock
#: model:ir.model.fields,field_description:stock.field_res_config_settings__module_delivery_easypost
msgid "Easypost Connector"
msgid "Easypost"
msgstr ""
#. module: stock
@@ -1737,7 +1742,7 @@ msgstr ""
#. module: stock
#: model:ir.model.fields,field_description:stock.field_res_config_settings__module_delivery_fedex
msgid "FedEx Connector"
msgid "FedEx"
msgstr ""
#. module: stock
@@ -2831,7 +2836,10 @@ msgid "Main Attachment"
msgstr ""
#. module: stock
#: code:addons/stock/models/stock_warehouse.py:288
#: code:addons/stock/models/stock_warehouse.py:629
#: model:stock.location.route,name:stock.route_warehouse0_mto
#, python-format
msgid "Make To Order"
msgstr ""
@@ -3197,6 +3205,11 @@ msgstr ""
msgid "Not urgent"
msgstr ""
#. module: stock
#: model_terms:ir.ui.view,arch_db:stock.view_picking_form
msgid "Note"
msgstr ""
#. module: stock
#: model:ir.model.fields,field_description:stock.field_stock_move__note
#: model:ir.model.fields,field_description:stock.field_stock_picking__note
@@ -5717,12 +5730,12 @@ msgstr ""
#. module: stock
#: model:ir.model.fields,field_description:stock.field_res_config_settings__module_delivery_ups
msgid "UPS Connector"
msgid "UPS"
msgstr ""
#. module: stock
#: model:ir.model.fields,field_description:stock.field_res_config_settings__module_delivery_usps
msgid "USPS Connector"
msgid "USPS"
msgstr ""
#. module: stock
@@ -6444,7 +6457,7 @@ msgstr ""
#. module: stock
#: model:ir.model.fields,field_description:stock.field_res_config_settings__module_delivery_bpost
msgid "bpost Connector"
msgid "bpost"
msgstr ""
#. module: stock
+3 -3
View File
@@ -251,7 +251,7 @@ class Warehouse(models.Model):
""" return a route record set from an xml_id or its name. """
route = self.env.ref(xml_id, raise_if_not_found=False)
if not route:
route = self.env['stock.location.route'].search([('name', 'like', _(route_name))], limit=1)
route = self.env['stock.location.route'].search([('name', 'like', route_name)], limit=1)
if not route:
raise UserError(_('Can\'t find any generic route %s.') % (route_name))
return route
@@ -285,7 +285,7 @@ class Warehouse(models.Model):
'action': 'pull',
'auto': 'manual',
'propagate': True,
'route_id': self._find_global_route('stock.route_warehouse0_mto', 'Make To Order').id
'route_id': self._find_global_route('stock.route_warehouse0_mto', _('Make To Order')).id
},
'update_values': {
'name': self._format_rulename(location_id, location_dest_id, 'MTO'),
@@ -626,7 +626,7 @@ class Warehouse(models.Model):
else:
# We need to delete all the MTO stock rules, otherwise they risk to be used in the system
Rule.search([
'&', ('route_id', '=', self._find_global_route('stock.route_warehouse0_mto', 'Make To Order').id),
'&', ('route_id', '=', self._find_global_route('stock.route_warehouse0_mto', _('Make To Order')).id),
('location_id.usage', '=', 'transit'),
('action', '!=', 'push'),
('location_src_id', '=', self.lot_stock_id.id)]).write({'active': False})