Migrate to 6.0

This commit is contained in:
Sergio Morillo 2021-09-25 16:26:15 +02:00
parent ebe45e5f2a
commit ef90e58815
4 changed files with 23 additions and 17 deletions

View file

@ -2,10 +2,10 @@
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "error:stock.shipment.internal:"
msgctxt "model:ir.message,text:msg_stock_shipment_internal_party_warehouse"
msgid ""
"\"From Location\" or \"To Location\" in Internal Shipment \"%s\" must be a location on Party Warehouse \"%s\"."
msgstr "\"Desde ubicación\" o \"A ubicación\" del albarán interno \"%s\" debe ser una ubicación del almacén de tercero \"%s\"."
"\"From Location\" or \"To Location\" in Internal Shipment \"%(a)s\" must be a location on Party Warehouse \"%(b)s\"."
msgstr "\"Desde ubicación\" o \"A ubicación\" del albarán interno \"%(a)s\" debe ser una ubicación del almacén de tercero \"%(b)s\"."
msgctxt "field:party.party,warehouse:"
msgid "Party Warehouse"

11
message.xml Normal file
View file

@ -0,0 +1,11 @@
<?xml version="1.0"?>
<!-- The COPYRIGHT file at the top level of this repository contains the full
copyright notices and license terms. -->
<tryton>
<data grouped="1">
<!-- stock.shipment.internal -->
<record model="ir.message" id="msg_shipment_internal_party_warehouse">
<field name="text">"From Location" or "To Location" in Internal Shipment "%(shipment)s" must be a location on Party Warehouse "%(warehouse)s".</field>
</record>
</data>
</tryton>

View file

@ -3,6 +3,8 @@
from trytond.pool import PoolMeta
from trytond.model import fields
from trytond.pyson import Eval, Not
from trytond.exceptions import UserError
from trytond.i18n import gettext
class ShipmentInternal(metaclass=PoolMeta):
@ -20,15 +22,6 @@ class ShipmentInternal(metaclass=PoolMeta):
},
depends=['state', 'moves', 'from_location', 'to_location'])
@classmethod
def __setup__(cls):
super().__setup__()
cls._error_messages.update({
'party_warehouse':
'"From Location" or "To Location" in Internal Shipment "%s" '
'must be a location on Party Warehouse "%s".'
})
@fields.depends('party', 'from_location', 'to_location')
def on_change_from_location(self):
if (self.party
@ -52,7 +45,8 @@ class ShipmentInternal(metaclass=PoolMeta):
wh = shipment.party.warehouse
if (wh != shipment.from_location.warehouse
and wh != shipment.to_location.warehouse):
cls.raise_user_error('party_warehouse', (
shipment.rec_name,
wh.rec_name))
raise UserError(gettext('stock_party_warehouse.'
'msg_shipment_internal_party_warehouse',
shipment=shipment.rec_name,
warehouse=wh.rec_name))
super().wait(shipments)

View file

@ -1,5 +1,5 @@
[tryton]
version=5.0.0
version=6.0.0
depends:
ir
res
@ -8,4 +8,5 @@ depends:
xml:
configuration.xml
party.xml
shipment.xml
shipment.xml
message.xml