Upgrade last changes in previous branches

This commit is contained in:
Raimon Esteve 2016-06-29 09:41:50 +02:00
parent 3b3715fdd5
commit 0c478ae82b
4 changed files with 84 additions and 6 deletions

35
locale/ca_ES.po Normal file
View File

@ -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"

35
locale/es_ES.po Normal file
View File

@ -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"

View File

@ -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

View File

@ -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