From 44b0cd7cd1ab7fefe2bce63ab2e9d461f28c3523 Mon Sep 17 00:00:00 2001 From: jmartin Date: Tue, 27 May 2014 14:29:09 +0200 Subject: [PATCH] Add method to wizard to get manifest --- __init__.py | 6 +++++- manifest.py | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 manifest.py diff --git a/__init__.py b/__init__.py index bd3a1f8..3f489b7 100644 --- a/__init__.py +++ b/__init__.py @@ -1,9 +1,10 @@ -# This file is part of the carrier_send_shipments_seurvalencia module for Tryton. +# This file is part of carrier_send_shipments_seurvalencia module for Tryton. # The COPYRIGHT file at the top level of this repository contains # copyright notices and license terms. the full from trytond.pool import Pool from .api import * from .shipment import * +from .manifest import * def register(): @@ -11,3 +12,6 @@ def register(): CarrierApi, ShipmentOut, module='carrier_send_shipments_seurvalencia', type_='model') + Pool.register( + StockManifest, + module='carrier_send_shipments_seurvalencia', type_='wizard') diff --git a/manifest.py b/manifest.py new file mode 100644 index 0000000..867dda2 --- /dev/null +++ b/manifest.py @@ -0,0 +1,16 @@ +# This file is part of carrier_send_shipments_seurvalencia module for Tryton. +# The COPYRIGHT file at the top level of this repository contains +# the full copyright notices and license terms. +from seurvalencia import Picking +from trytond.pool import PoolMeta + +__all__ = ['StockManifest'] +__metaclass__ = PoolMeta + + +class StockManifest: + __name__ = 'stock.manifest' + + def get_manifest_seurvalencia(self, api, from_date, to_date): + with Picking(api.username, api.password, api.debug) as picking_api: + return picking_api.info()