mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[FIX] stock_request: Change state fields to display translated by language
TT41343
This commit is contained in:
@@ -9,8 +9,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 11.0\n"
|
"Project-Id-Version: Odoo Server 11.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2023-01-25 17:42+0000\n"
|
"POT-Creation-Date: 2023-01-26 16:12+0000\n"
|
||||||
"PO-Revision-Date: 2023-01-25 18:42+0100\n"
|
"PO-Revision-Date: 2023-01-26 17:12+0100\n"
|
||||||
"Last-Translator: Víctor Martínez <victor.martinez@tecnativa.com>\n"
|
"Last-Translator: Víctor Martínez <victor.martinez@tecnativa.com>\n"
|
||||||
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
|
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
|
||||||
"Language: es\n"
|
"Language: es\n"
|
||||||
@@ -125,6 +125,7 @@ msgid "Cancel"
|
|||||||
msgstr "Cancelar"
|
msgstr "Cancelar"
|
||||||
|
|
||||||
#. module: stock_request
|
#. module: stock_request
|
||||||
|
#: model:ir.model.fields.selection,name:stock_request.selection__stock_request__state__cancel
|
||||||
#: model_terms:ir.ui.view,arch_db:stock_request.stock_request_order_search
|
#: model_terms:ir.ui.view,arch_db:stock_request.stock_request_order_search
|
||||||
#: model_terms:ir.ui.view,arch_db:stock_request.stock_request_search
|
#: model_terms:ir.ui.view,arch_db:stock_request.stock_request_search
|
||||||
msgid "Cancelled"
|
msgid "Cancelled"
|
||||||
@@ -229,11 +230,13 @@ msgid "Display Name"
|
|||||||
msgstr "Nombre mostrado"
|
msgstr "Nombre mostrado"
|
||||||
|
|
||||||
#. module: stock_request
|
#. module: stock_request
|
||||||
|
#: model:ir.model.fields.selection,name:stock_request.selection__stock_request__state__done
|
||||||
#: model_terms:ir.ui.view,arch_db:stock_request.view_stock_request_form
|
#: model_terms:ir.ui.view,arch_db:stock_request.view_stock_request_form
|
||||||
msgid "Done"
|
msgid "Done"
|
||||||
msgstr "Hecho"
|
msgstr "Hecho"
|
||||||
|
|
||||||
#. module: stock_request
|
#. module: stock_request
|
||||||
|
#: model:ir.model.fields.selection,name:stock_request.selection__stock_request__state__draft
|
||||||
#: model_terms:ir.ui.view,arch_db:stock_request.stock_request_order_search
|
#: model_terms:ir.ui.view,arch_db:stock_request.stock_request_order_search
|
||||||
#: model_terms:ir.ui.view,arch_db:stock_request.stock_request_search
|
#: model_terms:ir.ui.view,arch_db:stock_request.stock_request_search
|
||||||
msgid "Draft"
|
msgid "Draft"
|
||||||
@@ -384,6 +387,11 @@ msgstr "Si está marcado, algunos mensajes tienen un error de entrega."
|
|||||||
msgid "In Progress"
|
msgid "In Progress"
|
||||||
msgstr "En progreso"
|
msgstr "En progreso"
|
||||||
|
|
||||||
|
#. module: stock_request
|
||||||
|
#: model:ir.model.fields.selection,name:stock_request.selection__stock_request__state__open
|
||||||
|
msgid "In progress"
|
||||||
|
msgstr "En progreso"
|
||||||
|
|
||||||
#. module: stock_request
|
#. module: stock_request
|
||||||
#: model:ir.model,name:stock_request.model_stock_location
|
#: model:ir.model,name:stock_request.model_stock_location
|
||||||
msgid "Inventory Locations"
|
msgid "Inventory Locations"
|
||||||
@@ -518,7 +526,6 @@ msgstr "Nombre"
|
|||||||
|
|
||||||
#. module: stock_request
|
#. module: stock_request
|
||||||
#: model:ir.model.constraint,message:stock_request.constraint_stock_request_abstract_name_uniq
|
#: model:ir.model.constraint,message:stock_request.constraint_stock_request_abstract_name_uniq
|
||||||
#: model:ir.model.constraint,message:stock_request.constraint_stock_request_kanban_name_uniq
|
|
||||||
msgid "Name must be unique"
|
msgid "Name must be unique"
|
||||||
msgstr "El nombre debe ser único"
|
msgstr "El nombre debe ser único"
|
||||||
|
|
||||||
@@ -1202,6 +1209,3 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Debe seleccionada una unidad de medida de producto de la misma categoría que "
|
"Debe seleccionada una unidad de medida de producto de la misma categoría que "
|
||||||
"la unidad de medida por defecto del producto"
|
"la unidad de medida por defecto del producto"
|
||||||
|
|
||||||
#~ msgid "Stock request Orders"
|
|
||||||
#~ msgstr "Pedidos de existencias"
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 14.0\n"
|
"Project-Id-Version: Odoo Server 14.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2023-01-26 16:12+0000\n"
|
||||||
|
"PO-Revision-Date: 2023-01-26 16:12+0000\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
@@ -114,6 +116,7 @@ msgid "Cancel"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: stock_request
|
#. module: stock_request
|
||||||
|
#: model:ir.model.fields.selection,name:stock_request.selection__stock_request__state__cancel
|
||||||
#: model_terms:ir.ui.view,arch_db:stock_request.stock_request_order_search
|
#: model_terms:ir.ui.view,arch_db:stock_request.stock_request_order_search
|
||||||
#: model_terms:ir.ui.view,arch_db:stock_request.stock_request_search
|
#: model_terms:ir.ui.view,arch_db:stock_request.stock_request_search
|
||||||
msgid "Cancelled"
|
msgid "Cancelled"
|
||||||
@@ -218,11 +221,13 @@ msgid "Display Name"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: stock_request
|
#. module: stock_request
|
||||||
|
#: model:ir.model.fields.selection,name:stock_request.selection__stock_request__state__done
|
||||||
#: model_terms:ir.ui.view,arch_db:stock_request.view_stock_request_form
|
#: model_terms:ir.ui.view,arch_db:stock_request.view_stock_request_form
|
||||||
msgid "Done"
|
msgid "Done"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: stock_request
|
#. module: stock_request
|
||||||
|
#: model:ir.model.fields.selection,name:stock_request.selection__stock_request__state__draft
|
||||||
#: model_terms:ir.ui.view,arch_db:stock_request.stock_request_order_search
|
#: model_terms:ir.ui.view,arch_db:stock_request.stock_request_order_search
|
||||||
#: model_terms:ir.ui.view,arch_db:stock_request.stock_request_search
|
#: model_terms:ir.ui.view,arch_db:stock_request.stock_request_search
|
||||||
msgid "Draft"
|
msgid "Draft"
|
||||||
@@ -373,6 +378,11 @@ msgstr ""
|
|||||||
msgid "In Progress"
|
msgid "In Progress"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: stock_request
|
||||||
|
#: model:ir.model.fields.selection,name:stock_request.selection__stock_request__state__open
|
||||||
|
msgid "In progress"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: stock_request
|
#. module: stock_request
|
||||||
#: model:ir.model,name:stock_request.model_stock_location
|
#: model:ir.model,name:stock_request.model_stock_location
|
||||||
msgid "Inventory Locations"
|
msgid "Inventory Locations"
|
||||||
@@ -504,7 +514,6 @@ msgstr ""
|
|||||||
|
|
||||||
#. module: stock_request
|
#. module: stock_request
|
||||||
#: model:ir.model.constraint,message:stock_request.constraint_stock_request_abstract_name_uniq
|
#: model:ir.model.constraint,message:stock_request.constraint_stock_request_abstract_name_uniq
|
||||||
#: model:ir.model.constraint,message:stock_request.constraint_stock_request_kanban_name_uniq
|
|
||||||
msgid "Name must be unique"
|
msgid "Name must be unique"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|||||||
@@ -5,13 +5,6 @@ from odoo import _, api, fields, models
|
|||||||
from odoo.exceptions import UserError, ValidationError
|
from odoo.exceptions import UserError, ValidationError
|
||||||
from odoo.tools import float_compare
|
from odoo.tools import float_compare
|
||||||
|
|
||||||
REQUEST_STATES = [
|
|
||||||
("draft", "Draft"),
|
|
||||||
("open", "In progress"),
|
|
||||||
("done", "Done"),
|
|
||||||
("cancel", "Cancelled"),
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
class StockRequest(models.Model):
|
class StockRequest(models.Model):
|
||||||
_name = "stock.request"
|
_name = "stock.request"
|
||||||
@@ -19,12 +12,6 @@ class StockRequest(models.Model):
|
|||||||
_inherit = "stock.request.abstract"
|
_inherit = "stock.request.abstract"
|
||||||
_order = "id desc"
|
_order = "id desc"
|
||||||
|
|
||||||
def __get_request_states(self):
|
|
||||||
return REQUEST_STATES
|
|
||||||
|
|
||||||
def _get_request_states(self):
|
|
||||||
return self.__get_request_states()
|
|
||||||
|
|
||||||
def _get_default_requested_by(self):
|
def _get_default_requested_by(self):
|
||||||
return self.env["res.users"].browse(self.env.uid)
|
return self.env["res.users"].browse(self.env.uid)
|
||||||
|
|
||||||
@@ -34,7 +21,12 @@ class StockRequest(models.Model):
|
|||||||
|
|
||||||
name = fields.Char(states={"draft": [("readonly", False)]})
|
name = fields.Char(states={"draft": [("readonly", False)]})
|
||||||
state = fields.Selection(
|
state = fields.Selection(
|
||||||
selection=_get_request_states,
|
selection=[
|
||||||
|
("draft", "Draft"),
|
||||||
|
("open", "In progress"),
|
||||||
|
("done", "Done"),
|
||||||
|
("cancel", "Cancelled"),
|
||||||
|
],
|
||||||
string="Status",
|
string="Status",
|
||||||
copy=False,
|
copy=False,
|
||||||
default="draft",
|
default="draft",
|
||||||
|
|||||||
@@ -25,7 +25,9 @@ class StockRequestOrder(models.Model):
|
|||||||
return res
|
return res
|
||||||
|
|
||||||
def __get_request_order_states(self):
|
def __get_request_order_states(self):
|
||||||
return self.env["stock.request"]._get_request_states()
|
return self.env["stock.request"].fields_get(allfields=["state"])["state"][
|
||||||
|
"selection"
|
||||||
|
]
|
||||||
|
|
||||||
def _get_request_order_states(self):
|
def _get_request_order_states(self):
|
||||||
return self.__get_request_order_states()
|
return self.__get_request_order_states()
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 12.0\n"
|
"Project-Id-Version: Odoo Server 12.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2022-10-21 09:12+0000\n"
|
"POT-Creation-Date: 2023-01-26 16:20+0000\n"
|
||||||
"PO-Revision-Date: 2023-01-24 12:44+0000\n"
|
"PO-Revision-Date: 2023-01-26 17:20+0100\n"
|
||||||
"Last-Translator: Víctor Martínez <victor.martinez@tecnativa.com>\n"
|
"Last-Translator: Víctor Martínez <victor.martinez@tecnativa.com>\n"
|
||||||
"Language-Team: none\n"
|
"Language-Team: none\n"
|
||||||
"Language: es\n"
|
"Language: es\n"
|
||||||
@@ -15,7 +15,7 @@ msgstr ""
|
|||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||||
"X-Generator: Weblate 4.14.1\n"
|
"X-Generator: Poedit 3.0.1\n"
|
||||||
|
|
||||||
#. module: stock_request_submit
|
#. module: stock_request_submit
|
||||||
#: model:ir.model.fields,field_description:stock_request_submit.field_stock_request__display_name
|
#: model:ir.model.fields,field_description:stock_request_submit.field_stock_request__display_name
|
||||||
@@ -40,6 +40,11 @@ msgstr "Última Modificación el"
|
|||||||
msgid "Route"
|
msgid "Route"
|
||||||
msgstr "Ruta"
|
msgstr "Ruta"
|
||||||
|
|
||||||
|
#. module: stock_request_submit
|
||||||
|
#: model:ir.model.fields,field_description:stock_request_submit.field_stock_request__state
|
||||||
|
msgid "Status"
|
||||||
|
msgstr "Estado"
|
||||||
|
|
||||||
#. module: stock_request_submit
|
#. module: stock_request_submit
|
||||||
#: model:ir.model,name:stock_request_submit.model_stock_request
|
#: model:ir.model,name:stock_request_submit.model_stock_request
|
||||||
msgid "Stock Request"
|
msgid "Stock Request"
|
||||||
@@ -56,6 +61,11 @@ msgstr "Pedido de existencias"
|
|||||||
msgid "Submit"
|
msgid "Submit"
|
||||||
msgstr "Enviar"
|
msgstr "Enviar"
|
||||||
|
|
||||||
|
#. module: stock_request_submit
|
||||||
|
#: model:ir.model.fields.selection,name:stock_request_submit.selection__stock_request__state__submitted
|
||||||
|
msgid "Submitted"
|
||||||
|
msgstr "Enviado"
|
||||||
|
|
||||||
#. module: stock_request_submit
|
#. module: stock_request_submit
|
||||||
#: code:addons/stock_request_submit/models/stock_request_order.py:0
|
#: code:addons/stock_request_submit/models/stock_request_order.py:0
|
||||||
#, python-format
|
#, python-format
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 14.0\n"
|
"Project-Id-Version: Odoo Server 14.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2023-01-26 16:20+0000\n"
|
||||||
|
"PO-Revision-Date: 2023-01-26 16:20+0000\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
@@ -36,6 +38,11 @@ msgstr ""
|
|||||||
msgid "Route"
|
msgid "Route"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: stock_request_submit
|
||||||
|
#: model:ir.model.fields,field_description:stock_request_submit.field_stock_request__state
|
||||||
|
msgid "Status"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: stock_request_submit
|
#. module: stock_request_submit
|
||||||
#: model:ir.model,name:stock_request_submit.model_stock_request
|
#: model:ir.model,name:stock_request_submit.model_stock_request
|
||||||
msgid "Stock Request"
|
msgid "Stock Request"
|
||||||
@@ -52,6 +59,11 @@ msgstr ""
|
|||||||
msgid "Submit"
|
msgid "Submit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: stock_request_submit
|
||||||
|
#: model:ir.model.fields.selection,name:stock_request_submit.selection__stock_request__state__submitted
|
||||||
|
msgid "Submitted"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: stock_request_submit
|
#. module: stock_request_submit
|
||||||
#: code:addons/stock_request_submit/models/stock_request_order.py:0
|
#: code:addons/stock_request_submit/models/stock_request_order.py:0
|
||||||
#, python-format
|
#, python-format
|
||||||
|
|||||||
@@ -8,13 +8,7 @@ from odoo import fields, models
|
|||||||
class StockRequest(models.Model):
|
class StockRequest(models.Model):
|
||||||
_inherit = "stock.request"
|
_inherit = "stock.request"
|
||||||
|
|
||||||
def __get_request_states(self):
|
state = fields.Selection(selection_add=[("submitted", "Submitted"), ("open",)])
|
||||||
states = super().__get_request_states()
|
|
||||||
if not ("submitted", "Submitted") in states:
|
|
||||||
states.insert(
|
|
||||||
states.index(("draft", "Draft")) + 1, ("submitted", "Submitted")
|
|
||||||
)
|
|
||||||
return states
|
|
||||||
|
|
||||||
route_id = fields.Many2one(
|
route_id = fields.Many2one(
|
||||||
states={"draft": [("readonly", False)], "submitted": [("readonly", False)]}
|
states={"draft": [("readonly", False)], "submitted": [("readonly", False)]}
|
||||||
|
|||||||
Reference in New Issue
Block a user