From 0c478ae82b802c58523fe6a75a2a0ba95162f1b4 Mon Sep 17 00:00:00 2001 From: Raimon Esteve Date: Wed, 29 Jun 2016 09:41:50 +0200 Subject: [PATCH] Upgrade last changes in previous branches --- locale/ca_ES.po | 35 +++++++++++++++++++++++++++++++++++ locale/es_ES.po | 35 +++++++++++++++++++++++++++++++++++ production.py | 16 +++++++++++----- tryton.cfg | 4 +++- 4 files changed, 84 insertions(+), 6 deletions(-) create mode 100644 locale/ca_ES.po create mode 100644 locale/es_ES.po diff --git a/locale/ca_ES.po b/locale/ca_ES.po new file mode 100644 index 0000000..74ca64b --- /dev/null +++ b/locale/ca_ES.po @@ -0,0 +1,35 @@ +# +msgid "" +msgstr "Content-Type: text/plain; charset=utf-8\n" + +msgctxt "field:party.party,production_warehouse:" +msgid "Production Warehouse" +msgstr "Magatzem producció" + +msgctxt "field:production,destination_warehouse:" +msgid "Destination Warehouse" +msgstr "Magatzem destinació" + +msgctxt "field:production,incoming_shipment:" +msgid "Incoming Shipment" +msgstr "Albarans d'entrada" + +msgctxt "field:production,purchase_request:" +msgid "Purchase Request" +msgstr "Sol·licitud de compra" + +msgctxt "field:production,subcontract_product:" +msgid "Subcontract Product" +msgstr "Producte subcontractat" + +msgctxt "field:production,supplier:" +msgid "Supplier" +msgstr "Proveïdor" + +msgctxt "field:production.bom,subcontract_product:" +msgid "Subcontract Product" +msgstr "Producte subcontractat" + +msgctxt "view:production:" +msgid "Create Purchase Request" +msgstr "Crea sol·licitud de compra" diff --git a/locale/es_ES.po b/locale/es_ES.po new file mode 100644 index 0000000..f377974 --- /dev/null +++ b/locale/es_ES.po @@ -0,0 +1,35 @@ +# +msgid "" +msgstr "Content-Type: text/plain; charset=utf-8\n" + +msgctxt "field:party.party,production_warehouse:" +msgid "Production Warehouse" +msgstr "Almacén producción" + +msgctxt "field:production,destination_warehouse:" +msgid "Destination Warehouse" +msgstr "Almacén destinación" + +msgctxt "field:production,incoming_shipment:" +msgid "Incoming Shipment" +msgstr "Albaranes de entrada" + +msgctxt "field:production,purchase_request:" +msgid "Purchase Request" +msgstr "Solicitud de compra" + +msgctxt "field:production,subcontract_product:" +msgid "Subcontract Product" +msgstr "Producto subcontractado" + +msgctxt "field:production,supplier:" +msgid "Supplier" +msgstr "Proveedor" + +msgctxt "field:production.bom,subcontract_product:" +msgid "Subcontract Product" +msgstr "Producto subcontractado" + +msgctxt "view:production:" +msgid "Create Purchase Request" +msgstr "Crear solicitud de compra" diff --git a/production.py b/production.py index e285984..22e645a 100644 --- a/production.py +++ b/production.py @@ -16,6 +16,7 @@ class Party: ('type', '=', 'warehouse'), ])) + class PurchaseRequest: __name__ = 'purchase.request' __metaclass__ = PoolMeta @@ -145,12 +146,10 @@ class Production: subcontract_warehouse = production._get_subcontract_warehouse() production.destination_warehouse = production.warehouse production.warehouse = subcontract_warehouse - production.location = subcontract_warehouse.production_location from_location = production.warehouse.storage_location to_location = production.destination_warehouse.storage_location shipment = ShipmentInternal() - shipment.planned_date = production.planned_date shipment.from_location = from_location shipment.to_location = to_location shipment.moves = [] @@ -163,7 +162,7 @@ class Production: production.incoming_shipment = shipment storage_location = production.warehouse.storage_location - production_location = production.location + production_location = production.warehouse.production_location for move in production.inputs: move.from_location = storage_location move.to_location = production_location @@ -188,6 +187,13 @@ class Production: def _get_subcontract_warehouse(self): return self.purchase_request.party.production_warehouse + @classmethod + def compute_request(cls, product, warehouse, quantity, date, company): + req = super(Production, cls).compute_request(product, warehouse, quantity, date, company) + if req.bom: + req.subcontract_product = req.bom.subcontract_product + return req + @classmethod def write(cls, *args): actions = iter(args) @@ -196,8 +202,8 @@ class Production: if 'outputs' in values: to_update.extend(productions) super(Production, cls).write(*args) - #if to_update: - #Production._sync_outputs_to_shipment(to_update) + if to_update: + Production._sync_outputs_to_shipment(to_update) # TODO: Missing function to synchronize output production moves with # incoming internal shipment. Should emulate behaviour of ShipmentOut and diff --git a/tryton.cfg b/tryton.cfg index ffe0d74..3104336 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -1,7 +1,9 @@ [tryton] -version=3.4.0 +version=4.1.0 depends: production stock_supply +extras_depend: + stock_supply_production xml: production.xml