Merge lp:~camptocamp/carriers-deliveries/7.0-add-delivery_carrier_label_postlogistics-yvr into lp:~stock-logistic-core-editors/carriers-deliveries/7.0

Proposed by Yannick Vaucher @ Camptocamp
Status: Merged
Merged at revision: 9
Proposed branch: lp:~camptocamp/carriers-deliveries/7.0-add-delivery_carrier_label_postlogistics-yvr
Merge into: lp:~stock-logistic-core-editors/carriers-deliveries/7.0
Prerequisite: lp:~camptocamp/carriers-deliveries/7.0-add-base_delivery_carrier_label-yvr
Diff against target: 4267 lines
To merge this branch: bzr merge lp:~camptocamp/carriers-deliveries/7.0-add-delivery_carrier_label_postlogistics-yvr
Reviewer Review Type Date Requested Status
Joël Grand-Guillaume @ camptocamp code review, no tests Approve
Guewen Baconnier @ Camptocamp code review Approve
Review via email: mp+196839@code.launchpad.net

This proposal supersedes a proposal from 2013-11-26.

Description of the change

This module implements Swiss PostLogics "Barcode" webservice to generate shipping labels.
http://www.poste.ch/post-barcode-cug.htm

* it connects to WebService using suds SOAP client
* it permits to retrieve all services provided by Postlogistics with translations in available languages with an update button in settings
* options are filtered in carrier in order to improve user experience

Depends on following MP:

https://code.launchpad.net/~camptocamp/carriers-deliveries/7.0-add-base_delivery_carrier_label-yvr/+merge/196753

To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote : Posted in a previous version of this proposal

On the name of the module: rename delivery_carrier_label_laposte to delivery_carrier_label_postlogistics: "laposte" has been used for "La Poste" (from France) for the delivery files.

Suds does not have an exception class for the authentication errors? I think that it should, seems to be suds.transport.TransportError

        try:
            res['value'] = request(**kwargs)
            res['success'] = True
        except WebFault, e:
            res['success'] = False
            res['errors'] = [e[0]]
        except Exception, e:

On a side note, the preferred notation now is "except Exception as e:

            # if authentification error
            if isinstance(e[0], tuple) and e[0][0] == 401:
                raise orm.except_orm(
                    _('Error 401'),
                    _('Authorization Required\n\n'
                    'Please verify postlogistics username and password in:\n'
                    'Configuration -> Postlogistics'))
            raise e

"raise e" is wrong, you will mess the traceback (it will start from the current line instead of the original one), to propagate correctly the current exception, the correct idiom is just "raise".

Regarding the comment below, the weight (and weight_net) field already exists on the picking.

        #XXX get weight or set it as an option on picking
        weight = 0

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

https://bitbucket.org/jurko/suds/src/627c4f4e2aed730aab9d0632fab9ac7383c74230/suds/client.py?at=default#cl-676

I'm receiving this kind of Exceptions from suds. I fear, it isn't fully implemented yet.

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

> https://bitbucket.org/jurko/suds/src/627c4f4e2aed730aab9d0632fab9ac7383c74230/
> suds/client.py?at=default#cl-676
>
> I'm receiving this kind of Exceptions from suds. I fear, it isn't fully
> implemented yet.

Arg. Ok, so :-)

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Thanks! LGTM

review: Approve (code review)
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

öLTM, thanks for the job !

review: Approve (code review, no tests)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Missing rights on postlogistics.service.group, fixed.

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Just did a little change to show all basic services of a service group to allow a multi selection

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

> Just did a little change to show all basic services of a service group to
> allow a multi selection
LGTM

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'delivery_carrier_label_postlogistics'
2=== added file 'delivery_carrier_label_postlogistics/__init__.py'
3--- delivery_carrier_label_postlogistics/__init__.py 1970-01-01 00:00:00 +0000
4+++ delivery_carrier_label_postlogistics/__init__.py 2014-01-13 11:23:36 +0000
5@@ -0,0 +1,25 @@
6+# -*- coding: utf-8 -*-
7+##############################################################################
8+#
9+# Author: Yannick Vaucher
10+# Copyright 2013 Camptocamp SA
11+#
12+# This program is free software: you can redistribute it and/or modify
13+# it under the terms of the GNU Affero General Public License as
14+# published by the Free Software Foundation, either version 3 of the
15+# License, or (at your option) any later version.
16+#
17+# This program is distributed in the hope that it will be useful,
18+# but WITHOUT ANY WARRANTY; without even the implied warranty of
19+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+# GNU Affero General Public License for more details.
21+#
22+# You should have received a copy of the GNU Affero General Public License
23+# along with this program. If not, see <http://www.gnu.org/licenses/>.
24+#
25+##############################################################################
26+from . import company
27+from . import res_config
28+from . import postlogistics
29+from . import delivery
30+from . import stock
31
32=== added file 'delivery_carrier_label_postlogistics/__openerp__.py'
33--- delivery_carrier_label_postlogistics/__openerp__.py 1970-01-01 00:00:00 +0000
34+++ delivery_carrier_label_postlogistics/__openerp__.py 2014-01-13 11:23:36 +0000
35@@ -0,0 +1,111 @@
36+# -*- coding: utf-8 -*-
37+##############################################################################
38+#
39+# Author: Yannick Vaucher
40+# Copyright 2013 Camptocamp SA
41+#
42+# This program is free software: you can redistribute it and/or modify
43+# it under the terms of the GNU Affero General Public License as
44+# published by the Free Software Foundation, either version 3 of the
45+# License, or (at your option) any later version.
46+#
47+# This program is distributed in the hope that it will be useful,
48+# but WITHOUT ANY WARRANTY; without even the implied warranty of
49+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50+# GNU Affero General Public License for more details.
51+#
52+# You should have received a copy of the GNU Affero General Public License
53+# along with this program. If not, see <http://www.gnu.org/licenses/>.
54+#
55+##############################################################################
56+{'name': 'PostLogistics Labels WebService',
57+ 'version': '1.0',
58+ 'author': 'Camptocamp',
59+ 'maintainer': 'Camptocamp',
60+ 'category': 'version',
61+ 'complexity': 'normal',
62+ 'depends': ['base_delivery_carrier_label'],
63+ 'description': """
64+PostLogistics Labels WebService
65+===============================
66+
67+Description
68+-----------
69+
70+This module uses `PostLogistics BarCodes WebService`_ to generate labels
71+for your Delivery Orders.
72+
73+It adds a `Create label` button on Delivery Orders.
74+A generated label will be an attachement of your Delivery Order.
75+
76+To see it, please install documents module.
77+
78+You can create multiple delivery method to match your diffent package types.
79+
80+
81+Configuration
82+-------------
83+
84+.. important::
85+ A "Swiss Post Business customer" account is required to use this module.
86+
87+ See `Swiss Post E-logistics`_
88+
89+
90+To configure:
91+
92+* Go to `Configurations -> Settings -> Postlogistics`
93+* Set your login informations
94+* launch the Update PostLogistics Services
95+
96+This will load available services and generate carrier options.
97+
98+Now you can create a carrier method for PostLogistics WebService:
99+
100+* First choose a Service group and save
101+* Add a Mandatory Carrier option using a Basic Service
102+* Save Carrier Method (this will update filters to show you only
103+ compatible services)
104+* Then add other `Optional as default` and `Optional` carrier option
105+ from listed
106+* Additional Service and Delivery instructions
107+
108+.. _PostLogistics BarCodes WebService: http://www.poste.ch/post-startseite/post-geschaeftskunden/post-logistik/post-e-log/post-e-log-webservices.htm
109+.. _Swiss Post E-logistics: http://www.poste.ch/en/post-startseite/post-geschaeftskunden/post-logistik/post-e-log.htm
110+
111+Technical references
112+--------------------
113+
114+`"Barcode" web service documentation`_
115+
116+.. _"Barcode" web service documentation: http://www.poste.ch/post-barcode-cug.htm
117+
118+Contributors
119+------------
120+
121+* Yannick Vaucher <yannick.vaucher@camptocamp.com>
122+
123+----
124+
125+*TODO*:
126+
127+* *Add onchange to improve carrier method creation*
128+* *Identify attachement as label*
129+* *Better License management*
130+""",
131+ 'website': 'http://www.camptocamp.com/',
132+ 'data': ['res_partner_data.xml',
133+ 'delivery_data.xml',
134+ 'delivery_view.xml',
135+ 'res_config_view.xml',
136+ 'security/ir.model.access.csv',
137+ ],
138+ 'tests': [],
139+ 'installable': True,
140+ 'auto_install': False,
141+ 'license': 'AGPL-3',
142+ 'application': True,
143+ 'external_dependencies': {
144+ 'python': ['suds'],
145+ }
146+ }
147
148=== added file 'delivery_carrier_label_postlogistics/company.py'
149--- delivery_carrier_label_postlogistics/company.py 1970-01-01 00:00:00 +0000
150+++ delivery_carrier_label_postlogistics/company.py 2014-01-13 11:23:36 +0000
151@@ -0,0 +1,54 @@
152+# -*- coding: utf-8 -*-
153+##############################################################################
154+#
155+# Author: Yannick Vaucher
156+# Copyright 2013 Camptocamp SA
157+#
158+# This program is free software: you can redistribute it and/or modify
159+# it under the terms of the GNU Affero General Public License as
160+# published by the Free Software Foundation, either version 3 of the
161+# License, or (at your option) any later version.
162+#
163+# This program is distributed in the hope that it will be useful,
164+# but WITHOUT ANY WARRANTY; without even the implied warranty of
165+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
166+# GNU Affero General Public License for more details.
167+#
168+# You should have received a copy of the GNU Affero General Public License
169+# along with this program. If not, see <http://www.gnu.org/licenses/>.
170+#
171+##############################################################################
172+from openerp.osv import orm, fields
173+from openerp.tools import file_open
174+
175+
176+class ResCompany(orm.Model):
177+ _inherit = 'res.company'
178+
179+ def _get_wsdl_url(self, cr, uid, ids, field_name, arg, context=None):
180+ wsdl_file, wsdl_path = file_open('delivery_carrier_label_postlogistics/data/barcode_v2_1.wsdl', pathinfo=True)
181+ wsdl_url = 'file://' + wsdl_path
182+ res = dict.fromkeys(ids, wsdl_url)
183+ return res
184+
185+ _columns = {
186+ 'postlogistics_wsdl_url': fields.function(
187+ _get_wsdl_url,
188+ string='WSDL URL',
189+ type='char'),
190+ 'postlogistics_username': fields.char('Username'),
191+ 'postlogistics_password': fields.char('Password'),
192+ # XXX improve license management
193+ 'postlogistics_license_less_1kg': fields.char('License less than 1kg'),
194+ 'postlogistics_license_more_1kg': fields.char('License more than 1kg'),
195+ 'postlogistics_license_vinolog': fields.char('License VinoLog'),
196+ 'postlogistics_logo': fields.binary('Company logo for PostLogistics'),
197+ 'postlogistics_office': fields.char('Post office'),
198+
199+ 'postlogistics_default_label_layout': fields.many2one(
200+ 'delivery.carrier.template.option', 'Default label layout'),
201+ 'postlogistics_default_output_format': fields.many2one(
202+ 'delivery.carrier.template.option', 'Default output format'),
203+ 'postlogistics_default_resolution': fields.many2one(
204+ 'delivery.carrier.template.option', 'Default resolution'),
205+ }
206
207=== added directory 'delivery_carrier_label_postlogistics/data'
208=== added file 'delivery_carrier_label_postlogistics/data/barcode_v2_1.wsdl'
209--- delivery_carrier_label_postlogistics/data/barcode_v2_1.wsdl 1970-01-01 00:00:00 +0000
210+++ delivery_carrier_label_postlogistics/data/barcode_v2_1.wsdl 2014-01-13 11:23:36 +0000
211@@ -0,0 +1,249 @@
212+<?xml version="1.0" encoding="UTF-8"?>
213+<definitions name="Barcode"
214+ targetNamespace="https://www.mypostbusiness.ch/wsbc/barcode/v2_1"
215+ xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="https://www.mypostbusiness.ch/wsbc/barcode/v2_1"
216+ xmlns:barcode="https://www.mypostbusiness.ch/wsbc/barcode/v2_1/types"
217+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
218+ <types>
219+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
220+ <xsd:import
221+ namespace="https://www.mypostbusiness.ch/wsbc/barcode/v2_1/types"
222+ schemaLocation="barcode_v2_1.xsd" />
223+ </xsd:schema>
224+ </types>
225+
226+ <message name="ValidateCombination">
227+ <part name="body" element="barcode:ValidateCombination" />
228+ </message>
229+ <message name="ValidateCombinationResponse">
230+ <part name="body" element="barcode:ValidateCombinationResponse" />
231+ </message>
232+
233+ <message name="GenerateLabel">
234+ <part name="body" element="barcode:GenerateLabel" />
235+ </message>
236+ <message name="GenerateLabelResponse">
237+ <part name="body" element="barcode:GenerateLabelResponse" />
238+ </message>
239+
240+ <message name="GenerateSingleBarcodes">
241+ <part name="body" element="barcode:GenerateSingleBarcodes" />
242+ </message>
243+ <message name="GenerateSingleBarcodesResponse">
244+ <part name="body" element="barcode:GenerateSingleBarcodesResponse" />
245+ </message>
246+
247+ <message name="ReadServiceGroups">
248+ <part name="body" element="barcode:ReadServiceGroups" />
249+ </message>
250+ <message name="ReadServiceGroupsResponse">
251+ <part name="body" element="barcode:ReadServiceGroupsResponse" />
252+ </message>
253+
254+ <message name="ReadBasicServices">
255+ <part name="body" element="barcode:ReadBasicServices" />
256+ </message>
257+ <message name="ReadBasicServicesResponse">
258+ <part name="body" element="barcode:ReadBasicServicesResponse" />
259+ </message>
260+
261+ <message name="ReadAllowedServicesByFrankingLicense">
262+ <part name="body" element="barcode:ReadAllowedServicesByFrankingLicense" />
263+ </message>
264+ <message name="ReadAllowedServicesByFrankingLicenseResponse">
265+ <part name="body"
266+ element="barcode:ReadAllowedServicesByFrankingLicenseResponse" />
267+ </message>
268+
269+ <message name="ReadAdditionalServices">
270+ <part name="body" element="barcode:ReadAdditionalServices" />
271+ </message>
272+ <message name="ReadAdditionalServicesResponse">
273+ <part name="body" element="barcode:ReadAdditionalServicesResponse" />
274+ </message>
275+
276+ <message name="ReadDeliveryInstructions">
277+ <part name="body" element="barcode:ReadDeliveryInstructions" />
278+ </message>
279+ <message name="ReadDeliveryInstructionsResponse">
280+ <part name="body" element="barcode:ReadDeliveryInstructionsResponse" />
281+ </message>
282+
283+ <message name="ReadLabelLayouts">
284+ <part name="body" element="barcode:ReadLabelLayouts" />
285+ </message>
286+ <message name="ReadLabelLayoutsResponse">
287+ <part name="body" element="barcode:ReadLabelLayoutsResponse" />
288+ </message>
289+
290+ <message name="GenerateBarcode">
291+ <part name="body" element="barcode:GenerateBarcode" />
292+ </message>
293+ <message name="GenerateBarcodeResponse">
294+ <part name="body" element="barcode:GenerateBarcodeResponse" />
295+ </message>
296+
297+ <portType name="BarcodePortType">
298+
299+ <operation name="ValidateCombination">
300+ <input message="tns:ValidateCombination" />
301+ <output message="tns:ValidateCombinationResponse" />
302+ </operation>
303+
304+ <operation name="GenerateLabel">
305+ <input message="tns:GenerateLabel" />
306+ <output message="tns:GenerateLabelResponse" />
307+ </operation>
308+
309+ <operation name="GenerateSingleBarcodes">
310+ <input message="tns:GenerateSingleBarcodes" />
311+ <output message="tns:GenerateSingleBarcodesResponse" />
312+ </operation>
313+
314+ <operation name="ReadServiceGroups">
315+ <input message="tns:ReadServiceGroups" />
316+ <output message="tns:ReadServiceGroupsResponse" />
317+ </operation>
318+
319+ <operation name="ReadBasicServices">
320+ <input message="tns:ReadBasicServices" />
321+ <output message="tns:ReadBasicServicesResponse" />
322+ </operation>
323+
324+ <operation name="ReadAllowedServicesByFrankingLicense">
325+ <input message="tns:ReadAllowedServicesByFrankingLicense" />
326+ <output message="tns:ReadAllowedServicesByFrankingLicenseResponse" />
327+ </operation>
328+
329+ <operation name="ReadAdditionalServices">
330+ <input message="tns:ReadAdditionalServices" />
331+ <output message="tns:ReadAdditionalServicesResponse" />
332+ </operation>
333+
334+ <operation name="ReadDeliveryInstructions">
335+ <input message="tns:ReadDeliveryInstructions" />
336+ <output message="tns:ReadDeliveryInstructionsResponse" />
337+ </operation>
338+
339+ <operation name="ReadLabelLayouts">
340+ <input message="tns:ReadLabelLayouts" />
341+ <output message="tns:ReadLabelLayoutsResponse" />
342+ </operation>
343+
344+ <operation name="GenerateBarcode">
345+ <input message="tns:GenerateBarcode" />
346+ <output message="tns:GenerateBarcodeResponse" />
347+ </operation>
348+
349+ </portType>
350+ <binding name="BarcodeSoapBinding" type="tns:BarcodePortType">
351+ <soap:binding style="document"
352+ transport="http://schemas.xmlsoap.org/soap/http" />
353+
354+ <operation name="ValidateCombination">
355+ <soap:operation soapAction="ValidateCombination" />
356+ <input>
357+ <soap:body use="literal" />
358+ </input>
359+ <output>
360+ <soap:body use="literal" />
361+ </output>
362+ </operation>
363+
364+ <operation name="GenerateLabel">
365+ <soap:operation soapAction="GenerateLabel" />
366+ <input>
367+ <soap:body use="literal" />
368+ </input>
369+ <output>
370+ <soap:body use="literal" />
371+ </output>
372+ </operation>
373+
374+ <operation name="GenerateSingleBarcodes">
375+ <soap:operation soapAction="GenerateSingleBarcodes" />
376+ <input>
377+ <soap:body use="literal" />
378+ </input>
379+ <output>
380+ <soap:body use="literal" />
381+ </output>
382+ </operation>
383+
384+ <operation name="ReadServiceGroups">
385+ <soap:operation soapAction="ReadServiceGroups" />
386+ <input>
387+ <soap:body use="literal" />
388+ </input>
389+ <output>
390+ <soap:body use="literal" />
391+ </output>
392+ </operation>
393+
394+ <operation name="ReadBasicServices">
395+ <soap:operation soapAction="ReadBasicServices" />
396+ <input>
397+ <soap:body use="literal" />
398+ </input>
399+ <output>
400+ <soap:body use="literal" />
401+ </output>
402+ </operation>
403+
404+ <operation name="ReadAllowedServicesByFrankingLicense">
405+ <soap:operation soapAction="ReadAllowedServicesByFrankingLicense" />
406+ <input>
407+ <soap:body use="literal" />
408+ </input>
409+ <output>
410+ <soap:body use="literal" />
411+ </output>
412+ </operation>
413+
414+ <operation name="ReadAdditionalServices">
415+ <soap:operation soapAction="ReadAdditionalServices" />
416+ <input>
417+ <soap:body use="literal" />
418+ </input>
419+ <output>
420+ <soap:body use="literal" />
421+ </output>
422+ </operation>
423+
424+ <operation name="ReadDeliveryInstructions">
425+ <soap:operation soapAction="ReadDeliveryInstructions" />
426+ <input>
427+ <soap:body use="literal" />
428+ </input>
429+ <output>
430+ <soap:body use="literal" />
431+ </output>
432+ </operation>
433+
434+ <operation name="ReadLabelLayouts">
435+ <soap:operation soapAction="ReadLabelLayouts" />
436+ <input>
437+ <soap:body use="literal" />
438+ </input>
439+ <output>
440+ <soap:body use="literal" />
441+ </output>
442+ </operation>
443+
444+ <operation name="GenerateBarcode">
445+ <soap:operation soapAction="GenerateBarcode" />
446+ <input>
447+ <soap:body use="literal" />
448+ </input>
449+ <output>
450+ <soap:body use="literal" />
451+ </output>
452+ </operation>
453+
454+ </binding>
455+ <service name="BarcodeService">
456+ <port name="BarcodePort" binding="tns:BarcodeSoapBinding">
457+ <soap:address location="https://www.mypostbusiness.ch/wsbc/barcode/v2_1" />
458+ </port>
459+ </service>
460+</definitions>
461\ No newline at end of file
462
463=== added file 'delivery_carrier_label_postlogistics/data/barcode_v2_1.xsd'
464--- delivery_carrier_label_postlogistics/data/barcode_v2_1.xsd 1970-01-01 00:00:00 +0000
465+++ delivery_carrier_label_postlogistics/data/barcode_v2_1.xsd 2014-01-13 11:23:36 +0000
466@@ -0,0 +1,1198 @@
467+<?xml version="1.0" encoding="UTF-8"?>
468+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
469+ xmlns="https://www.mypostbusiness.ch/wsbc/barcode/v2_1/types"
470+ targetNamespace="https://www.mypostbusiness.ch/wsbc/barcode/v2_1/types"
471+ elementFormDefault="qualified" attributeFormDefault="unqualified">
472+
473+ <!-- 5.4 Use Case Validiere Kombination (Seite 12) -->
474+ <xs:element name="ValidateCombination">
475+ <xs:complexType>
476+ <xs:sequence>
477+ <xs:element name="Language" type="Language" />
478+ <xs:element name="Envelope">
479+ <xs:complexType>
480+ <xs:sequence>
481+ <xs:element name="LabelDefinition" type="LabelDefinition" />
482+ <xs:element name="Data">
483+ <xs:complexType>
484+ <xs:sequence>
485+ <xs:element name="Provider">
486+ <xs:complexType>
487+ <xs:sequence>
488+ <xs:element name="Sending">
489+ <xs:complexType>
490+ <xs:sequence>
491+ <xs:element name="Item"
492+ type="ValidateCombinationItem"
493+ maxOccurs="unbounded" />
494+ </xs:sequence>
495+ </xs:complexType>
496+ </xs:element>
497+ </xs:sequence>
498+ </xs:complexType>
499+ </xs:element>
500+ </xs:sequence>
501+ </xs:complexType>
502+ </xs:element>
503+ </xs:sequence>
504+ </xs:complexType>
505+ </xs:element>
506+ </xs:sequence>
507+ </xs:complexType>
508+ </xs:element>
509+
510+ <xs:complexType name="ValidateCombinationItem">
511+ <xs:sequence>
512+ <xs:element name="ItemID" type="ItemIDType" minOccurs="0" />
513+ <xs:element name="Attributes" minOccurs="0">
514+ <xs:complexType>
515+ <xs:sequence>
516+ <xs:element name="PRZL" type="PRZLType"
517+ minOccurs="1" maxOccurs="unbounded" />
518+ </xs:sequence>
519+ </xs:complexType>
520+ </xs:element>
521+ <xs:element name="Country" type="CountryType"
522+ minOccurs="0" />
523+ </xs:sequence>
524+ </xs:complexType>
525+
526+ <xs:element name="ValidateCombinationResponse">
527+ <xs:complexType>
528+ <xs:sequence>
529+ <xs:element name="Envelope">
530+ <xs:complexType>
531+ <xs:sequence>
532+ <xs:element name="LabelDefinition" type="LabelDefinition" />
533+ <xs:element name="Data">
534+ <xs:complexType>
535+ <xs:sequence>
536+ <xs:element name="Provider">
537+ <xs:complexType>
538+ <xs:sequence>
539+ <xs:element name="Sending">
540+ <xs:complexType>
541+ <xs:sequence>
542+ <xs:element name="Item"
543+ type="ResponseItem" maxOccurs="unbounded" />
544+ <xs:element name="Country"
545+ type="CountryType" minOccurs="0" />
546+ </xs:sequence>
547+ </xs:complexType>
548+ </xs:element>
549+ </xs:sequence>
550+ </xs:complexType>
551+ </xs:element>
552+ </xs:sequence>
553+ </xs:complexType>
554+ </xs:element>
555+ </xs:sequence>
556+ </xs:complexType>
557+ </xs:element>
558+ </xs:sequence>
559+ </xs:complexType>
560+ </xs:element>
561+
562+ <!-- 5.5 Use Case Generiere Adressträger (Seite 34) -->
563+ <xs:element name="GenerateLabel">
564+ <xs:complexType>
565+ <xs:sequence>
566+ <xs:element name="Language" type="Language" />
567+ <xs:element name="Envelope">
568+ <xs:complexType>
569+ <xs:sequence>
570+ <xs:element name="LabelDefinition" type="GenerateLabelDefinition" />
571+ <xs:element name="FileInfos" type="GenerateLabelFileInfos" />
572+ <xs:element name="Data" type="LabelData" />
573+ </xs:sequence>
574+ </xs:complexType>
575+ </xs:element>
576+ </xs:sequence>
577+ </xs:complexType>
578+ </xs:element>
579+
580+ <xs:complexType name="GenerateLabelDefinition">
581+ <xs:complexContent>
582+ <xs:extension base="LabelDefinition">
583+ <xs:sequence>
584+ <xs:element name="PrintAddresses" type="PrintAddressesType" />
585+ <xs:element name="ImageFileType" type="ImageFileType" />
586+ <xs:element name="ImageResolution" type="xs:int" />
587+ <xs:element name="PrintPreview" type="xs:boolean" />
588+ </xs:sequence>
589+ </xs:extension>
590+ </xs:complexContent>
591+ </xs:complexType>
592+
593+ <xs:simpleType name="PrintAddressesType">
594+ <xs:annotation>
595+ <xs:documentation>Enumeration to indicated wheter addresses are
596+ printet or not.</xs:documentation>
597+ </xs:annotation>
598+ <xs:restriction base="xs:string">
599+ <xs:enumeration value="None">
600+ <xs:annotation>
601+ <xs:documentation>No Addresses are printed.</xs:documentation>
602+ </xs:annotation>
603+ </xs:enumeration>
604+ <xs:enumeration value="OnlyRecipient">
605+ <xs:annotation>
606+ <xs:documentation>Only recipient's address is printed.
607+ </xs:documentation>
608+ </xs:annotation>
609+ </xs:enumeration>
610+ <xs:enumeration value="OnlyCustomer">
611+ <xs:annotation>
612+ <xs:documentation>Only customer's address is printed.
613+ </xs:documentation>
614+ </xs:annotation>
615+ </xs:enumeration>
616+ <xs:enumeration value="RecipientAndCustomer">
617+ <xs:annotation>
618+ <xs:documentation>Recipient and customer addresses are
619+ printed.</xs:documentation>
620+ </xs:annotation>
621+ </xs:enumeration>
622+ </xs:restriction>
623+ </xs:simpleType>
624+
625+ <xs:complexType name="GenerateLabelFileInfos">
626+ <xs:sequence>
627+ <xs:element name="FrankingLicense" type="FrankingLicenseType" />
628+ <xs:element name="PpFranking" type="xs:boolean"
629+ default="false" />
630+ <xs:element name="Customer" type="GenerateLabelCustomer" />
631+ <xs:element name="CustomerSystem" type="CustomerSystemType"
632+ minOccurs="0" />
633+ </xs:sequence>
634+ </xs:complexType>
635+
636+ <xs:complexType name="GenerateLabelCustomer">
637+ <xs:sequence>
638+ <xs:element name="Name1" type="CustomerAddressLineType" />
639+ <xs:element name="Name2" minOccurs="0"
640+ type="CustomerAddressLineType" />
641+ <xs:element name="Street" type="CustomerAddressLineType" />
642+ <xs:element name="POBox" type="CustomerAddressLineType"
643+ minOccurs="0" />
644+ <xs:element name="ZIP">
645+ <xs:simpleType>
646+ <xs:restriction base="xs:integer">
647+ <xs:totalDigits value="6" />
648+ </xs:restriction>
649+ </xs:simpleType>
650+ </xs:element>
651+ <xs:element name="City" type="CustomerAddressLineType" />
652+ <xs:element name="Country" type="CountryType"
653+ minOccurs="0" />
654+ <xs:element name="Logo" type="xs:base64Binary"
655+ minOccurs="0" />
656+ <xs:element name="LogoFormat" minOccurs="0">
657+ <xs:simpleType>
658+ <xs:restriction base="CommonPatternStringType">
659+ <xs:maxLength value="3" />
660+ </xs:restriction>
661+ </xs:simpleType>
662+ </xs:element>
663+ <xs:element name="DomicilePostOffice" minOccurs="0">
664+ <xs:simpleType>
665+ <xs:restriction base="CommonPatternStringType">
666+ <xs:maxLength value="35" />
667+ </xs:restriction>
668+ </xs:simpleType>
669+ </xs:element>
670+ </xs:sequence>
671+ </xs:complexType>
672+
673+ <xs:element name="GenerateLabelResponse">
674+ <xs:complexType>
675+ <xs:sequence>
676+ <xs:element name="Envelope">
677+ <xs:complexType>
678+ <xs:sequence>
679+ <xs:element name="LabelDefinition"
680+ type="GenerateLabelResponseDefinition" />
681+ <xs:element name="Data">
682+ <xs:complexType>
683+ <xs:sequence>
684+ <xs:element name="Provider">
685+ <xs:complexType>
686+ <xs:sequence>
687+ <xs:element name="Sending">
688+ <xs:complexType>
689+ <xs:sequence>
690+ <xs:element name="SendingID"
691+ type="SendingIDType" minOccurs="0" />
692+ <xs:element name="Item"
693+ type="LabelResponseItem" maxOccurs="unbounded" />
694+ </xs:sequence>
695+ </xs:complexType>
696+ </xs:element>
697+ </xs:sequence>
698+ </xs:complexType>
699+ </xs:element>
700+ </xs:sequence>
701+ </xs:complexType>
702+ </xs:element>
703+ </xs:sequence>
704+ </xs:complexType>
705+ </xs:element>
706+ </xs:sequence>
707+ </xs:complexType>
708+ </xs:element>
709+
710+ <xs:complexType name="GenerateLabelResponseDefinition">
711+ <xs:complexContent>
712+ <xs:extension base="GenerateLabelDefinition">
713+ <xs:sequence>
714+ <xs:element name="ColorPrintRequired" type="xs:boolean" />
715+ </xs:sequence>
716+ </xs:extension>
717+ </xs:complexContent>
718+ </xs:complexType>
719+
720+ <xs:complexType name="LabelResponseItem">
721+ <xs:complexContent>
722+ <xs:extension base="ResponseItem">
723+ <xs:sequence>
724+ <xs:element name="IdentCode" type="IdentCodeType"
725+ minOccurs="0" />
726+ <xs:element name="Label" type="xs:base64Binary"
727+ minOccurs="0" />
728+ </xs:sequence>
729+ </xs:extension>
730+ </xs:complexContent>
731+ </xs:complexType>
732+
733+ <!-- WSBC 2.1 FaFo 14.1 Labellayout BC -->
734+ <xs:element name="GenerateSingleBarcodes">
735+ <xs:complexType>
736+ <xs:sequence>
737+ <xs:element name="Language" type="Language" />
738+ <xs:element name="Envelope">
739+ <xs:complexType>
740+ <xs:sequence>
741+ <xs:element name="BarcodeDefinition" type="SingleBarcodesDefinition" />
742+ <xs:element name="FileInfos" type="SingleBarcodesFileInfos" />
743+ <xs:element name="Data" type="LabelData" />
744+ </xs:sequence>
745+ </xs:complexType>
746+ </xs:element>
747+ </xs:sequence>
748+ </xs:complexType>
749+ </xs:element>
750+
751+ <xs:complexType name="SingleBarcodesDefinition">
752+ <xs:sequence>
753+ <xs:element name="ImageFileType" type="ImageFileType" />
754+ <xs:element name="ImageResolution" type="xs:int" />
755+ </xs:sequence>
756+ </xs:complexType>
757+
758+ <xs:complexType name="SingleBarcodesFileInfos">
759+ <xs:sequence>
760+ <xs:element name="FrankingLicense" type="FrankingLicenseType" />
761+ <xs:element name="PpFranking" type="xs:boolean"
762+ default="false" />
763+ <xs:element name="Customer" type="SingleBarcodesCustomer" />
764+ <xs:element name="CustomerSystem" type="CustomerSystemType"
765+ minOccurs="0" />
766+ </xs:sequence>
767+ </xs:complexType>
768+
769+ <xs:complexType name="SingleBarcodesCustomer">
770+ <xs:sequence>
771+ <xs:element name="Name1" type="CustomerAddressLineType" />
772+ <xs:element name="Name2" minOccurs="0"
773+ type="CustomerAddressLineType" />
774+ <xs:element name="Street" type="CustomerAddressLineType" />
775+ <xs:element name="POBox" type="CustomerAddressLineType"
776+ minOccurs="0" />
777+ <xs:element name="ZIP">
778+ <xs:simpleType>
779+ <xs:restriction base="xs:integer">
780+ <xs:totalDigits value="6" />
781+ </xs:restriction>
782+ </xs:simpleType>
783+ </xs:element>
784+ <xs:element name="City" type="CustomerAddressLineType" />
785+ <xs:element name="Country" type="CountryType"
786+ minOccurs="0" />
787+ <xs:element name="DomicilePostOffice" minOccurs="0">
788+ <xs:simpleType>
789+ <xs:restriction base="CommonPatternStringType">
790+ <xs:maxLength value="35" />
791+ </xs:restriction>
792+ </xs:simpleType>
793+ </xs:element>
794+ </xs:sequence>
795+ </xs:complexType>
796+
797+ <xs:element name="GenerateSingleBarcodesResponse">
798+ <xs:complexType>
799+ <xs:sequence>
800+ <xs:element name="Envelope">
801+ <xs:complexType>
802+ <xs:sequence>
803+ <xs:element name="BarcodeDefinition"
804+ type="SingleBarcodesResponseDefinition" />
805+ <xs:element name="Data">
806+ <xs:complexType>
807+ <xs:sequence>
808+ <xs:element name="Provider">
809+ <xs:complexType>
810+ <xs:sequence>
811+ <xs:element name="Sending">
812+ <xs:complexType>
813+ <xs:sequence>
814+ <xs:element name="SendingID"
815+ type="SendingIDType" minOccurs="0" />
816+ <xs:element name="Item"
817+ type="SingleBarcodesResponseItem"
818+ maxOccurs="unbounded" />
819+ </xs:sequence>
820+ </xs:complexType>
821+ </xs:element>
822+ </xs:sequence>
823+ </xs:complexType>
824+ </xs:element>
825+ </xs:sequence>
826+ </xs:complexType>
827+ </xs:element>
828+ </xs:sequence>
829+ </xs:complexType>
830+ </xs:element>
831+ </xs:sequence>
832+ </xs:complexType>
833+ </xs:element>
834+
835+ <xs:complexType name="SingleBarcodesResponseDefinition">
836+ <xs:complexContent>
837+ <xs:extension base="SingleBarcodesDefinition">
838+ <xs:sequence>
839+ <xs:element name="ColorPrintRequired" type="xs:boolean" />
840+ </xs:sequence>
841+ </xs:extension>
842+ </xs:complexContent>
843+ </xs:complexType>
844+
845+ <xs:complexType name="SingleBarcodesResponseItem">
846+ <xs:complexContent>
847+ <xs:extension base="ResponseItem">
848+ <xs:sequence>
849+ <xs:element name="IdentCode" type="IdentCodeType"
850+ minOccurs="0" />
851+ <xs:element name="Barcodes" minOccurs="0">
852+ <xs:complexType>
853+ <xs:sequence>
854+ <xs:element name="Barcode" type="xs:base64Binary"
855+ maxOccurs="unbounded" />
856+ </xs:sequence>
857+ </xs:complexType>
858+ </xs:element>
859+ </xs:sequence>
860+ </xs:extension>
861+ </xs:complexContent>
862+ </xs:complexType>
863+
864+ <!-- Common datatypes for generate label and generate single barcodes -->
865+ <xs:simpleType name="CustomerAddressLineType">
866+ <xs:restriction base="CommonPatternStringType">
867+ <xs:maxLength value="25" />
868+ </xs:restriction>
869+ </xs:simpleType>
870+
871+ <xs:complexType name="LabelData">
872+ <xs:sequence>
873+ <xs:element name="Provider">
874+ <xs:complexType>
875+ <xs:sequence>
876+ <xs:element name="Sending">
877+ <xs:complexType>
878+ <xs:sequence>
879+ <xs:element name="SendingID" type="SendingIDType"
880+ minOccurs="0" />
881+ <xs:element name="Item" type="Item"
882+ maxOccurs="unbounded" />
883+ </xs:sequence>
884+ </xs:complexType>
885+ </xs:element>
886+ </xs:sequence>
887+ </xs:complexType>
888+ </xs:element>
889+ </xs:sequence>
890+ </xs:complexType>
891+
892+ <xs:simpleType name="SendingIDType">
893+ <xs:restriction base="CommonPatternStringType">
894+ <xs:maxLength value="50" />
895+ </xs:restriction>
896+ </xs:simpleType>
897+
898+ <xs:complexType name="Item">
899+ <xs:sequence>
900+ <xs:element name="ItemID" type="ItemIDType" minOccurs="0" />
901+ <xs:element name="ItemNumber" type="ItemNumberType"
902+ minOccurs="0" />
903+ <xs:element name="IdentCode" type="IdentCodeType"
904+ minOccurs="0" />
905+ <xs:element name="Recipient" type="Recipient" />
906+ <xs:element name="AdditionalINFOS" minOccurs="0">
907+ <xs:annotation>
908+ <xs:documentation>ehem. REC_Data bei V2.1 und 2.0
909+ </xs:documentation>
910+ </xs:annotation>
911+ <xs:complexType>
912+ <xs:sequence>
913+ <xs:element name="AdditionalData" type="AdditionalData"
914+ maxOccurs="50" />
915+ </xs:sequence>
916+ </xs:complexType>
917+ </xs:element>
918+ <xs:element name="Attributes" type="ServiceCodeAttributes"
919+ minOccurs="0" />
920+ <xs:element name="Notification" type="Notification"
921+ minOccurs="0" maxOccurs="15">
922+ <xs:annotation>
923+ <xs:documentation>Zusatzinformationen für Dienstleistung
924+ </xs:documentation>
925+ </xs:annotation>
926+ </xs:element>
927+ </xs:sequence>
928+ </xs:complexType>
929+
930+ <xs:simpleType name="ItemNumberType">
931+ <xs:restriction base="xs:string">
932+ <xs:pattern value="[0-9]{1,8}" />
933+ </xs:restriction>
934+ </xs:simpleType>
935+
936+ <xs:complexType name="Recipient">
937+ <xs:sequence>
938+ <xs:element name="PostIdent" minOccurs="0">
939+ <xs:simpleType>
940+ <xs:restriction base="CommonPatternStringType">
941+ <xs:maxLength value="15" />
942+ </xs:restriction>
943+ </xs:simpleType>
944+ </xs:element>
945+ <xs:element name="Title" type="RecipientAddressType"
946+ minOccurs="0" />
947+ <xs:element name="PersonallyAddressed" type="xs:boolean"
948+ minOccurs="0" />
949+ <xs:element name="Name1" type="RecipientAddressType" />
950+ <xs:element name="FirstName" type="RecipientAddressType"
951+ minOccurs="0" />
952+ <xs:element name="Name2" type="RecipientAddressType"
953+ minOccurs="0" />
954+ <xs:element name="Street" type="RecipientAddressType"
955+ minOccurs="0" />
956+ <xs:element name="HouseNo" minOccurs="0">
957+ <xs:simpleType>
958+ <xs:restriction base="CommonPatternStringType">
959+ <xs:maxLength value="5" />
960+ </xs:restriction>
961+ </xs:simpleType>
962+ </xs:element>
963+ <xs:element name="POBox" type="RecipientAddressType"
964+ minOccurs="0" />
965+ <xs:element name="FloorNo" minOccurs="0">
966+ <xs:simpleType>
967+ <xs:restriction base="CommonPatternStringType">
968+ <xs:maxLength value="5" />
969+ </xs:restriction>
970+ </xs:simpleType>
971+ </xs:element>
972+ <xs:element name="MailboxNo" minOccurs="0">
973+ <xs:simpleType>
974+ <xs:restriction base="xs:integer">
975+ <xs:totalDigits value="10" />
976+ </xs:restriction>
977+ </xs:simpleType>
978+ </xs:element>
979+ <xs:element name="ZIP" minOccurs="1">
980+ <xs:simpleType>
981+ <xs:restriction base="CommonPatternStringType">
982+ <xs:maxLength value="10" />
983+ </xs:restriction>
984+ </xs:simpleType>
985+ </xs:element>
986+ <xs:element name="City" type="RecipientAddressType" />
987+ <xs:element name="Country" type="CountryType"
988+ minOccurs="0" />
989+ <xs:element name="Phone" type="PhoneNumberType"
990+ minOccurs="0" />
991+ <xs:element name="Mobile" type="PhoneNumberType"
992+ minOccurs="0" />
993+ <xs:element name="EMail" type="EMailAddressType"
994+ minOccurs="0" />
995+ <xs:element name="LabelAddress" type="LabelAddress"
996+ minOccurs="0" />
997+ </xs:sequence>
998+ </xs:complexType>
999+
1000+ <xs:complexType name="LabelAddress">
1001+ <xs:annotation>
1002+ <xs:documentation>optional, used to declare a specific address on
1003+ the label. if omitted, the address data of
1004+ the recipient is taken. Useful if the address data of the recipient
1005+ exceeds the length of the label.
1006+ </xs:documentation>
1007+ </xs:annotation>
1008+ <xs:sequence>
1009+ <xs:element name="NameLine" type="RecipientAddressType" />
1010+ <xs:element name="AddressLine" type="RecipientAddressType" />
1011+ </xs:sequence>
1012+ </xs:complexType>
1013+
1014+ <xs:simpleType name="RecipientAddressType">
1015+ <xs:restriction base="CommonPatternStringType">
1016+ <xs:maxLength value="35" />
1017+ </xs:restriction>
1018+ </xs:simpleType>
1019+
1020+ <xs:complexType name="AdditionalData">
1021+ <xs:sequence>
1022+ <xs:element name="Type">
1023+ <xs:simpleType>
1024+ <xs:restriction base="CommonPatternStringType">
1025+ <xs:maxLength value="35" />
1026+ </xs:restriction>
1027+ </xs:simpleType>
1028+ </xs:element>
1029+ <xs:element name="Value">
1030+ <xs:simpleType>
1031+ <xs:restriction base="CommonPatternStringType">
1032+ <xs:maxLength value="50" />
1033+ </xs:restriction>
1034+ </xs:simpleType>
1035+ </xs:element>
1036+ </xs:sequence>
1037+ </xs:complexType>
1038+
1039+ <xs:complexType name="ServiceCodeAttributes">
1040+ <xs:sequence>
1041+ <xs:element name="PRZL" type="PRZLType" minOccurs="1"
1042+ maxOccurs="unbounded" />
1043+ <xs:element name="Amount" type="AmountType" minOccurs="0" />
1044+ <xs:element name="FreeText" minOccurs="0">
1045+ <xs:simpleType>
1046+ <xs:restriction base="CommonPatternStringType">
1047+ <xs:maxLength value="34" />
1048+ </xs:restriction>
1049+ </xs:simpleType>
1050+ </xs:element>
1051+ <xs:element name="DeliveryDate" type="xs:date"
1052+ minOccurs="0" />
1053+ <xs:element name="ParcelNo" type="ParcelAmountType"
1054+ minOccurs="0" />
1055+ <xs:element name="ParcelTotal" type="ParcelAmountType"
1056+ minOccurs="0" />
1057+ <xs:element name="DeliveryPlace" minOccurs="0">
1058+ <xs:simpleType>
1059+ <xs:restriction base="CommonPatternStringType">
1060+ <xs:maxLength value="35" />
1061+ </xs:restriction>
1062+ </xs:simpleType>
1063+ </xs:element>
1064+ <xs:element name="ProClima" type="xs:boolean"
1065+ minOccurs="0" />
1066+ <xs:element name="Dimensions" type="Dimensions"
1067+ minOccurs="0" />
1068+ <xs:element name="UNNumbers" type="UNNumbers"
1069+ minOccurs="0" />
1070+ </xs:sequence>
1071+ </xs:complexType>
1072+
1073+ <xs:simpleType name="ParcelAmountType">
1074+ <xs:restriction base="xs:int">
1075+ <xs:minInclusive value="0" />
1076+ <xs:maxInclusive value="99" />
1077+ </xs:restriction>
1078+ </xs:simpleType>
1079+
1080+ <xs:complexType name="Dimensions">
1081+ <xs:annotation>
1082+ <xs:documentation>Represents the Dimensions attribute of the
1083+ DataTransfer.</xs:documentation>
1084+ </xs:annotation>
1085+ <xs:sequence>
1086+ <xs:element name="Weight">
1087+ <xs:annotation>
1088+ <xs:documentation>Weight in gramms.</xs:documentation>
1089+ </xs:annotation>
1090+ <xs:simpleType>
1091+ <xs:restriction base="xs:integer">
1092+ <xs:totalDigits value="5" />
1093+ </xs:restriction>
1094+ </xs:simpleType>
1095+ </xs:element>
1096+ </xs:sequence>
1097+ </xs:complexType>
1098+
1099+ <xs:complexType name="UNNumbers">
1100+ <xs:annotation>
1101+ <xs:documentation>Represents the UN Numbers for the additional
1102+ service LQ (limited quantities).
1103+ </xs:documentation>
1104+ </xs:annotation>
1105+ <xs:sequence>
1106+ <xs:element name="UNNumber" minOccurs="0" maxOccurs="unbounded">
1107+ <xs:simpleType>
1108+ <xs:restriction base="xs:integer">
1109+ <xs:totalDigits value="4" />
1110+ </xs:restriction>
1111+ </xs:simpleType>
1112+ </xs:element>
1113+ </xs:sequence>
1114+ </xs:complexType>
1115+
1116+ <xs:complexType name="Notification">
1117+ <xs:all>
1118+ <xs:element name="Communication" type="Communication" />
1119+ <xs:element name="Service">
1120+ <xs:annotation>
1121+ <xs:documentation>Avisierungs-Code, welcher die Avisierung
1122+ bezeichnet.</xs:documentation>
1123+ </xs:annotation>
1124+ <xs:simpleType>
1125+ <xs:restriction base="xs:integer">
1126+ <xs:totalDigits value="20" />
1127+ </xs:restriction>
1128+ </xs:simpleType>
1129+ </xs:element>
1130+ <xs:element name="FreeText1" minOccurs="0">
1131+ <xs:annotation>
1132+ <xs:documentation>Individueller Text 1 für Avisierung.
1133+ </xs:documentation>
1134+ </xs:annotation>
1135+ <xs:simpleType>
1136+ <xs:restriction base="CommonPatternStringType">
1137+ <xs:maxLength value="160" />
1138+ </xs:restriction>
1139+ </xs:simpleType>
1140+ </xs:element>
1141+ <xs:element name="FreeText2" minOccurs="0">
1142+ <xs:annotation>
1143+ <xs:documentation>Individueller Text 2 für Avisierung.
1144+ </xs:documentation>
1145+ </xs:annotation>
1146+ <xs:simpleType>
1147+ <xs:restriction base="CommonPatternStringType">
1148+ <xs:maxLength value="512" />
1149+ </xs:restriction>
1150+ </xs:simpleType>
1151+ </xs:element>
1152+ <xs:element name="Language" type="Language" />
1153+ </xs:all>
1154+ <xs:attribute name="Type" type="NotificationType" use="required">
1155+ <xs:annotation>
1156+ <xs:documentation>Angabe des Medium</xs:documentation>
1157+ </xs:annotation>
1158+ </xs:attribute>
1159+ </xs:complexType>
1160+
1161+ <xs:simpleType name="NotificationType">
1162+ <xs:restriction base="xs:string">
1163+ <xs:enumeration value="EMAIL" />
1164+ <xs:enumeration value="SMS" />
1165+ </xs:restriction>
1166+ </xs:simpleType>
1167+
1168+ <xs:complexType name="Communication">
1169+ <xs:choice>
1170+ <xs:element name="Email" type="EMailAddressType" />
1171+ <xs:element name="Mobile" type="PhoneNumberType" />
1172+ </xs:choice>
1173+ </xs:complexType>
1174+
1175+ <!-- 5.6 Use Case Lese Dienstleistungsgruppen -->
1176+ <xs:element name="ReadServiceGroups">
1177+ <xs:complexType>
1178+ <xs:choice>
1179+ <xs:element name="Language" type="Language" />
1180+ </xs:choice>
1181+ </xs:complexType>
1182+ </xs:element>
1183+
1184+ <xs:element name="ReadServiceGroupsResponse">
1185+ <xs:complexType>
1186+ <xs:choice>
1187+ <xs:element name="ServiceGroup" type="ServiceGroup"
1188+ minOccurs="0" maxOccurs="unbounded" />
1189+ <xs:element name="Errors" type="ErrorsType"
1190+ minOccurs="0" />
1191+ </xs:choice>
1192+ </xs:complexType>
1193+ </xs:element>
1194+
1195+ <!-- FAfo-10.1 FTA Page 65 Lese BL einer FRLZ -->
1196+ <xs:element name="ReadAllowedServicesByFrankingLicense">
1197+ <xs:complexType>
1198+ <xs:sequence>
1199+ <xs:element name="FrankingLicense" type="FrankingLicenseType"
1200+ minOccurs="1" />
1201+ <xs:element name="Language" type="Language" />
1202+ </xs:sequence>
1203+ </xs:complexType>
1204+ </xs:element>
1205+
1206+ <!-- FAfo-10.1 FTA Page 65 Lese BL einer FRLZ -->
1207+ <xs:element name="ReadAllowedServicesByFrankingLicenseResponse">
1208+ <xs:complexType>
1209+ <xs:choice>
1210+ <!-- DLGs -->
1211+ <xs:element name="ServiceGroups" type="ReadAllowedServicesServiceGroups"
1212+ minOccurs="0" maxOccurs="unbounded" />
1213+ <xs:element name="Errors" type="ErrorsType"
1214+ minOccurs="0" />
1215+ </xs:choice>
1216+ </xs:complexType>
1217+ </xs:element>
1218+
1219+ <xs:complexType name="ReadAllowedServicesServiceGroups">
1220+ <xs:sequence>
1221+ <xs:element name="ServiceGroup" type="ServiceGroup" />
1222+ <xs:element name="BasicService" type="BasicService"
1223+ maxOccurs="unbounded" />
1224+ </xs:sequence>
1225+ </xs:complexType>
1226+
1227+ <!-- 5.7 Use Case Lese Basisleistungen -->
1228+ <xs:element name="ReadBasicServices">
1229+ <xs:complexType>
1230+ <xs:sequence>
1231+ <xs:element name="Language" type="Language" />
1232+ <xs:element name="ServiceGroupID" type="xs:int" />
1233+ </xs:sequence>
1234+ </xs:complexType>
1235+ </xs:element>
1236+
1237+ <xs:element name="ReadBasicServicesResponse">
1238+ <xs:complexType>
1239+ <xs:choice>
1240+ <xs:element name="BasicService" type="BasicService"
1241+ minOccurs="0" maxOccurs="unbounded" />
1242+ <xs:element name="Errors" type="ErrorsType"
1243+ minOccurs="0" />
1244+ </xs:choice>
1245+ </xs:complexType>
1246+ </xs:element>
1247+
1248+ <!-- 5.8 Use Case Lese Zusatzleistungen -->
1249+ <xs:element name="ReadAdditionalServices">
1250+ <xs:complexType>
1251+ <xs:sequence>
1252+ <xs:element name="Language" type="Language" />
1253+ <xs:element name="PRZL" type="PRZLType" maxOccurs="unbounded" />
1254+ </xs:sequence>
1255+ </xs:complexType>
1256+ </xs:element>
1257+
1258+ <xs:element name="ReadAdditionalServicesResponse">
1259+ <xs:complexType>
1260+ <xs:choice>
1261+ <xs:element name="AdditionalService" type="ServiceCode"
1262+ minOccurs="0" maxOccurs="unbounded" />
1263+ <xs:element name="Errors" type="ErrorsType"
1264+ minOccurs="0" />
1265+ </xs:choice>
1266+ </xs:complexType>
1267+ </xs:element>
1268+
1269+ <!-- 5.9 Use Case Lese Zustellanweisungen -->
1270+ <xs:element name="ReadDeliveryInstructions">
1271+ <xs:complexType>
1272+ <xs:sequence>
1273+ <xs:element name="Language" type="Language" />
1274+ <xs:element name="PRZL" type="PRZLType" maxOccurs="unbounded" />
1275+ </xs:sequence>
1276+ </xs:complexType>
1277+ </xs:element>
1278+
1279+ <xs:element name="ReadDeliveryInstructionsResponse">
1280+ <xs:complexType>
1281+ <xs:choice>
1282+ <xs:element name="DeliveryInstructions" type="ServiceCode"
1283+ minOccurs="0" maxOccurs="unbounded" />
1284+ <xs:element name="Errors" type="ErrorsType"
1285+ minOccurs="0" />
1286+ </xs:choice>
1287+ </xs:complexType>
1288+ </xs:element>
1289+
1290+ <!-- 5.10 Use Case Lese Darstellungsarten -->
1291+ <xs:element name="ReadLabelLayouts">
1292+ <xs:complexType>
1293+ <xs:sequence>
1294+ <xs:element name="Language" type="Language" />
1295+ <xs:element name="PRZL" type="PRZLType" maxOccurs="unbounded" />
1296+ </xs:sequence>
1297+ </xs:complexType>
1298+ </xs:element>
1299+
1300+ <xs:element name="ReadLabelLayoutsResponse">
1301+ <xs:complexType>
1302+ <xs:choice>
1303+ <xs:element name="LabelLayout" type="LabelLayoutResponse"
1304+ minOccurs="0" maxOccurs="unbounded" />
1305+ <xs:element name="Errors" type="ErrorsType"
1306+ minOccurs="0" />
1307+ </xs:choice>
1308+ </xs:complexType>
1309+ </xs:element>
1310+
1311+ <xs:complexType name="LabelLayoutResponse">
1312+ <xs:sequence>
1313+ <xs:element name="LabelLayout" type="LabelLayoutType" />
1314+ <xs:element name="MaxServices" type="xs:int" />
1315+ <xs:element name="MaxDeliveryInstructions" type="xs:int" />
1316+ <xs:element name="FreeTextAllowed" type="xs:boolean" />
1317+ </xs:sequence>
1318+ </xs:complexType>
1319+
1320+ <xs:element name="GenerateBarcode">
1321+ <xs:complexType>
1322+ <xs:sequence>
1323+ <xs:element name="Language" type="Language" />
1324+ <xs:element name="BarcodeDefinition" type="BarcodeDefinition" />
1325+ </xs:sequence>
1326+ </xs:complexType>
1327+ </xs:element>
1328+
1329+ <xs:element name="GenerateBarcodeResponse">
1330+ <xs:complexType>
1331+ <xs:sequence>
1332+ <xs:element name="Data" type="BarcodeResponseData"
1333+ minOccurs="0" />
1334+ </xs:sequence>
1335+ </xs:complexType>
1336+ </xs:element>
1337+
1338+ <xs:complexType name="BarcodeResponseData">
1339+ <xs:sequence>
1340+ <xs:element name="Barcode" type="xs:base64Binary"
1341+ minOccurs="0" />
1342+ <xs:element name="DeliveryNoteRef" minOccurs="0">
1343+ <xs:annotation>
1344+ <xs:documentation>Lieferscheinnummer Barcodeliste BMZ (128-er
1345+ Klartext-Barcode)</xs:documentation>
1346+ </xs:annotation>
1347+ <xs:simpleType>
1348+ <xs:restriction base="xs:string">
1349+ <xs:maxLength value="50" />
1350+ </xs:restriction>
1351+ </xs:simpleType>
1352+ </xs:element>
1353+ <xs:element name="BarcodeDefinition" type="BarcodeDefinition" />
1354+ <xs:element name="ColorPrintRequired" type="xs:boolean" />
1355+ <xs:element name="Errors" type="ErrorsType" minOccurs="0" />
1356+ <xs:element name="Warnings" type="WarningsType"
1357+ minOccurs="0" />
1358+ </xs:sequence>
1359+ </xs:complexType>
1360+
1361+ <xs:complexType name="BarcodeDefinition">
1362+ <xs:annotation>
1363+ <xs:documentation>Represents a BarcodeDefinition for the
1364+ GenerateBarcode Service.</xs:documentation>
1365+ </xs:annotation>
1366+ <xs:sequence>
1367+ <xs:element name="BarcodeType" type="BarcodeType" />
1368+ <xs:element name="ImageFileType" type="ImageFileType" />
1369+ <xs:element name="ImageResolution" type="xs:int" />
1370+ </xs:sequence>
1371+ </xs:complexType>
1372+
1373+ <xs:simpleType name="BarcodeType">
1374+ <xs:annotation>
1375+ <xs:documentation>Enumeration of the different barcode types.
1376+ </xs:documentation>
1377+ </xs:annotation>
1378+ <xs:restriction base="xs:string">
1379+ <xs:enumeration value="LSO_1">
1380+ <xs:annotation>
1381+ <xs:documentation>LSO-1 barcode for delivery notes online.
1382+ </xs:documentation>
1383+ </xs:annotation>
1384+ </xs:enumeration>
1385+ <xs:enumeration value="LSO_2">
1386+ <xs:annotation>
1387+ <xs:documentation>LSO-2 barcode for delivery notes online.
1388+ </xs:documentation>
1389+ </xs:annotation>
1390+ </xs:enumeration>
1391+ <xs:enumeration value="LSO_3">
1392+ <xs:annotation>
1393+ <xs:documentation>LSO-3 barcode for delivery notes online.
1394+ </xs:documentation>
1395+ </xs:annotation>
1396+ </xs:enumeration>
1397+ </xs:restriction>
1398+ </xs:simpleType>
1399+
1400+ <!-- **************************** Gloabal used datastructures **************************** -->
1401+ <xs:complexType name="ServiceCode">
1402+ <xs:annotation>
1403+ <xs:documentation>Represents a service code.</xs:documentation>
1404+ </xs:annotation>
1405+ <xs:sequence>
1406+ <xs:element name="PRZL" type="PRZLType" />
1407+ <xs:element name="Description" type="DescriptionType" />
1408+ </xs:sequence>
1409+ </xs:complexType>
1410+
1411+ <xs:complexType name="BasicService">
1412+ <xs:annotation>
1413+ <xs:documentation>Represents a Basic Service.</xs:documentation>
1414+ </xs:annotation>
1415+ <xs:sequence>
1416+ <xs:element name="PRZL" type="PRZLType" minOccurs="0"
1417+ maxOccurs="unbounded" />
1418+ <xs:element name="Description" type="DescriptionType" />
1419+ </xs:sequence>
1420+ </xs:complexType>
1421+
1422+ <xs:complexType name="ServiceGroup">
1423+ <xs:annotation>
1424+ <xs:documentation>Represents a Service Group.</xs:documentation>
1425+ </xs:annotation>
1426+ <xs:sequence>
1427+ <xs:element name="ServiceGroupID" type="xs:int" />
1428+ <xs:element name="Description" type="DescriptionType" />
1429+ </xs:sequence>
1430+ </xs:complexType>
1431+
1432+ <xs:simpleType name="DescriptionType">
1433+ <xs:annotation>
1434+ <xs:documentation>A common type for descriptions.
1435+ </xs:documentation>
1436+ </xs:annotation>
1437+ <xs:restriction base="xs:string"> <!-- only used as response type -->
1438+ <xs:maxLength value="255" />
1439+ </xs:restriction>
1440+ </xs:simpleType>
1441+
1442+ <xs:complexType name="LabelDefinition">
1443+ <xs:sequence>
1444+ <xs:element name="LabelLayout" type="LabelLayoutType" />
1445+ </xs:sequence>
1446+ </xs:complexType>
1447+
1448+ <xs:complexType name="ResponseItem">
1449+ <xs:sequence>
1450+ <xs:element name="ItemID" type="ItemIDType" minOccurs="0" />
1451+ <xs:element name="Errors" type="ErrorsType" minOccurs="0" />
1452+ <xs:element name="Warnings" type="WarningsType"
1453+ minOccurs="0" />
1454+ </xs:sequence>
1455+ </xs:complexType>
1456+
1457+ <xs:complexType name="ErrorsType">
1458+ <xs:annotation>
1459+ <xs:documentation>Structure containing a list of occurred business
1460+ errors.</xs:documentation>
1461+ </xs:annotation>
1462+ <xs:sequence>
1463+ <xs:element name="Error" type="MessageType" maxOccurs="unbounded" />
1464+ </xs:sequence>
1465+ </xs:complexType>
1466+
1467+ <xs:complexType name="WarningsType">
1468+ <xs:annotation>
1469+ <xs:documentation>Structure containing a list of occurred business
1470+ warnings.</xs:documentation>
1471+ </xs:annotation>
1472+ <xs:sequence>
1473+ <xs:element name="Warning" type="MessageType"
1474+ maxOccurs="unbounded" />
1475+ </xs:sequence>
1476+ </xs:complexType>
1477+
1478+ <xs:complexType name="MessageType">
1479+ <xs:annotation>
1480+ <xs:documentation>Represents a business error or warning. Does not
1481+ include technical errors, those are
1482+ handled by SOAP faults.
1483+ </xs:documentation>
1484+ </xs:annotation>
1485+ <xs:sequence>
1486+ <xs:element name="Code" type="MessageCodeType" />
1487+ <xs:element name="Message" type="MessageTextType" />
1488+ </xs:sequence>
1489+ </xs:complexType>
1490+
1491+ <xs:simpleType name="MessageCodeType">
1492+ <xs:annotation>
1493+ <xs:documentation>Five digit error/warning code. Error codes
1494+ starts with a "E" and warning codes
1495+ with a "W".
1496+ </xs:documentation>
1497+ </xs:annotation>
1498+ <xs:restriction base="xs:string">
1499+ <xs:pattern value="[W,E]{1}[0-9]{4}" />
1500+ </xs:restriction>
1501+ </xs:simpleType>
1502+
1503+ <xs:simpleType name="MessageTextType">
1504+ <xs:annotation>
1505+ <xs:documentation>Descriptive text in user's language for the
1506+ occurred business warning/error.
1507+ </xs:documentation>
1508+ </xs:annotation>
1509+ <!-- only used as response type -->
1510+ <xs:restriction base="xs:string">
1511+ <xs:maxLength value="500" />
1512+ </xs:restriction>
1513+ </xs:simpleType>
1514+
1515+ <xs:simpleType name="Language">
1516+ <xs:annotation>
1517+ <xs:documentation>Represents the end-users language. The service
1518+ returns all localized texts including
1519+ error-messages in the selected language.
1520+ </xs:documentation>
1521+ </xs:annotation>
1522+ <xs:restriction base="xs:string">
1523+ <xs:enumeration value="de">
1524+ <xs:annotation>
1525+ <xs:documentation>German</xs:documentation>
1526+ </xs:annotation>
1527+ </xs:enumeration>
1528+ <xs:enumeration value="fr">
1529+ <xs:annotation>
1530+ <xs:documentation>French</xs:documentation>
1531+ </xs:annotation>
1532+ </xs:enumeration>
1533+ <xs:enumeration value="it">
1534+ <xs:annotation>
1535+ <xs:documentation>Italien</xs:documentation>
1536+ </xs:annotation>
1537+ </xs:enumeration>
1538+ <xs:enumeration value="en">
1539+ <xs:annotation>
1540+ <xs:documentation>English</xs:documentation>
1541+ </xs:annotation>
1542+ </xs:enumeration>
1543+ </xs:restriction>
1544+ </xs:simpleType>
1545+
1546+ <xs:simpleType name="ItemIDType">
1547+ <xs:annotation>
1548+ <xs:documentation>Unique identifier for a specific item defined by
1549+ the consumer.</xs:documentation>
1550+ </xs:annotation>
1551+ <xs:restriction base="CommonPatternStringType">
1552+ <xs:maxLength value="200" />
1553+ </xs:restriction>
1554+ </xs:simpleType>
1555+
1556+ <xs:simpleType name="PRZLType">
1557+ <xs:annotation>
1558+ <xs:documentation>Identifies a PRZL.</xs:documentation>
1559+ </xs:annotation>
1560+ <xs:restriction base="xs:string">
1561+ <xs:pattern value="[a-zA-Z,0-9]{1,7}" />
1562+ </xs:restriction>
1563+ </xs:simpleType>
1564+
1565+ <xs:simpleType name="PhoneNumberType">
1566+ <xs:annotation>
1567+ <xs:documentation>Defines a valid phone number.</xs:documentation>
1568+ </xs:annotation>
1569+ <xs:restriction base="CommonPatternStringType">
1570+ <xs:maxLength value="20" />
1571+ <xs:minLength value="9" />
1572+ </xs:restriction>
1573+ </xs:simpleType>
1574+
1575+ <xs:simpleType name="CountryType">
1576+ <xs:annotation>
1577+ <xs:documentation>The ISO country code.</xs:documentation>
1578+ </xs:annotation>
1579+ <xs:restriction base="xs:string">
1580+ <xs:pattern value="[a-zA-Z]{2}" />
1581+ </xs:restriction>
1582+ </xs:simpleType>
1583+
1584+ <xs:simpleType name="AmountType">
1585+ <xs:annotation>
1586+ <xs:documentation>The amount for COD.</xs:documentation>
1587+ </xs:annotation>
1588+ <xs:restriction base="xs:float">
1589+ <xs:minInclusive value="0.00" />
1590+ <xs:maxInclusive value="99999.99" />
1591+ </xs:restriction>
1592+ </xs:simpleType>
1593+
1594+ <xs:simpleType name="EMailAddressType">
1595+ <xs:annotation>
1596+ <xs:documentation>The email address.</xs:documentation>
1597+ </xs:annotation>
1598+ <xs:restriction base="CommonPatternStringType">
1599+ <xs:maxLength value="160" />
1600+ </xs:restriction>
1601+ </xs:simpleType>
1602+
1603+ <xs:simpleType name="LabelLayoutType">
1604+ <xs:annotation>
1605+ <xs:documentation>Defines valid layouts.</xs:documentation>
1606+ </xs:annotation>
1607+ <xs:restriction base="xs:string">
1608+ <xs:pattern value="[a-zA-Z,0-9]{2}" />
1609+ </xs:restriction>
1610+ </xs:simpleType>
1611+
1612+ <xs:simpleType name="ImageFileType">
1613+ <xs:annotation>
1614+ <xs:documentation>Defines valid formats of images.
1615+ </xs:documentation>
1616+ </xs:annotation>
1617+ <xs:restriction base="xs:string">
1618+ <xs:pattern value="[a-zA-Z,0-9]{1,5}" />
1619+ </xs:restriction>
1620+ </xs:simpleType>
1621+
1622+ <xs:simpleType name="FrankingLicenseType">
1623+ <xs:annotation>
1624+ <xs:documentation>Defines a franking license.</xs:documentation>
1625+ </xs:annotation>
1626+ <xs:restriction base="xs:string">
1627+ <xs:pattern value="[a-zA-Z,0-9]{4}" />
1628+ <xs:pattern value="[0-9]{6}" />
1629+ <xs:pattern value="[0-9]{8}" />
1630+ </xs:restriction>
1631+ </xs:simpleType>
1632+
1633+ <xs:simpleType name="CustomerSystemType">
1634+ <xs:restriction base="CommonPatternStringType">
1635+ <xs:pattern value="[a-zA-Z,0-9,\s]{1,255}" />
1636+ </xs:restriction>
1637+ </xs:simpleType>
1638+
1639+ <xs:simpleType name="IdentCodeType">
1640+ <xs:annotation>
1641+ <xs:documentation>IdentCode is only a valid input for
1642+ Post-internal applications. For Post-external
1643+ applications the IdentCode must not be set.
1644+ </xs:documentation>
1645+ </xs:annotation>
1646+ <xs:restriction base="CommonPatternStringType">
1647+ <xs:pattern value="[0-9]{18}" />
1648+ <xs:pattern value="[0-9]{23}" />
1649+ <xs:pattern value="[a-zA-Z,0-9]{13}" />
1650+ </xs:restriction>
1651+ </xs:simpleType>
1652+
1653+ <xs:simpleType name="CommonPatternStringType">
1654+ <xs:annotation>
1655+ <xs:documentation>Excludes unsupported characters.
1656+ </xs:documentation>
1657+ </xs:annotation>
1658+ <xs:restriction base="xs:string">
1659+ <xs:pattern value="([^\*|\\|\{|\}|\[|\]|=|&gt;|&lt;])*" />
1660+ </xs:restriction>
1661+ </xs:simpleType>
1662+
1663+
1664+</xs:schema>
1665\ No newline at end of file
1666
1667=== added file 'delivery_carrier_label_postlogistics/data/post-barcode-handbuch.pdf'
1668Binary files delivery_carrier_label_postlogistics/data/post-barcode-handbuch.pdf 1970-01-01 00:00:00 +0000 and delivery_carrier_label_postlogistics/data/post-barcode-handbuch.pdf 2014-01-13 11:23:36 +0000 differ
1669=== added file 'delivery_carrier_label_postlogistics/delivery.py'
1670--- delivery_carrier_label_postlogistics/delivery.py 1970-01-01 00:00:00 +0000
1671+++ delivery_carrier_label_postlogistics/delivery.py 2014-01-13 11:23:36 +0000
1672@@ -0,0 +1,214 @@
1673+# -*- coding: utf-8 -*-
1674+##############################################################################
1675+#
1676+# Author: Yannick Vaucher
1677+# Copyright 2013 Camptocamp SA
1678+#
1679+# This program is free software: you can redistribute it and/or modify
1680+# it under the terms of the GNU Affero General Public License as
1681+# published by the Free Software Foundation, either version 3 of the
1682+# License, or (at your option) any later version.
1683+#
1684+# This program is distributed in the hope that it will be useful,
1685+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1686+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1687+# GNU Affero General Public License for more details.
1688+#
1689+# You should have received a copy of the GNU Affero General Public License
1690+# along with this program. If not, see <http://www.gnu.org/licenses/>.
1691+#
1692+##############################################################################
1693+from openerp.osv import orm, fields
1694+
1695+
1696+class PostlogisticsServiceGroup(orm.Model):
1697+ _name = 'postlogistics.service.group'
1698+ _description = 'PostLogistics Service Group'
1699+
1700+ _columns = {
1701+ 'name': fields.char('Description', translate=True, required=True),
1702+ 'group_extid': fields.integer('Group ID', required=True),
1703+ }
1704+
1705+ _sql_constraints = [
1706+ ('group_extid_uniq', 'unique(group_extid)',
1707+ "A service group ID must be unique.")
1708+ ]
1709+
1710+
1711+POSTLOGISTIC_TYPES = [
1712+ ('label_layout', 'Label Layout'),
1713+ ('output_format', 'Output Format'),
1714+ ('resolution', 'Output Resolution'),
1715+ ('basic', 'Basic Service'),
1716+ ('additional', 'Additional Service'),
1717+ ('delivery', 'Delivery Instructions')
1718+]
1719+
1720+
1721+class DeliveryCarrierTemplateOption(orm.Model):
1722+ """ Set name translatable and add service group """
1723+ _inherit = 'delivery.carrier.template.option'
1724+
1725+ _columns = {
1726+ 'name': fields.char('Name', size=64, translate=True),
1727+ 'postlogistics_service_group_id': fields.many2one(
1728+ 'postlogistics.service.group',
1729+ string='PostLogistics Service Group'),
1730+ 'postlogistics_type': fields.selection(
1731+ POSTLOGISTIC_TYPES,
1732+ string="PostLogistics option type"),
1733+ # relation tables to manage compatiblity between basic services
1734+ # and other services
1735+ 'postlogistics_basic_service_ids': fields.many2many(
1736+ 'delivery.carrier.template.option',
1737+ 'postlogistics_compatibility_service_rel',
1738+ 'service_id', 'basic_service_id',
1739+ string="Basic Services",
1740+ domain=[('postlogistics_type', '=', 'basic')],
1741+ help="List of basic service for which this service is compatible"),
1742+ 'postlogistics_additonial_service_ids': fields.many2many(
1743+ 'delivery.carrier.template.option',
1744+ 'postlogistics_compatibility_service_rel',
1745+ 'basic_service_id', 'service_id',
1746+ string="Compatible Additional Services",
1747+ domain=[('postlogistics_type', '=', 'additional')]),
1748+ 'postlogistics_delivery_instruction_ids': fields.many2many(
1749+ 'delivery.carrier.template.option',
1750+ 'postlogistics_compatibility_service_rel',
1751+ 'basic_service_id', 'service_id',
1752+ string="Compatible Delivery Instructions",
1753+ domain=[('postlogistics_type', '=', 'delivery')]),
1754+ }
1755+
1756+ _defaults = {
1757+ 'postlogistics_type': False,
1758+ }
1759+
1760+
1761+class DeliveryCarrierOption(orm.Model):
1762+ """ Set name translatable and add service group """
1763+ _inherit = 'delivery.carrier.option'
1764+
1765+ _columns = {
1766+ 'name': fields.char('Name', size=64, translate=True),
1767+ # to repeat carrier allowed option ids to filter domain set by
1768+ # default from view
1769+ 'allowed_option_ids': fields.related(
1770+ 'carrier_id', 'allowed_option_ids', type='many2many',
1771+ relation='delivery.carrier.template.option',
1772+ string='Allowed and compatible options',
1773+ readonly=True),
1774+ }
1775+
1776+
1777+class DeliveryCarrier(orm.Model):
1778+ """ Add service group """
1779+ _inherit = 'delivery.carrier'
1780+
1781+ def _get_carrier_type_selection(self, cr, uid, context=None):
1782+ """ Add postlogistics carrier type """
1783+ res = super(DeliveryCarrier, self)._get_carrier_type_selection(cr, uid, context=context)
1784+ res.append(('postlogistics', 'Postlogistics'))
1785+ return res
1786+
1787+ def _get_basic_service_ids(self, cr, uid, ids, field_names, arg, context=None):
1788+ """ Search in all options for the PostLogistics basic services if set """
1789+ res = {}
1790+ for carrier_id in ids:
1791+ res[carrier_id] = []
1792+ ir_model_data_obj = self.pool.get('ir.model.data')
1793+
1794+ xmlid = 'delivery_carrier_label_postlogistics', 'postlogistics'
1795+ postlogistics_partner = ir_model_data_obj.get_object(
1796+ cr, uid, *xmlid, context=context)
1797+
1798+ for carrier in self.browse(cr, uid, ids, context=context):
1799+ if not carrier.partner_id.id == postlogistics_partner.id:
1800+ continue
1801+
1802+ option_ids = [opt.tmpl_option_id.id for opt
1803+ in carrier.available_option_ids
1804+ if opt.postlogistics_type == 'basic']
1805+ if not option_ids:
1806+ continue
1807+ res[carrier.id] = option_ids
1808+ return res
1809+
1810+ def _get_allowed_option_ids(self, cr, uid, ids, field_names, arg, context=None):
1811+ """ Return a list of possible options
1812+
1813+ A domain would be too complicated.
1814+
1815+ We do this to ensure the user first select a basic service. And
1816+ then he adds additional services.
1817+
1818+ :return: {carrier_id: [ids]}
1819+
1820+ """
1821+ res = dict.fromkeys(ids, [])
1822+ option_template_obj = self.pool.get('delivery.carrier.template.option')
1823+ ir_model_data_obj = self.pool.get('ir.model.data')
1824+
1825+ xmlid = 'delivery_carrier_label_postlogistics', 'postlogistics'
1826+ postlogistics_partner = ir_model_data_obj.get_object(
1827+ cr, uid, *xmlid, context=context)
1828+
1829+ for carrier in self.browse(cr, uid, ids, context=context):
1830+ allowed_ids = []
1831+ if not carrier.partner_id.id == postlogistics_partner.id:
1832+ continue
1833+ service_group_id = carrier.postlogistics_service_group_id.id
1834+ if service_group_id:
1835+ basic_service_ids = [s.id for s in carrier.postlogistics_basic_service_ids]
1836+ service_ids = option_template_obj.search(
1837+ cr, uid,
1838+ [('postlogistics_service_group_id' ,'=', service_group_id)],
1839+ context=context)
1840+ allowed_ids.extend(service_ids)
1841+ if basic_service_ids:
1842+ related_service_ids = option_template_obj.search(
1843+ cr, uid,
1844+ [('postlogistics_basic_service_ids' ,'in', basic_service_ids)],
1845+ context=context)
1846+ allowed_ids.extend(related_service_ids)
1847+
1848+ # Allows to set multiple optional single option in order to
1849+ # let the user select them
1850+ single_option_types = ['label_layout', 'output_format', 'resolution']
1851+ selected_single_options = [opt.tmpl_option_id.postlogistics_type
1852+ for opt in carrier.available_option_ids
1853+ if opt.postlogistics_type in single_option_types
1854+ and opt.state in ['mandatory']]
1855+ if selected_single_options != single_option_types:
1856+ service_ids = option_template_obj.search(
1857+ cr, uid,
1858+ [('postlogistics_type', 'in', single_option_types),
1859+ ('postlogistics_type', 'not in', selected_single_options)],
1860+ context=context)
1861+ allowed_ids.extend(service_ids)
1862+ res[carrier.id] = allowed_ids
1863+ return res
1864+
1865+ _columns = {
1866+ 'type': fields.selection(
1867+ _get_carrier_type_selection, 'Type',
1868+ help="Carrier type (combines several delivery methods)"),
1869+ 'postlogistics_service_group_id': fields.many2one(
1870+ 'postlogistics.service.group',
1871+ string='PostLogistics Service Group',
1872+ help="Service group defines the available options for "
1873+ "this delivery method."),
1874+ 'postlogistics_basic_service_ids': fields.function(
1875+ _get_basic_service_ids, type='one2many',
1876+ relation='delivery.carrier.template.option',
1877+ string='PostLogistics Service Group',
1878+ help="Basic Service defines the available "
1879+ "additional options for this delivery method",
1880+ readonly=True),
1881+ 'allowed_option_ids': fields.function(
1882+ _get_allowed_option_ids, type="many2many",
1883+ relation='delivery.carrier.template.option',
1884+ string='Allowed options',
1885+ help="Compute allowed options according to selected options."),
1886+ }
1887
1888=== added file 'delivery_carrier_label_postlogistics/delivery_data.xml'
1889--- delivery_carrier_label_postlogistics/delivery_data.xml 1970-01-01 00:00:00 +0000
1890+++ delivery_carrier_label_postlogistics/delivery_data.xml 2014-01-13 11:23:36 +0000
1891@@ -0,0 +1,108 @@
1892+<?xml version="1.0" encoding="utf-8"?>
1893+<openerp>
1894+ <data noupdate="1">
1895+
1896+ <!-- Label layouts -->
1897+ <record id="postlogistics_layout_option_a7" model="delivery.carrier.template.option">
1898+ <field name="name">Format A7</field>
1899+ <field name="code">A7</field>
1900+ <field name="postlogistics_type">label_layout</field>
1901+ <field name="partner_id" ref="postlogistics"></field>
1902+ </record>
1903+
1904+ <record id="postlogistics_layout_option_a6" model="delivery.carrier.template.option">
1905+ <field name="name">Format A6</field>
1906+ <field name="code">A6</field>
1907+ <field name="postlogistics_type">label_layout</field>
1908+ <field name="partner_id" ref="postlogistics"></field>
1909+ </record>
1910+
1911+ <record id="postlogistics_layout_option_a5" model="delivery.carrier.template.option">
1912+ <field name="name">Format A5</field>
1913+ <field name="code">A5</field>
1914+ <field name="postlogistics_type">label_layout</field>
1915+ <field name="partner_id" ref="postlogistics"></field>
1916+ </record>
1917+
1918+ <record id="postlogistics_layout_option_fe" model="delivery.carrier.template.option">
1919+ <field name="name">Format FE</field>
1920+ <field name="code">FE</field>
1921+ <field name="postlogistics_type">label_layout</field>
1922+ <field name="partner_id" ref="postlogistics"></field>
1923+ </record>
1924+
1925+
1926+ <!-- Output formats -->
1927+ <record id="postlogistics_output_format_option_eps" model="delivery.carrier.template.option">
1928+ <field name="name">EPS</field>
1929+ <field name="code">EPS</field>
1930+ <field name="postlogistics_type">output_format</field>
1931+ <field name="partner_id" ref="postlogistics"></field>
1932+ </record>
1933+
1934+ <record id="postlogistics_output_format_option_gif" model="delivery.carrier.template.option">
1935+ <field name="name">GIF</field>
1936+ <field name="code">GIF</field>
1937+ <field name="postlogistics_type">output_format</field>
1938+ <field name="partner_id" ref="postlogistics"></field>
1939+ </record>
1940+
1941+ <record id="postlogistics_output_format_option_jpg" model="delivery.carrier.template.option">
1942+ <field name="name">JPG</field>
1943+ <field name="code">JPG</field>
1944+ <field name="postlogistics_type">output_format</field>
1945+ <field name="partner_id" ref="postlogistics"></field>
1946+ </record>
1947+
1948+ <record id="postlogistics_output_format_option_png" model="delivery.carrier.template.option">
1949+ <field name="name">PNG</field>
1950+ <field name="code">PNG</field>
1951+ <field name="postlogistics_type">output_format</field>
1952+ <field name="partner_id" ref="postlogistics"></field>
1953+ </record>
1954+
1955+ <record id="postlogistics_output_format_option_pdf" model="delivery.carrier.template.option">
1956+ <field name="name">PDF</field>
1957+ <field name="code">PDF</field>
1958+ <field name="postlogistics_type">output_format</field>
1959+ <field name="partner_id" ref="postlogistics"></field>
1960+ </record>
1961+
1962+ <record id="postlogistics_output_format_option_spdf" model="delivery.carrier.template.option">
1963+ <field name="name">sPDF</field>
1964+ <field name="code">sPDF</field>
1965+ <field name="postlogistics_type">output_format</field>
1966+ <field name="partner_id" ref="postlogistics"></field>
1967+ </record>
1968+
1969+ <record id="postlogistics_output_format_option_zpl2" model="delivery.carrier.template.option">
1970+ <field name="name">ZPL2</field>
1971+ <field name="code">ZPL2</field>
1972+ <field name="postlogistics_type">output_format</field>
1973+ <field name="partner_id" ref="postlogistics"></field>
1974+ </record>
1975+
1976+
1977+ <!-- resolutions -->
1978+ <record id="postlogistics_output_resolution_option_200ppp" model="delivery.carrier.template.option">
1979+ <field name="name">200 ppp</field>
1980+ <field name="code">200</field>
1981+ <field name="postlogistics_type">resolution</field>
1982+ <field name="partner_id" ref="postlogistics"></field>
1983+ </record>
1984+
1985+ <record id="postlogistics_output_resolution_option_300ppp" model="delivery.carrier.template.option">
1986+ <field name="name">300 ppp</field>
1987+ <field name="code">300</field>
1988+ <field name="postlogistics_type">resolution</field>
1989+ <field name="partner_id" ref="postlogistics"></field>
1990+ </record>
1991+
1992+ <record id="postlogistics_output_resolution_option_600ppp" model="delivery.carrier.template.option">
1993+ <field name="name">600 ppp</field>
1994+ <field name="code">600</field>
1995+ <field name="postlogistics_type">resolution</field>
1996+ <field name="partner_id" ref="postlogistics"></field>
1997+ </record>
1998+ </data>
1999+</openerp>
2000
2001=== added file 'delivery_carrier_label_postlogistics/delivery_view.xml'
2002--- delivery_carrier_label_postlogistics/delivery_view.xml 1970-01-01 00:00:00 +0000
2003+++ delivery_carrier_label_postlogistics/delivery_view.xml 2014-01-13 11:23:36 +0000
2004@@ -0,0 +1,61 @@
2005+<?xml version="1.0" encoding="UTF-8"?>
2006+<openerp>
2007+ <data>
2008+
2009+ <!-- INHERITED VIEW FOR THE OBJECT : delivery_carrier_template_option -->
2010+ <record id="delivery_carrier_template_option_view_form" model="ir.ui.view">
2011+ <field name="name">delivery_base.delivery_carrier_option.view_form</field>
2012+ <field name="model">delivery.carrier.template.option</field>
2013+ <field name="inherit_id" ref="base_delivery_carrier_label.delivery_carrier_template_option_view_form"/>
2014+ <field name="arch" type="xml">
2015+ <field name="name" position="after">
2016+ <field name="postlogistics_service_group_id"/>
2017+ </field>
2018+ </field>
2019+ </record>
2020+
2021+ <record id="delivery_carrier_template_option_view_tree" model="ir.ui.view">
2022+ <field name="name">delivery_base.delivery_carrier_template_option.view_tree</field>
2023+ <field name="model">delivery.carrier.template.option</field>
2024+ <field name="inherit_id" ref="base_delivery_carrier_label.delivery_carrier_template_option_view_tree"/>
2025+ <field name="arch" type="xml">
2026+ <field name="name" position="after">
2027+ <field name="postlogistics_service_group_id"/>
2028+ </field>
2029+ </field>
2030+ </record>
2031+
2032+ <!-- INHERITED VIEW FOR THE OBJECT : delivery_carrier_option -->
2033+ <record id="delivery_carrier_option_view_form" model="ir.ui.view">
2034+ <field name="name">delivery_base.delivery_carrier_option.view_form</field>
2035+ <field name="model">delivery.carrier.option</field>
2036+ <field name="inherit_id" ref="base_delivery_carrier_label.delivery_carrier_option_view_form" />
2037+ <field name="arch" type="xml">
2038+ <field name="tmpl_option_id" position="before">
2039+ <field name="carrier_id" invisible="1"/>
2040+ <field name="allowed_option_ids" invisible="1"/>
2041+ </field>
2042+ <field name="tmpl_option_id" position="attributes">
2043+ <attribute name="domain">['|', ('partner_id', '!=', %(delivery_carrier_label_postlogistics.postlogistics)d), ('id', 'in', allowed_option_ids[0][2])]</attribute>
2044+ </field>
2045+ </field>
2046+ </record>
2047+
2048+ <!-- INHERITED VIEW FOR THE OBJECT : delivery.carrier -->
2049+ <record id="view_delivery_carrier_form" model="ir.ui.view">
2050+ <field name="name">delivery_base.delivery.carrier.view_form</field>
2051+ <field name="model">delivery.carrier</field>
2052+ <field name="inherit_id" ref="base_delivery_carrier_label.view_delivery_carrier_form" />
2053+ <field name="arch" type="xml">
2054+ <field name="type" position="after">
2055+ <field name="postlogistics_service_group_id" attrs="{'invisible': [('type', '!=', 'postlogistics')], 'required': [('type', '=', 'postlogistics')]}"/>
2056+ <field name="allowed_option_ids" invisible="1"/>
2057+ </field>
2058+ <field name="available_option_ids" position="attributes">
2059+ <attribute name="context">{'default_carrier_id': active_id, 'default_allowed_option_ids': allowed_option_ids}</attribute>
2060+ </field>
2061+ </field>
2062+ </record>
2063+
2064+ </data>
2065+</openerp>
2066
2067=== added directory 'delivery_carrier_label_postlogistics/i18n'
2068=== added file 'delivery_carrier_label_postlogistics/i18n/delivery_carrier_label_postlogistics.pot'
2069--- delivery_carrier_label_postlogistics/i18n/delivery_carrier_label_postlogistics.pot 1970-01-01 00:00:00 +0000
2070+++ delivery_carrier_label_postlogistics/i18n/delivery_carrier_label_postlogistics.pot 2014-01-13 11:23:36 +0000
2071@@ -0,0 +1,475 @@
2072+# Translation of OpenERP Server.
2073+# This file contains the translation of the following modules:
2074+# * delivery_carrier_label_postlogistics
2075+#
2076+msgid ""
2077+msgstr ""
2078+"Project-Id-Version: OpenERP Server 7.0\n"
2079+"Report-Msgid-Bugs-To: \n"
2080+"POT-Creation-Date: 2013-12-06 13:12+0000\n"
2081+"PO-Revision-Date: 2013-12-06 13:12+0000\n"
2082+"Last-Translator: <>\n"
2083+"Language-Team: \n"
2084+"MIME-Version: 1.0\n"
2085+"Content-Type: text/plain; charset=UTF-8\n"
2086+"Content-Transfer-Encoding: \n"
2087+"Plural-Forms: \n"
2088+
2089+#. module: delivery_carrier_label_postlogistics
2090+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_output_format_option_spdf
2091+msgid "sPDF"
2092+msgstr ""
2093+
2094+#. module: delivery_carrier_label_postlogistics
2095+#: field:delivery.carrier.template.option,postlogistics_additonial_service_ids:0
2096+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_delivery_carrier_template_option_postlogistics_additonial_service_ids
2097+msgid "Compatible Additional Services"
2098+msgstr ""
2099+
2100+#. module: delivery_carrier_label_postlogistics
2101+#: help:delivery.carrier.template.option,postlogistics_basic_service_ids:0
2102+msgid "List of basic service for which this service is compatible"
2103+msgstr ""
2104+
2105+#. module: delivery_carrier_label_postlogistics
2106+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_default_resolution
2107+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_default_resolution
2108+#: field:postlogistics.config.settings,default_resolution:0
2109+#: field:res.company,postlogistics_default_resolution:0
2110+msgid "Default resolution"
2111+msgstr ""
2112+
2113+#. module: delivery_carrier_label_postlogistics
2114+#: code:addons/delivery_carrier_label_postlogistics/res_config.py:342
2115+#, python-format
2116+msgid "Could not retrieve Postlogistics group services:\n"
2117+"%s"
2118+msgstr ""
2119+
2120+#. module: delivery_carrier_label_postlogistics
2121+#: view:postlogistics.config.settings:0
2122+msgid "Sender Informations"
2123+msgstr ""
2124+
2125+#. module: delivery_carrier_label_postlogistics
2126+#: field:delivery.carrier.template.option,postlogistics_delivery_instruction_ids:0
2127+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_delivery_carrier_template_option_postlogistics_delivery_instruction_ids
2128+msgid "Compatible Delivery Instructions"
2129+msgstr ""
2130+
2131+#. module: delivery_carrier_label_postlogistics
2132+#: model:ir.model,name:delivery_carrier_label_postlogistics.model_postlogistics_config_settings
2133+msgid "postlogistics.config.settings"
2134+msgstr ""
2135+
2136+#. module: delivery_carrier_label_postlogistics
2137+#: view:delivery.carrier.option:0
2138+msgid "['|', ('partner_id', '!=', 5), ('id', 'in', allowed_option_ids[0][2])]"
2139+msgstr ""
2140+
2141+#. module: delivery_carrier_label_postlogistics
2142+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_output_format_option_eps
2143+msgid "EPS"
2144+msgstr ""
2145+
2146+#. module: delivery_carrier_label_postlogistics
2147+#: code:addons/delivery_carrier_label_postlogistics/postlogistics/web_service.py:71
2148+#, python-format
2149+msgid "Error 401"
2150+msgstr ""
2151+
2152+#. module: delivery_carrier_label_postlogistics
2153+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_license_more_1kg
2154+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_license_more_1kg
2155+#: field:postlogistics.config.settings,license_more_1kg:0
2156+#: field:res.company,postlogistics_license_more_1kg:0
2157+msgid "License more than 1kg"
2158+msgstr ""
2159+
2160+#. module: delivery_carrier_label_postlogistics
2161+#: model:ir.model,name:delivery_carrier_label_postlogistics.model_delivery_carrier_option
2162+msgid "Delivery carrier option"
2163+msgstr ""
2164+
2165+#. module: delivery_carrier_label_postlogistics
2166+#: sql_constraint:postlogistics.service.group:0
2167+msgid "A service group ID must be unique."
2168+msgstr ""
2169+
2170+#. module: delivery_carrier_label_postlogistics
2171+#: view:postlogistics.config.settings:0
2172+msgid "Licenses"
2173+msgstr ""
2174+
2175+#. module: delivery_carrier_label_postlogistics
2176+#: field:delivery.carrier.option,allowed_option_ids:0
2177+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_delivery_carrier_option_allowed_option_ids
2178+msgid "Allowed and compatible options"
2179+msgstr ""
2180+
2181+#. module: delivery_carrier_label_postlogistics
2182+#: model:ir.model,name:delivery_carrier_label_postlogistics.model_shipping_label
2183+msgid "Shipping Label"
2184+msgstr ""
2185+
2186+#. module: delivery_carrier_label_postlogistics
2187+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_license_less_1kg
2188+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_license_less_1kg
2189+#: field:postlogistics.config.settings,license_less_1kg:0
2190+#: field:res.company,postlogistics_license_less_1kg:0
2191+msgid "License less than 1kg"
2192+msgstr ""
2193+
2194+#. module: delivery_carrier_label_postlogistics
2195+#: selection:delivery.carrier.template.option,postlogistics_type:0
2196+msgid "Delivery Instructions"
2197+msgstr ""
2198+
2199+#. module: delivery_carrier_label_postlogistics
2200+#: help:delivery.carrier,allowed_option_ids:0
2201+msgid "Compute allowed options according to selected options."
2202+msgstr ""
2203+
2204+#. module: delivery_carrier_label_postlogistics
2205+#: selection:delivery.carrier.template.option,postlogistics_type:0
2206+msgid "Label Layout"
2207+msgstr ""
2208+
2209+#. module: delivery_carrier_label_postlogistics
2210+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_layout_option_fe
2211+msgid "Format FE"
2212+msgstr ""
2213+
2214+#. module: delivery_carrier_label_postlogistics
2215+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_layout_option_a5
2216+msgid "Format A5"
2217+msgstr ""
2218+
2219+#. module: delivery_carrier_label_postlogistics
2220+#: model:ir.actions.act_window,name:delivery_carrier_label_postlogistics.action_postlogistics_config
2221+#: view:postlogistics.config.settings:0
2222+msgid "Configure Postlogistics"
2223+msgstr ""
2224+
2225+#. module: delivery_carrier_label_postlogistics
2226+#: field:delivery.carrier,allowed_option_ids:0
2227+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_delivery_carrier_allowed_option_ids
2228+msgid "Allowed options"
2229+msgstr ""
2230+
2231+#. module: delivery_carrier_label_postlogistics
2232+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_layout_option_a7
2233+msgid "Format A7"
2234+msgstr ""
2235+
2236+#. module: delivery_carrier_label_postlogistics
2237+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_layout_option_a6
2238+msgid "Format A6"
2239+msgstr ""
2240+
2241+#. module: delivery_carrier_label_postlogistics
2242+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_company_id
2243+#: field:postlogistics.config.settings,company_id:0
2244+msgid "Company"
2245+msgstr ""
2246+
2247+#. module: delivery_carrier_label_postlogistics
2248+#: help:delivery.carrier,postlogistics_basic_service_id:0
2249+msgid "Basic Service defines the available additional options for this delivery method"
2250+msgstr ""
2251+
2252+#. module: delivery_carrier_label_postlogistics
2253+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_service_group_group_extid
2254+#: field:postlogistics.service.group,group_extid:0
2255+msgid "Group ID"
2256+msgstr ""
2257+
2258+#. module: delivery_carrier_label_postlogistics
2259+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_wsdl_url
2260+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_wsdl_url
2261+#: field:postlogistics.config.settings,wsdl_url:0
2262+#: field:res.company,postlogistics_wsdl_url:0
2263+msgid "WSDL URL"
2264+msgstr ""
2265+
2266+#. module: delivery_carrier_label_postlogistics
2267+#: code:addons/delivery_carrier_label_postlogistics/res_config.py:147
2268+#, python-format
2269+msgid "Could not retrieve Postlogistics deliveryinstructions:\n"
2270+"%s"
2271+msgstr ""
2272+
2273+#. module: delivery_carrier_label_postlogistics
2274+#: field:delivery.carrier,postlogistics_basic_service_id:0
2275+#: field:delivery.carrier,postlogistics_service_group_id:0
2276+#: field:delivery.carrier.template.option,postlogistics_service_group_id:0
2277+#: model:ir.model,name:delivery_carrier_label_postlogistics.model_postlogistics_service_group
2278+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_delivery_carrier_postlogistics_basic_service_id
2279+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_delivery_carrier_postlogistics_service_group_id
2280+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_delivery_carrier_template_option_postlogistics_service_group_id
2281+msgid "PostLogistics Service Group"
2282+msgstr ""
2283+
2284+#. module: delivery_carrier_label_postlogistics
2285+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_output_resolution_option_600ppp
2286+msgid "600 ppp"
2287+msgstr ""
2288+
2289+#. module: delivery_carrier_label_postlogistics
2290+#: code:addons/delivery_carrier_label_postlogistics/postlogistics/web_service.py:72
2291+#, python-format
2292+msgid "Authorization Required\n"
2293+"\n"
2294+"Please verify postlogistics username and password in:\n"
2295+"Configuration -> Postlogistics"
2296+msgstr ""
2297+
2298+#. module: delivery_carrier_label_postlogistics
2299+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_output_format_option_zpl2
2300+msgid "ZPL2"
2301+msgstr ""
2302+
2303+#. module: delivery_carrier_label_postlogistics
2304+#: selection:delivery.carrier.template.option,postlogistics_type:0
2305+msgid "Output Resolution"
2306+msgstr ""
2307+
2308+#. module: delivery_carrier_label_postlogistics
2309+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_default_label_layout
2310+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_default_label_layout
2311+#: field:postlogistics.config.settings,default_label_layout:0
2312+#: field:res.company,postlogistics_default_label_layout:0
2313+msgid "Default label layout"
2314+msgstr ""
2315+
2316+#. module: delivery_carrier_label_postlogistics
2317+#: help:postlogistics.config.settings,office:0
2318+msgid "Post office which will receive the shipped goods"
2319+msgstr ""
2320+
2321+#. module: delivery_carrier_label_postlogistics
2322+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_password
2323+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_password
2324+#: field:postlogistics.config.settings,password:0
2325+#: field:res.company,postlogistics_password:0
2326+msgid "Password"
2327+msgstr ""
2328+
2329+#. module: delivery_carrier_label_postlogistics
2330+#: view:postlogistics.config.settings:0
2331+msgid "Update PostLogistics Services"
2332+msgstr ""
2333+
2334+#. module: delivery_carrier_label_postlogistics
2335+#: view:delivery.carrier:0
2336+msgid "{'default_carrier_id': active_id, 'default_allowed_option_ids': allowed_option_ids}"
2337+msgstr ""
2338+
2339+#. module: delivery_carrier_label_postlogistics
2340+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_username
2341+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_username
2342+#: field:postlogistics.config.settings,username:0
2343+#: field:res.company,postlogistics_username:0
2344+msgid "Username"
2345+msgstr ""
2346+
2347+#. module: delivery_carrier_label_postlogistics
2348+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_logo
2349+#: field:res.company,postlogistics_logo:0
2350+msgid "Company logo for PostLogistics"
2351+msgstr ""
2352+
2353+#. module: delivery_carrier_label_postlogistics
2354+#: field:delivery.carrier.template.option,postlogistics_type:0
2355+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_delivery_carrier_template_option_postlogistics_type
2356+msgid "PostLogistics option type"
2357+msgstr ""
2358+
2359+#. module: delivery_carrier_label_postlogistics
2360+#: field:delivery.carrier.option,name:0
2361+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_delivery_carrier_option_name
2362+msgid "Name"
2363+msgstr ""
2364+
2365+#. module: delivery_carrier_label_postlogistics
2366+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_license_vinolog
2367+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_license_vinolog
2368+#: field:postlogistics.config.settings,license_vinolog:0
2369+#: field:res.company,postlogistics_license_vinolog:0
2370+msgid "License VinoLog"
2371+msgstr ""
2372+
2373+#. module: delivery_carrier_label_postlogistics
2374+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_output_resolution_option_300ppp
2375+msgid "300 ppp"
2376+msgstr ""
2377+
2378+#. module: delivery_carrier_label_postlogistics
2379+#: view:postlogistics.config.settings:0
2380+msgid "Select Company"
2381+msgstr ""
2382+
2383+#. module: delivery_carrier_label_postlogistics
2384+#: model:ir.model,name:delivery_carrier_label_postlogistics.model_res_company
2385+msgid "Companies"
2386+msgstr ""
2387+
2388+#. module: delivery_carrier_label_postlogistics
2389+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_output_format_option_pdf
2390+msgid "PDF"
2391+msgstr ""
2392+
2393+#. module: delivery_carrier_label_postlogistics
2394+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_output_format_option_gif
2395+msgid "GIF"
2396+msgstr ""
2397+
2398+#. module: delivery_carrier_label_postlogistics
2399+#: model:ir.model,name:delivery_carrier_label_postlogistics.model_delivery_carrier
2400+msgid "Carrier"
2401+msgstr ""
2402+
2403+#. module: delivery_carrier_label_postlogistics
2404+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_output_resolution_option_200ppp
2405+msgid "200 ppp"
2406+msgstr ""
2407+
2408+#. module: delivery_carrier_label_postlogistics
2409+#: view:postlogistics.config.settings:0
2410+msgid "Default configs"
2411+msgstr ""
2412+
2413+#. module: delivery_carrier_label_postlogistics
2414+#: code:addons/delivery_carrier_label_postlogistics/res_config.py:149
2415+#: code:addons/delivery_carrier_label_postlogistics/res_config.py:208
2416+#: code:addons/delivery_carrier_label_postlogistics/res_config.py:280
2417+#: code:addons/delivery_carrier_label_postlogistics/res_config.py:344
2418+#, python-format
2419+msgid "Error"
2420+msgstr ""
2421+
2422+#. module: delivery_carrier_label_postlogistics
2423+#: help:postlogistics.config.settings,logo:0
2424+msgid "Optional company logo to show on label.\n"
2425+"If using an image / logo, please note the following:\n"
2426+"– Image width: 47 mm\n"
2427+"– Image height: 25 mm\n"
2428+"– File size: max. 30 kb\n"
2429+"– File format: GIF or PNG\n"
2430+"– Colour table: indexed colours, max. 200 colours\n"
2431+"– The logo will be printed rotated counter-clockwise by 90°\n"
2432+"We recommend using a black and white logo for printing in the\n"
2433+"ZPL2 format."
2434+msgstr ""
2435+
2436+#. module: delivery_carrier_label_postlogistics
2437+#: code:addons/delivery_carrier_label_postlogistics/res_config.py:206
2438+#: code:addons/delivery_carrier_label_postlogistics/res_config.py:278
2439+#, python-format
2440+msgid "Could not retrieve Postlogistics base services:\n"
2441+"%s"
2442+msgstr ""
2443+
2444+#. module: delivery_carrier_label_postlogistics
2445+#: selection:delivery.carrier.template.option,postlogistics_type:0
2446+msgid "Additional Service"
2447+msgstr ""
2448+
2449+#. module: delivery_carrier_label_postlogistics
2450+#: help:delivery.carrier,postlogistics_service_group_id:0
2451+msgid "Service group defines the available options for this delivery method."
2452+msgstr ""
2453+
2454+#. module: delivery_carrier_label_postlogistics
2455+#: view:postlogistics.config.settings:0
2456+msgid "Web Service Authentification"
2457+msgstr ""
2458+
2459+#. module: delivery_carrier_label_postlogistics
2460+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_service_group_name
2461+#: field:postlogistics.service.group,name:0
2462+msgid "Description"
2463+msgstr ""
2464+
2465+#. module: delivery_carrier_label_postlogistics
2466+#: selection:delivery.carrier.template.option,postlogistics_type:0
2467+msgid "Output Format"
2468+msgstr ""
2469+
2470+#. module: delivery_carrier_label_postlogistics
2471+#: field:delivery.carrier.template.option,postlogistics_basic_service_ids:0
2472+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_delivery_carrier_template_option_postlogistics_basic_service_ids
2473+msgid "Basic Services"
2474+msgstr ""
2475+
2476+#. module: delivery_carrier_label_postlogistics
2477+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_logo
2478+#: field:postlogistics.config.settings,logo:0
2479+msgid "Company Logo on Post labels"
2480+msgstr ""
2481+
2482+#. module: delivery_carrier_label_postlogistics
2483+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_office
2484+#: field:res.company,postlogistics_office:0
2485+msgid "Post office"
2486+msgstr ""
2487+
2488+#. module: delivery_carrier_label_postlogistics
2489+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_office
2490+#: field:postlogistics.config.settings,office:0
2491+msgid "Domicile Post office"
2492+msgstr ""
2493+
2494+#. module: delivery_carrier_label_postlogistics
2495+#: model:ir.model,name:delivery_carrier_label_postlogistics.model_delivery_carrier_template_option
2496+msgid "Delivery carrier template option"
2497+msgstr ""
2498+
2499+#. module: delivery_carrier_label_postlogistics
2500+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_output_format_option_jpg
2501+msgid "JPG"
2502+msgstr ""
2503+
2504+#. module: delivery_carrier_label_postlogistics
2505+#: view:postlogistics.config.settings:0
2506+msgid "or"
2507+msgstr ""
2508+
2509+#. module: delivery_carrier_label_postlogistics
2510+#: model:ir.ui.menu,name:delivery_carrier_label_postlogistics.menu_postlogistics_config
2511+msgid "Postlogistics"
2512+msgstr ""
2513+
2514+#. module: delivery_carrier_label_postlogistics
2515+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_output_format_option_png
2516+msgid "PNG"
2517+msgstr ""
2518+
2519+#. module: delivery_carrier_label_postlogistics
2520+#: view:postlogistics.config.settings:0
2521+msgid "Cancel"
2522+msgstr ""
2523+
2524+#. module: delivery_carrier_label_postlogistics
2525+#: view:postlogistics.config.settings:0
2526+msgid "Apply"
2527+msgstr ""
2528+
2529+#. module: delivery_carrier_label_postlogistics
2530+#: model:ir.model,name:delivery_carrier_label_postlogistics.model_stock_picking_out
2531+msgid "Delivery Orders"
2532+msgstr ""
2533+
2534+#. module: delivery_carrier_label_postlogistics
2535+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_default_output_format
2536+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_default_output_format
2537+#: field:postlogistics.config.settings,default_output_format:0
2538+#: field:res.company,postlogistics_default_output_format:0
2539+msgid "Default output format"
2540+msgstr ""
2541+
2542+#. module: delivery_carrier_label_postlogistics
2543+#: selection:delivery.carrier.template.option,postlogistics_type:0
2544+msgid "Basic Service"
2545+msgstr ""
2546+
2547
2548=== added file 'delivery_carrier_label_postlogistics/i18n/fr.po'
2549--- delivery_carrier_label_postlogistics/i18n/fr.po 1970-01-01 00:00:00 +0000
2550+++ delivery_carrier_label_postlogistics/i18n/fr.po 2014-01-13 11:23:36 +0000
2551@@ -0,0 +1,498 @@
2552+# Translation of OpenERP Server.
2553+# This file contains the translation of the following modules:
2554+# * delivery_carrier_label_postlogistics
2555+#
2556+msgid ""
2557+msgstr ""
2558+"Project-Id-Version: OpenERP Server 7.0\n"
2559+"Report-Msgid-Bugs-To: \n"
2560+"POT-Creation-Date: 2013-12-06 13:12+0000\n"
2561+"PO-Revision-Date: 2013-12-06 15:13+0100\n"
2562+"Last-Translator: Yannick Vaucher <yannick.vaucher@camptocamp.com>\n"
2563+"Language-Team: \n"
2564+"MIME-Version: 1.0\n"
2565+"Content-Type: text/plain; charset=UTF-8\n"
2566+"Content-Transfer-Encoding: 8bit\n"
2567+"Plural-Forms: \n"
2568+
2569+#. module: delivery_carrier_label_postlogistics
2570+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_output_format_option_spdf
2571+msgid "sPDF"
2572+msgstr "sPDF"
2573+
2574+#. module: delivery_carrier_label_postlogistics
2575+#: field:delivery.carrier.template.option,postlogistics_additonial_service_ids:0
2576+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_delivery_carrier_template_option_postlogistics_additonial_service_ids
2577+msgid "Compatible Additional Services"
2578+msgstr "Prestations additionnelles compatibles"
2579+
2580+#. module: delivery_carrier_label_postlogistics
2581+#: help:delivery.carrier.template.option,postlogistics_basic_service_ids:0
2582+msgid "List of basic service for which this service is compatible"
2583+msgstr "Liste des prestations de base pour lesquels un service est compatible"
2584+
2585+#. module: delivery_carrier_label_postlogistics
2586+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_default_resolution
2587+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_default_resolution
2588+#: field:postlogistics.config.settings,default_resolution:0
2589+#: field:res.company,postlogistics_default_resolution:0
2590+msgid "Default resolution"
2591+msgstr "Résolution d'imprimante par défaut"
2592+
2593+#. module: delivery_carrier_label_postlogistics
2594+#: code:addons/delivery_carrier_label_postlogistics/res_config.py:342
2595+#, python-format
2596+msgid ""
2597+"Could not retrieve Postlogistics group services:\n"
2598+"%s"
2599+msgstr ""
2600+"Impossible de récupérer les groupes de prestations de PostLogistics:\n"
2601+"%s"
2602+
2603+#. module: delivery_carrier_label_postlogistics
2604+#: view:postlogistics.config.settings:0
2605+msgid "Sender Informations"
2606+msgstr "Informations de l'expéditeur"
2607+
2608+#. module: delivery_carrier_label_postlogistics
2609+#: field:delivery.carrier.template.option,postlogistics_delivery_instruction_ids:0
2610+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_delivery_carrier_template_option_postlogistics_delivery_instruction_ids
2611+msgid "Compatible Delivery Instructions"
2612+msgstr "Instructions de distribution"
2613+
2614+#. module: delivery_carrier_label_postlogistics
2615+#: model:ir.model,name:delivery_carrier_label_postlogistics.model_postlogistics_config_settings
2616+msgid "postlogistics.config.settings"
2617+msgstr ""
2618+
2619+#. module: delivery_carrier_label_postlogistics
2620+#: view:delivery.carrier.option:0
2621+msgid "['|', ('partner_id', '!=', 5), ('id', 'in', allowed_option_ids[0][2])]"
2622+msgstr ""
2623+
2624+#. module: delivery_carrier_label_postlogistics
2625+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_output_format_option_eps
2626+msgid "EPS"
2627+msgstr "EPS"
2628+
2629+#. module: delivery_carrier_label_postlogistics
2630+#: code:addons/delivery_carrier_label_postlogistics/postlogistics/web_service.py:71
2631+#, python-format
2632+msgid "Error 401"
2633+msgstr "Erreur 401"
2634+
2635+#. module: delivery_carrier_label_postlogistics
2636+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_license_more_1kg
2637+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_license_more_1kg
2638+#: field:postlogistics.config.settings,license_more_1kg:0
2639+#: field:res.company,postlogistics_license_more_1kg:0
2640+msgid "License more than 1kg"
2641+msgstr "License plus de 1kg"
2642+
2643+#. module: delivery_carrier_label_postlogistics
2644+#: model:ir.model,name:delivery_carrier_label_postlogistics.model_delivery_carrier_option
2645+msgid "Delivery carrier option"
2646+msgstr "Option de méthode de livraison"
2647+
2648+#. module: delivery_carrier_label_postlogistics
2649+#: sql_constraint:postlogistics.service.group:0
2650+msgid "A service group ID must be unique."
2651+msgstr "L'ID d'un groupe de service doit être unique"
2652+
2653+#. module: delivery_carrier_label_postlogistics
2654+#: view:postlogistics.config.settings:0
2655+msgid "Licenses"
2656+msgstr "Licenses"
2657+
2658+#. module: delivery_carrier_label_postlogistics
2659+#: field:delivery.carrier.option,allowed_option_ids:0
2660+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_delivery_carrier_option_allowed_option_ids
2661+msgid "Allowed and compatible options"
2662+msgstr "Options permise et compatible"
2663+
2664+#. module: delivery_carrier_label_postlogistics
2665+#: model:ir.model,name:delivery_carrier_label_postlogistics.model_shipping_label
2666+msgid "Shipping Label"
2667+msgstr "Étiquette d'expédition"
2668+
2669+#. module: delivery_carrier_label_postlogistics
2670+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_license_less_1kg
2671+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_license_less_1kg
2672+#: field:postlogistics.config.settings,license_less_1kg:0
2673+#: field:res.company,postlogistics_license_less_1kg:0
2674+msgid "License less than 1kg"
2675+msgstr "Licence moins de 1kg"
2676+
2677+#. module: delivery_carrier_label_postlogistics
2678+#: selection:delivery.carrier.template.option,postlogistics_type:0
2679+msgid "Delivery Instructions"
2680+msgstr "Instruction de distribution"
2681+
2682+#. module: delivery_carrier_label_postlogistics
2683+#: help:delivery.carrier,allowed_option_ids:0
2684+msgid "Compute allowed options according to selected options."
2685+msgstr "Déterminer les options permise en fonction des options sélectionnées."
2686+
2687+#. module: delivery_carrier_label_postlogistics
2688+#: selection:delivery.carrier.template.option,postlogistics_type:0
2689+msgid "Label Layout"
2690+msgstr "Format d'étiquette"
2691+
2692+#. module: delivery_carrier_label_postlogistics
2693+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_layout_option_fe
2694+msgid "Format FE"
2695+msgstr "Format FE"
2696+
2697+#. module: delivery_carrier_label_postlogistics
2698+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_layout_option_a5
2699+msgid "Format A5"
2700+msgstr "Format A5"
2701+
2702+#. module: delivery_carrier_label_postlogistics
2703+#: model:ir.actions.act_window,name:delivery_carrier_label_postlogistics.action_postlogistics_config
2704+#: view:postlogistics.config.settings:0
2705+msgid "Configure Postlogistics"
2706+msgstr "Configurer PostLogistics"
2707+
2708+#. module: delivery_carrier_label_postlogistics
2709+#: field:delivery.carrier,allowed_option_ids:0
2710+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_delivery_carrier_allowed_option_ids
2711+msgid "Allowed options"
2712+msgstr "Options compatibles"
2713+
2714+#. module: delivery_carrier_label_postlogistics
2715+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_layout_option_a7
2716+msgid "Format A7"
2717+msgstr "Format A7"
2718+
2719+#. module: delivery_carrier_label_postlogistics
2720+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_layout_option_a6
2721+msgid "Format A6"
2722+msgstr "Format A6"
2723+
2724+#. module: delivery_carrier_label_postlogistics
2725+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_company_id
2726+#: field:postlogistics.config.settings,company_id:0
2727+msgid "Company"
2728+msgstr "Companie"
2729+
2730+#. module: delivery_carrier_label_postlogistics
2731+#: help:delivery.carrier,postlogistics_basic_service_id:0
2732+msgid "Basic Service defines the available additional options for this delivery method"
2733+msgstr "Le service de base défini les options disponibles pour cette méthode de livraison"
2734+
2735+#. module: delivery_carrier_label_postlogistics
2736+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_service_group_group_extid
2737+#: field:postlogistics.service.group,group_extid:0
2738+msgid "Group ID"
2739+msgstr "ID de groupe"
2740+
2741+#. module: delivery_carrier_label_postlogistics
2742+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_wsdl_url
2743+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_wsdl_url
2744+#: field:postlogistics.config.settings,wsdl_url:0
2745+#: field:res.company,postlogistics_wsdl_url:0
2746+msgid "WSDL URL"
2747+msgstr "WSDL URL"
2748+
2749+#. module: delivery_carrier_label_postlogistics
2750+#: code:addons/delivery_carrier_label_postlogistics/res_config.py:147
2751+#, python-format
2752+msgid ""
2753+"Could not retrieve Postlogistics deliveryinstructions:\n"
2754+"%s"
2755+msgstr ""
2756+"Impossible de récupérer les instruction de distribution de PostLogistics:\n"
2757+"%s"
2758+
2759+#. module: delivery_carrier_label_postlogistics
2760+#: field:delivery.carrier,postlogistics_basic_service_id:0
2761+#: field:delivery.carrier,postlogistics_service_group_id:0
2762+#: field:delivery.carrier.template.option,postlogistics_service_group_id:0
2763+#: model:ir.model,name:delivery_carrier_label_postlogistics.model_postlogistics_service_group
2764+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_delivery_carrier_postlogistics_basic_service_id
2765+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_delivery_carrier_postlogistics_service_group_id
2766+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_delivery_carrier_template_option_postlogistics_service_group_id
2767+msgid "PostLogistics Service Group"
2768+msgstr "Groupe de service PostLogistics"
2769+
2770+#. module: delivery_carrier_label_postlogistics
2771+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_output_resolution_option_600ppp
2772+msgid "600 ppp"
2773+msgstr "600 ppp"
2774+
2775+#. module: delivery_carrier_label_postlogistics
2776+#: code:addons/delivery_carrier_label_postlogistics/postlogistics/web_service.py:72
2777+#, python-format
2778+msgid ""
2779+"Authorization Required\n"
2780+"\n"
2781+"Please verify postlogistics username and password in:\n"
2782+"Configuration -> Postlogistics"
2783+msgstr ""
2784+"Autorisation requise\n"
2785+"\n"
2786+"Veuillez vérifier vos nom d'utilisateur et mot de passe PostLogistics sous:\n"
2787+"Configuration -> PostLogistics"
2788+
2789+#. module: delivery_carrier_label_postlogistics
2790+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_output_format_option_zpl2
2791+msgid "ZPL2"
2792+msgstr "ZPL2"
2793+
2794+#. module: delivery_carrier_label_postlogistics
2795+#: selection:delivery.carrier.template.option,postlogistics_type:0
2796+msgid "Output Resolution"
2797+msgstr "Résolution de l'imprimante (ppp)"
2798+
2799+#. module: delivery_carrier_label_postlogistics
2800+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_default_label_layout
2801+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_default_label_layout
2802+#: field:postlogistics.config.settings,default_label_layout:0
2803+#: field:res.company,postlogistics_default_label_layout:0
2804+msgid "Default label layout"
2805+msgstr "Format de sortie d'étiquette par défault"
2806+
2807+#. module: delivery_carrier_label_postlogistics
2808+#: help:postlogistics.config.settings,office:0
2809+msgid "Post office which will receive the shipped goods"
2810+msgstr "Office postale qui laquelle transiteront les produits"
2811+
2812+#. module: delivery_carrier_label_postlogistics
2813+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_password
2814+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_password
2815+#: field:postlogistics.config.settings,password:0
2816+#: field:res.company,postlogistics_password:0
2817+msgid "Password"
2818+msgstr "Mot de passe"
2819+
2820+#. module: delivery_carrier_label_postlogistics
2821+#: view:postlogistics.config.settings:0
2822+msgid "Update PostLogistics Services"
2823+msgstr "Mettre à jour les services PostLogistics"
2824+
2825+#. module: delivery_carrier_label_postlogistics
2826+#: view:delivery.carrier:0
2827+msgid "{'default_carrier_id': active_id, 'default_allowed_option_ids': allowed_option_ids}"
2828+msgstr ""
2829+
2830+#. module: delivery_carrier_label_postlogistics
2831+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_username
2832+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_username
2833+#: field:postlogistics.config.settings,username:0
2834+#: field:res.company,postlogistics_username:0
2835+msgid "Username"
2836+msgstr "Nom d'utilsateur"
2837+
2838+#. module: delivery_carrier_label_postlogistics
2839+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_logo
2840+#: field:res.company,postlogistics_logo:0
2841+msgid "Company logo for PostLogistics"
2842+msgstr "Logo de compagnie pour PostLogistics"
2843+
2844+#. module: delivery_carrier_label_postlogistics
2845+#: field:delivery.carrier.template.option,postlogistics_type:0
2846+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_delivery_carrier_template_option_postlogistics_type
2847+msgid "PostLogistics option type"
2848+msgstr "Type d'option PostLogistics"
2849+
2850+#. module: delivery_carrier_label_postlogistics
2851+#: field:delivery.carrier.option,name:0
2852+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_delivery_carrier_option_name
2853+msgid "Name"
2854+msgstr "Name"
2855+
2856+#. module: delivery_carrier_label_postlogistics
2857+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_license_vinolog
2858+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_license_vinolog
2859+#: field:postlogistics.config.settings,license_vinolog:0
2860+#: field:res.company,postlogistics_license_vinolog:0
2861+msgid "License VinoLog"
2862+msgstr "License VinoLog"
2863+
2864+#. module: delivery_carrier_label_postlogistics
2865+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_output_resolution_option_300ppp
2866+msgid "300 ppp"
2867+msgstr "300 ppp"
2868+
2869+#. module: delivery_carrier_label_postlogistics
2870+#: view:postlogistics.config.settings:0
2871+msgid "Select Company"
2872+msgstr "Sélectionner la compagnie"
2873+
2874+#. module: delivery_carrier_label_postlogistics
2875+#: model:ir.model,name:delivery_carrier_label_postlogistics.model_res_company
2876+msgid "Companies"
2877+msgstr "Compagnies"
2878+
2879+#. module: delivery_carrier_label_postlogistics
2880+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_output_format_option_pdf
2881+msgid "PDF"
2882+msgstr "PDF"
2883+
2884+#. module: delivery_carrier_label_postlogistics
2885+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_output_format_option_gif
2886+msgid "GIF"
2887+msgstr "GIF"
2888+
2889+#. module: delivery_carrier_label_postlogistics
2890+#: model:ir.model,name:delivery_carrier_label_postlogistics.model_delivery_carrier
2891+msgid "Carrier"
2892+msgstr "Transporteur"
2893+
2894+#. module: delivery_carrier_label_postlogistics
2895+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_output_resolution_option_200ppp
2896+msgid "200 ppp"
2897+msgstr "200 ppp"
2898+
2899+#. module: delivery_carrier_label_postlogistics
2900+#: view:postlogistics.config.settings:0
2901+msgid "Default configs"
2902+msgstr "Configurations par défaut"
2903+
2904+#. module: delivery_carrier_label_postlogistics
2905+#: code:addons/delivery_carrier_label_postlogistics/res_config.py:149
2906+#: code:addons/delivery_carrier_label_postlogistics/res_config.py:208
2907+#: code:addons/delivery_carrier_label_postlogistics/res_config.py:280
2908+#: code:addons/delivery_carrier_label_postlogistics/res_config.py:344
2909+#, python-format
2910+msgid "Error"
2911+msgstr "Erreur"
2912+
2913+#. module: delivery_carrier_label_postlogistics
2914+#: help:postlogistics.config.settings,logo:0
2915+msgid ""
2916+"Optional company logo to show on label.\n"
2917+"If using an image / logo, please note the following:\n"
2918+"– Image width: 47 mm\n"
2919+"– Image height: 25 mm\n"
2920+"– File size: max. 30 kb\n"
2921+"– File format: GIF or PNG\n"
2922+"– Colour table: indexed colours, max. 200 colours\n"
2923+"– The logo will be printed rotated counter-clockwise by 90°\n"
2924+"We recommend using a black and white logo for printing in the\n"
2925+"ZPL2 format."
2926+msgstr ""
2927+"Logo optionnel à imprimer sur vos étiquettes.\n"
2928+"Veuillez tenir compte des indications suivantes lors de la création
2929de votre image ou logo:\n"
2930+"
2931– Largeur de l’image: 47 mm\n"
2932+"
2933– Hauteur de l’image: 25 mmv
2934– Taille du fichier: max. 30 ko\n"
2935+"
2936– Format de fichier: GIF ou PNG\n"
2937+"
2938– Table des couleurs: couleurs indicées, 200 au max.\n"
2939+"
2940– Le logo sera imprimé tourné de 90° dans le sens contraire des
2941aiguilles d’une montre \n"
2942+"
2943Il est conseillé d’utiliser un logo noir et blanc pour l’impression
2944en format ZPL2."
2945+
2946+#. module: delivery_carrier_label_postlogistics
2947+#: code:addons/delivery_carrier_label_postlogistics/res_config.py:206
2948+#: code:addons/delivery_carrier_label_postlogistics/res_config.py:278
2949+#, python-format
2950+msgid ""
2951+"Could not retrieve Postlogistics base services:\n"
2952+"%s"
2953+msgstr ""
2954+"Impossible de récupérer les prestations de base de PostLogistics:\n"
2955+"%s"
2956+
2957+#. module: delivery_carrier_label_postlogistics
2958+#: selection:delivery.carrier.template.option,postlogistics_type:0
2959+msgid "Additional Service"
2960+msgstr "Prestations additionnelles"
2961+
2962+#. module: delivery_carrier_label_postlogistics
2963+#: help:delivery.carrier,postlogistics_service_group_id:0
2964+msgid "Service group defines the available options for this delivery method."
2965+msgstr "Un groupe service défini les options compatible avec cette méthode de transport"
2966+
2967+#. module: delivery_carrier_label_postlogistics
2968+#: view:postlogistics.config.settings:0
2969+msgid "Web Service Authentification"
2970+msgstr "Authentification pour le Web Service"
2971+
2972+#. module: delivery_carrier_label_postlogistics
2973+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_service_group_name
2974+#: field:postlogistics.service.group,name:0
2975+msgid "Description"
2976+msgstr "Description"
2977+
2978+#. module: delivery_carrier_label_postlogistics
2979+#: selection:delivery.carrier.template.option,postlogistics_type:0
2980+msgid "Output Format"
2981+msgstr "Format de sortie"
2982+
2983+#. module: delivery_carrier_label_postlogistics
2984+#: field:delivery.carrier.template.option,postlogistics_basic_service_ids:0
2985+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_delivery_carrier_template_option_postlogistics_basic_service_ids
2986+msgid "Basic Services"
2987+msgstr "Prestations de base"
2988+
2989+#. module: delivery_carrier_label_postlogistics
2990+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_logo
2991+#: field:postlogistics.config.settings,logo:0
2992+msgid "Company Logo on Post labels"
2993+msgstr "Logo de compagnie sur les étiquettes postales"
2994+
2995+#. module: delivery_carrier_label_postlogistics
2996+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_office
2997+#: field:res.company,postlogistics_office:0
2998+msgid "Post office"
2999+msgstr "Office de poste"
3000+
3001+#. module: delivery_carrier_label_postlogistics
3002+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_office
3003+#: field:postlogistics.config.settings,office:0
3004+msgid "Domicile Post office"
3005+msgstr "Office de postal de domicile"
3006+
3007+#. module: delivery_carrier_label_postlogistics
3008+#: model:ir.model,name:delivery_carrier_label_postlogistics.model_delivery_carrier_template_option
3009+msgid "Delivery carrier template option"
3010+msgstr "Modèle d'option de méthode de livraison"
3011+
3012+#. module: delivery_carrier_label_postlogistics
3013+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_output_format_option_jpg
3014+msgid "JPG"
3015+msgstr "JPG"
3016+
3017+#. module: delivery_carrier_label_postlogistics
3018+#: view:postlogistics.config.settings:0
3019+msgid "or"
3020+msgstr "ou"
3021+
3022+#. module: delivery_carrier_label_postlogistics
3023+#: model:ir.ui.menu,name:delivery_carrier_label_postlogistics.menu_postlogistics_config
3024+msgid "Postlogistics"
3025+msgstr "PostLogistics"
3026+
3027+#. module: delivery_carrier_label_postlogistics
3028+#: model:delivery.carrier.template.option,name:delivery_carrier_label_postlogistics.postlogistics_output_format_option_png
3029+msgid "PNG"
3030+msgstr "PNG"
3031+
3032+#. module: delivery_carrier_label_postlogistics
3033+#: view:postlogistics.config.settings:0
3034+msgid "Cancel"
3035+msgstr "Annuler"
3036+
3037+#. module: delivery_carrier_label_postlogistics
3038+#: view:postlogistics.config.settings:0
3039+msgid "Apply"
3040+msgstr "Appliquer"
3041+
3042+#. module: delivery_carrier_label_postlogistics
3043+#: model:ir.model,name:delivery_carrier_label_postlogistics.model_stock_picking_out
3044+msgid "Delivery Orders"
3045+msgstr "Bons de livraison"
3046+
3047+#. module: delivery_carrier_label_postlogistics
3048+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_postlogistics_config_settings_default_output_format
3049+#: model:ir.model.fields,field_description:delivery_carrier_label_postlogistics.field_res_company_postlogistics_default_output_format
3050+#: field:postlogistics.config.settings,default_output_format:0
3051+#: field:res.company,postlogistics_default_output_format:0
3052+msgid "Default output format"
3053+msgstr "Option de format de sortie par défaut"
3054+
3055+#. module: delivery_carrier_label_postlogistics
3056+#: selection:delivery.carrier.template.option,postlogistics_type:0
3057+msgid "Basic Service"
3058+msgstr "Prestation de base"
3059+
3060
3061=== added directory 'delivery_carrier_label_postlogistics/postlogistics'
3062=== added file 'delivery_carrier_label_postlogistics/postlogistics/__init__.py'
3063--- delivery_carrier_label_postlogistics/postlogistics/__init__.py 1970-01-01 00:00:00 +0000
3064+++ delivery_carrier_label_postlogistics/postlogistics/__init__.py 2014-01-13 11:23:36 +0000
3065@@ -0,0 +1,21 @@
3066+# -*- coding: utf-8 -*-
3067+##############################################################################
3068+#
3069+# Author: Yannick Vaucher
3070+# Copyright 2013 Camptocamp SA
3071+#
3072+# This program is free software: you can redistribute it and/or modify
3073+# it under the terms of the GNU Affero General Public License as
3074+# published by the Free Software Foundation, either version 3 of the
3075+# License, or (at your option) any later version.
3076+#
3077+# This program is distributed in the hope that it will be useful,
3078+# but WITHOUT ANY WARRANTY; without even the implied warranty of
3079+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3080+# GNU Affero General Public License for more details.
3081+#
3082+# You should have received a copy of the GNU Affero General Public License
3083+# along with this program. If not, see <http://www.gnu.org/licenses/>.
3084+#
3085+##############################################################################
3086+from . import web_service
3087
3088=== added file 'delivery_carrier_label_postlogistics/postlogistics/web_service.py'
3089--- delivery_carrier_label_postlogistics/postlogistics/web_service.py 1970-01-01 00:00:00 +0000
3090+++ delivery_carrier_label_postlogistics/postlogistics/web_service.py 2014-01-13 11:23:36 +0000
3091@@ -0,0 +1,374 @@
3092+# -*- coding: utf-8 -*-
3093+##############################################################################
3094+#
3095+# Author: Yannick Vaucher
3096+# Copyright 2013 Camptocamp SA
3097+#
3098+# This program is free software: you can redistribute it and/or modify
3099+# it under the terms of the GNU Affero General Public License as
3100+# published by the Free Software Foundation, either version 3 of the
3101+# License, or (at your option) any later version.
3102+#
3103+# This program is distributed in the hope that it will be useful,
3104+# but WITHOUT ANY WARRANTY; without even the implied warranty of
3105+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3106+# GNU Affero General Public License for more details.
3107+#
3108+# You should have received a copy of the GNU Affero General Public License
3109+# along with this program. If not, see <http://www.gnu.org/licenses/>.
3110+#
3111+##############################################################################
3112+import re
3113+from suds.client import Client, WebFault
3114+from suds.transport.http import HttpAuthenticated
3115+from PIL import Image
3116+from StringIO import StringIO
3117+
3118+from openerp.osv import orm
3119+from openerp.tools.translate import _
3120+
3121+_compile_itemid = re.compile('[^0-9A-Za-z+\-_]')
3122+
3123+
3124+class PostlogisticsWebService(object):
3125+ """ Connector with PostLogistics for labels using post.ch Web Services
3126+
3127+ Handbook available here: http://www.poste.ch/post-barcode-cug.htm
3128+
3129+ Allows to generate labels
3130+
3131+ """
3132+
3133+ def __init__(self, company):
3134+ self.init_connection(company)
3135+
3136+ def init_connection(self, company):
3137+ t = HttpAuthenticated(
3138+ username=company.postlogistics_username,
3139+ password=company.postlogistics_password)
3140+ self.client = Client(
3141+ company.postlogistics_wsdl_url,
3142+ transport=t)
3143+
3144+ def _send_request(self, request, **kwargs):
3145+ """ Wrapper for API requests
3146+
3147+ :param request: callback for API request
3148+ :param **kwargs: params forwarded to the callback
3149+
3150+ """
3151+ res = {}
3152+ try:
3153+ res['value'] = request(**kwargs)
3154+ res['success'] = True
3155+ except WebFault as e:
3156+ res['success'] = False
3157+ res['errors'] = [e[0]]
3158+ except Exception as e:
3159+ # if authentification error
3160+ if isinstance(e[0], tuple) and e[0][0] == 401:
3161+ raise orm.except_orm(
3162+ _('Error 401'),
3163+ _('Authorization Required\n\n'
3164+ 'Please verify postlogistics username and password in:\n'
3165+ 'Configuration -> Postlogistics'))
3166+ raise
3167+ return res
3168+
3169+ def _get_language(self, lang):
3170+ """ Return a language to iso format from openerp format.
3171+
3172+ `iso_code` field in res.lang is not mandatory thus not always set.
3173+ Use partner language if available, otherwise use english
3174+
3175+ :param partner: partner browse record
3176+ :return: language code to use.
3177+
3178+ """
3179+ available_languages = self.client.factory.create('ns0:Language')
3180+ lang_code = lang.split('_')[0]
3181+ if lang_code in available_languages:
3182+ return lang_code
3183+ return 'en'
3184+
3185+ def read_allowed_services_by_franking_license(self, license, company, lang=None):
3186+ """ Get a list of allowed service for a postlogistics licence """
3187+ if not lang:
3188+ lang = company.partner_id.lang
3189+ lang = self._get_language(lang)
3190+ request = self.client.service.ReadAllowedServicesByFrankingLicense
3191+ return self._send_request(request, License=license, Language=lang)
3192+
3193+ def read_service_groups(self, company, lang):
3194+ """ Get group of services """
3195+ if not lang:
3196+ lang = company.partner_id.lang
3197+ lang = self._get_language(lang)
3198+ request = self.client.service.ReadServiceGroups
3199+ return self._send_request(request, Language=lang)
3200+
3201+ def read_basic_services(self, company, service_group_id, lang):
3202+ """ Get basic services for a given service group """
3203+ if not lang:
3204+ lang = company.partner_id.lang
3205+ lang = self._get_language(lang)
3206+ request = self.client.service.ReadBasicServices
3207+ return self._send_request(request, Language=lang, ServiceGroupID=service_group_id)
3208+
3209+ def read_additional_services(self, company, service_code, lang):
3210+ """ Get additional services compatible with a basic services """
3211+ if not lang:
3212+ lang = company.partner_id.lang
3213+ lang = self._get_language(lang)
3214+ request = self.client.service.ReadAdditionalServices
3215+ return self._send_request(request, Language=lang, PRZL=service_code)
3216+
3217+ def read_delivery_instructions(self, company, service_code, lang):
3218+ """ Get delivery instruction 'ZAW' compatible with a base service """
3219+ if not lang:
3220+ lang = company.partner_id.lang
3221+ lang = self._get_language(lang)
3222+ request = self.client.service.ReadDeliveryInstructions
3223+ return self._send_request(request, Language=lang, PRZL=service_code)
3224+
3225+ def _prepare_recipient(self, picking):
3226+ """ Create a ns0:Recipient as a dict from a partner
3227+
3228+ :param partner: partner browse record
3229+ :return a dict containing data for ns0:Recipient
3230+
3231+ """
3232+ partner = picking.partner_id
3233+
3234+ recipient = {
3235+ 'Name1': partner.name,
3236+ 'Street': partner.street,
3237+ 'ZIP': partner.zip,
3238+ 'City': partner.city,
3239+ 'Country': partner.country_id.code,
3240+ 'EMail': partner.email or None,
3241+ }
3242+
3243+ if partner.parent_id:
3244+ recipient['Name2'] = partner.parent_id.name
3245+ recipient['PersonallyAddressed'] = False
3246+
3247+ # Phone and / or mobile should only be diplayed if instruction to
3248+ # Notify delivery by telephone is set
3249+ is_phone_required = [option for option in picking.option_ids
3250+ if option.code == 'ZAW3213']
3251+ if is_phone_required:
3252+ if partner.phone:
3253+ recipient['Phone'] = partner.phone
3254+
3255+ if partner.mobile:
3256+ recipient['Mobile'] = partner.mobile
3257+
3258+ return recipient
3259+
3260+ def _prepare_customer(self, picking):
3261+ """ Create a ns0:Customer as a dict from picking
3262+
3263+ This is the Postlogistic Customer, thus the sender
3264+
3265+ :param picking: picking browse record
3266+ :return a dict containing data for ns0:Customer
3267+
3268+ """
3269+ company = picking.company_id
3270+ partner = company.partner_id
3271+
3272+ customer = {
3273+ 'Name1': partner.name,
3274+ 'Street': partner.street,
3275+ 'ZIP': partner.zip,
3276+ 'City': partner.city,
3277+ 'Country': partner.country_id.code,
3278+ 'DomicilePostOffice': company.postlogistics_office,
3279+ }
3280+ logo_format = None
3281+ logo = company.postlogistics_logo
3282+ if logo:
3283+ logo_image = Image.open(StringIO(logo.decode('base64')))
3284+ logo_format = logo_image.format
3285+ customer['Logo'] = logo
3286+ customer['LogoFormat'] = logo_format
3287+ return customer
3288+
3289+ def _get_single_option(self, picking, option):
3290+ option = [opt.code for opt in picking.option_ids
3291+ if opt.postlogistics_type == option]
3292+ assert len(option) <= 1
3293+ return option and option[0]
3294+
3295+ def _get_label_layout(self, picking):
3296+ label_layout = self._get_single_option(picking, 'label_layout')
3297+ if not label_layout:
3298+ company = picking.company_id
3299+ label_layout = company.postlogistics_default_label_layout.code
3300+ return label_layout
3301+
3302+ def _get_output_format(self, picking):
3303+ output_format = self._get_single_option(picking, 'output_format')
3304+ if not output_format:
3305+ company = picking.company_id
3306+ output_format = company.postlogistics_default_output_format.code
3307+ return output_format
3308+
3309+ def _get_image_resolution(self, picking):
3310+ resolution = self._get_single_option(picking, 'resolution')
3311+ if not resolution:
3312+ company = picking.company_id
3313+ resolution = company.postlogistics_default_resolution.code
3314+ return resolution
3315+
3316+ def _get_license(self, picking):
3317+ """ Get the right license depending on weight """
3318+ company = picking.company_id
3319+ #XXX get weight or set it as an option on picking
3320+ weight = 0
3321+ if weight > 1.0:
3322+ return company.postlogistics_license_more_1kg
3323+ return company.postlogistics_license_less_1kg
3324+
3325+ def _prepare_attributes(self, picking):
3326+ services = [option.code.split(',') for option in picking.option_ids
3327+ if option.tmpl_option_id.postlogistics_type
3328+ in ('basic', 'additional', 'delivery')]
3329+
3330+ attributes = {
3331+ 'PRZL': services,
3332+ }
3333+ return attributes
3334+
3335+ def _get_itemid(self, picking, pack_no):
3336+ """ Allowed characters are alphanumeric plus `+`, `-` and `_`
3337+ Last `+` separates picking name and package number (if any)
3338+
3339+ :return string: itemid
3340+
3341+ """
3342+ name = _compile_itemid.sub('', picking.name)
3343+ codes = [name, pack_no]
3344+ return "+".join(c for c in codes if c)
3345+
3346+ def _prepare_item_list(self, picking, recipient, attributes):
3347+ """ Return a list of item made from the pickings """
3348+ item_list = []
3349+ # A label will be generated per pack and if there is no pack only one
3350+ # label will be generated
3351+ packs = set([line.tracking_id.name for line in picking.move_lines])
3352+ for pack_no in packs:
3353+ itemid = self._get_itemid(picking, pack_no)
3354+ item = {
3355+ 'ItemID': itemid,
3356+ 'Recipient': recipient,
3357+ 'Attributes': attributes,
3358+ }
3359+
3360+ item_list.append(item)
3361+
3362+ return item_list
3363+
3364+ def _prepare_data(self, item_list):
3365+ sending = {
3366+ 'Item': item_list,
3367+ }
3368+ provider = {
3369+ 'Sending': sending
3370+ }
3371+ data = {
3372+ 'Provider': provider,
3373+ }
3374+ return data
3375+
3376+ def _prepare_envelope(self, picking, post_customer, data):
3377+ """ Define envelope for label request """
3378+ label_layout = self._get_label_layout(picking)
3379+ output_format = self._get_output_format(picking)
3380+ image_resolution = self._get_image_resolution(picking)
3381+
3382+ label_definitions = {
3383+ 'LabelLayout': label_layout,
3384+ 'PrintAddresses': 'RecipientAndCustomer',
3385+ 'ImageFileType': output_format,
3386+ 'ImageResolution': image_resolution,
3387+ 'PrintPreview': False,
3388+ }
3389+ license = self._get_license(picking)
3390+ file_infos = {
3391+ 'FrankingLicense': license,
3392+ 'PpFranking': False,
3393+ 'CustomerSystem': 'OpenERP',
3394+ 'Customer': post_customer,
3395+ }
3396+
3397+ envelope = {
3398+ 'LabelDefinition': label_definitions,
3399+ 'FileInfos': file_infos,
3400+ 'Data': data,
3401+ }
3402+ return envelope
3403+
3404+ def generate_label(self, picking, user_lang='en_US'):
3405+ """ Generate a label for a picking
3406+
3407+ :param picking: picking browse record
3408+ :param lang: OpenERP language code
3409+ :return: {
3410+ value: [{item_id: pack id
3411+ binary: file returned by API
3412+ tracking_number: id number for tracking
3413+ file_type: str of file type
3414+ }
3415+ ]
3416+ errors: list of error message if any
3417+ warnings: list of warning message if any
3418+ }
3419+
3420+ """
3421+ # get options
3422+ lang = self._get_language(user_lang)
3423+ post_customer = self._prepare_customer(picking)
3424+
3425+ attributes = self._prepare_attributes(picking)
3426+
3427+ recipient = self._prepare_recipient(picking)
3428+ item_list = self._prepare_item_list(picking, recipient, attributes)
3429+ data = self._prepare_data(item_list)
3430+
3431+ envelope = self._prepare_envelope(picking, post_customer, data)
3432+
3433+ output_format = self._get_output_format(picking).lower()
3434+
3435+ res = {'value': []}
3436+ request = self.client.service.GenerateLabel
3437+ response = self._send_request(request, Language=lang, Envelope=envelope)
3438+
3439+ if not response['success']:
3440+ return response
3441+ error_messages = []
3442+ warning_messages = []
3443+ for item in response['value'].Data.Provider.Sending.Item:
3444+ if hasattr(item, 'Errors') and item.Errors:
3445+ for error in item.Errors.Error:
3446+ message = '[%s] %s' % (error.Code, error.Message)
3447+ error_messages.append(message)
3448+ else:
3449+ res['value'].append({
3450+ 'item_id': item.ItemID,
3451+ 'binary': item.Label,
3452+ 'tracking_number': item.IdentCode,
3453+ 'file_type': output_format,
3454+ })
3455+
3456+ if hasattr(item, 'Warnings') and item.Warnings:
3457+ for warning in item.Warnings:
3458+ message = '[%s] %s' % (warning.Code, warning.Message)
3459+ warning_messages.append(message)
3460+
3461+ if error_messages:
3462+ res['errors'] = error_messages
3463+ if warning_messages:
3464+ res['warnings'] = warning_messages
3465+ return res
3466
3467=== added file 'delivery_carrier_label_postlogistics/res_config.py'
3468--- delivery_carrier_label_postlogistics/res_config.py 1970-01-01 00:00:00 +0000
3469+++ delivery_carrier_label_postlogistics/res_config.py 2014-01-13 11:23:36 +0000
3470@@ -0,0 +1,424 @@
3471+# -*- coding: utf-8 -*-
3472+##############################################################################
3473+#
3474+# Author: Yannick Vaucher
3475+# Copyright 2013 Camptocamp SA
3476+#
3477+# This program is free software: you can redistribute it and/or modify
3478+# it under the terms of the GNU Affero General Public License as
3479+# published by the Free Software Foundation, either version 3 of the
3480+# License, or (at your option) any later version.
3481+#
3482+# This program is distributed in the hope that it will be useful,
3483+# but WITHOUT ANY WARRANTY; without even the implied warranty of
3484+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3485+# GNU Affero General Public License for more details.
3486+#
3487+# You should have received a copy of the GNU Affero General Public License
3488+# along with this program. If not, see <http://www.gnu.org/licenses/>.
3489+#
3490+##############################################################################
3491+import logging
3492+
3493+from openerp.osv import orm, fields
3494+from openerp.tools.translate import _
3495+
3496+from postlogistics.web_service import PostlogisticsWebService
3497+
3498+_logger = logging.getLogger(__name__)
3499+
3500+
3501+class PostlogisticsConfigSettings(orm.TransientModel):
3502+ _name = 'postlogistics.config.settings'
3503+ _inherit = 'res.config.settings'
3504+
3505+ _columns = {
3506+ 'company_id': fields.many2one('res.company', 'Company', required=True),
3507+ 'wsdl_url': fields.related(
3508+ 'company_id', 'postlogistics_wsdl_url',
3509+ string='WSDL URL', type='char'),
3510+ 'username': fields.related(
3511+ 'company_id', 'postlogistics_username',
3512+ string='Username', type='char'),
3513+ 'password': fields.related(
3514+ 'company_id', 'postlogistics_password',
3515+ string='Password', type='char'),
3516+ 'license_less_1kg': fields.related(
3517+ 'company_id', 'postlogistics_license_less_1kg',
3518+ string='License less than 1kg', type='char'),
3519+ 'license_more_1kg': fields.related(
3520+ 'company_id', 'postlogistics_license_more_1kg',
3521+ string='License more than 1kg', type='char'),
3522+ 'license_vinolog': fields.related(
3523+ 'company_id', 'postlogistics_license_vinolog',
3524+ string='License VinoLog', type='char'),
3525+ 'logo': fields.related(
3526+ 'company_id', 'postlogistics_logo',
3527+ string='Company Logo on Post labels', type='binary',
3528+ help="Optional company logo to show on label.\n"
3529+ "If using an image / logo, please note the following:\n"
3530+ "– Image width: 47 mm\n"
3531+ "– Image height: 25 mm\n"
3532+ "– File size: max. 30 kb\n"
3533+ "– File format: GIF or PNG\n"
3534+ "– Colour table: indexed colours, max. 200 colours\n"
3535+ "– The logo will be printed rotated counter-clockwise by 90°\n"
3536+ "We recommend using a black and white logo for printing in the\n"
3537+ "ZPL2 format."
3538+ ),
3539+ 'office': fields.related(
3540+ 'company_id', 'postlogistics_office',
3541+ string='Domicile Post office', type='char',
3542+ help="Post office which will receive the shipped goods"),
3543+
3544+ 'default_label_layout': fields.related(
3545+ 'company_id', 'postlogistics_default_label_layout',
3546+ string='Default label layout', type='many2one',
3547+ relation='delivery.carrier.template.option',
3548+ domain=[('postlogistics_type', '=', 'label_layout')]),
3549+ 'default_output_format': fields.related(
3550+ 'company_id', 'postlogistics_default_output_format',
3551+ string='Default output format', type='many2one',
3552+ relation='delivery.carrier.template.option',
3553+ domain=[('postlogistics_type', '=', 'output_format')]),
3554+ 'default_resolution': fields.related(
3555+ 'company_id', 'postlogistics_default_resolution',
3556+ string='Default resolution', type='many2one',
3557+ relation='delivery.carrier.template.option',
3558+ domain=[('postlogistics_type', '=', 'resolution')]),
3559+ }
3560+
3561+ def _default_company(self, cr, uid, context=None):
3562+ user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
3563+ return user.company_id.id
3564+
3565+ _defaults = {
3566+ 'company_id': _default_company,
3567+ }
3568+
3569+ def create(self, cr, uid, values, context=None):
3570+ id = super(PostlogisticsConfigSettings, self
3571+ ).create(cr, uid, values, context=context)
3572+ # Hack: to avoid some nasty bug, related fields are not written
3573+ # upon record creation. Hence we write on those fields here.
3574+ vals = {}
3575+ for fname, field in self._columns.iteritems():
3576+ if isinstance(field, fields.related) and fname in values:
3577+ vals[fname] = values[fname]
3578+ self.write(cr, uid, [id], vals, context)
3579+ return id
3580+
3581+ def onchange_company_id(self, cr, uid, ids, company_id, context=None):
3582+ # update related fields
3583+ values = {}
3584+ values['currency_id'] = False
3585+ if not company_id:
3586+ return {'value': values}
3587+ company = self.pool.get('res.company'
3588+ ).browse(cr, uid, company_id, context=context)
3589+
3590+ label_layout = company.postlogistics_default_label_layout.id or False
3591+ output_format = company.postlogistics_default_output_format.id or False
3592+ resolution = company.postlogistics_default_resolution.id or False
3593+ values = {
3594+ 'username': company.postlogistics_username,
3595+ 'password': company.postlogistics_password,
3596+ 'license_less_1kg': company.postlogistics_license_less_1kg,
3597+ 'license_more_1kg': company.postlogistics_license_more_1kg,
3598+ 'license_vinolog': company.postlogistics_license_vinolog,
3599+ 'logo': company.postlogistics_logo,
3600+ 'office': company.postlogistics_office,
3601+ 'default_label_layout': label_layout,
3602+ 'default_output_format': output_format,
3603+ 'default_resolution': resolution,
3604+ }
3605+ return {'value': values}
3606+
3607+ def _get_delivery_instructions(self, cr, uid, ids, web_service,
3608+ company, service_code, context=None):
3609+ if context is None:
3610+ context = {}
3611+
3612+ lang = context.get('lang', 'en')
3613+ service_code_list = service_code.split(',')
3614+ res = web_service.read_delivery_instructions(company, service_code_list, lang)
3615+ if 'errors' in res:
3616+ errors = '\n'.join(res['errors'])
3617+ error_message = (_('Could not retrieve Postlogistics delivery'
3618+ 'instructions:\n%s') % errors)
3619+ raise orm.except_orm(_('Error'), error_message)
3620+
3621+ if not res['value']:
3622+ return {}
3623+
3624+ if hasattr(res['value'], 'Errors') and res['value'].Errors:
3625+ for error in res['value'].Errors.Error:
3626+ message = '[%s] %s' % (error.Code, error.Message)
3627+ raise orm.except_orm('Error', message)
3628+
3629+ delivery_instructions = {}
3630+ for service in res['value'].DeliveryInstructions:
3631+ service_code = service.PRZL
3632+ delivery_instructions[service_code] = {'name': service.Description}
3633+
3634+ return delivery_instructions
3635+
3636+ def _update_delivery_instructions(self, cr, uid, ids, web_service,
3637+ additional_services, context=None):
3638+ if context is None:
3639+ context = {}
3640+ ir_model_data_obj = self.pool.get('ir.model.data')
3641+ carrier_option_obj = self.pool.get('delivery.carrier.template.option')
3642+
3643+ xmlid = 'delivery_carrier_label_postlogistics', 'postlogistics'
3644+ postlogistics_partner = ir_model_data_obj.get_object(
3645+ cr, uid, *xmlid, context=context)
3646+
3647+ for service_code, data in additional_services.iteritems():
3648+
3649+ option_ids = carrier_option_obj.search(
3650+ cr, uid,
3651+ [('code', '=', service_code),
3652+ ('postlogistics_type', '=', 'delivery')
3653+ ],
3654+ context=context)
3655+
3656+ if option_ids:
3657+ carrier_option_obj.write(cr, uid, option_ids, data, context=context)
3658+ else:
3659+ data.update(code=service_code,
3660+ postlogistics_type='delivery',
3661+ partner_id=postlogistics_partner.id)
3662+ carrier_option_obj.create(cr, uid, data, context=context)
3663+ lang = context.get('lang', 'en')
3664+ _logger.info("Updated delivery instrutions. [%s]" %(lang))
3665+
3666+ def _get_additional_services(self, cr, uid, ids, web_service,
3667+ company, service_code, context=None):
3668+ if context is None:
3669+ context = {}
3670+
3671+ lang = context.get('lang', 'en')
3672+ service_code_list = service_code.split(',')
3673+ res = web_service.read_additional_services(company, service_code_list, lang)
3674+ if 'errors' in res:
3675+ errors = '\n'.join(res['errors'])
3676+ error_message = (_('Could not retrieve Postlogistics base '
3677+ 'services:\n%s') % errors)
3678+ raise orm.except_orm(_('Error'), error_message)
3679+
3680+ if not res['value']:
3681+ return {}
3682+
3683+ if hasattr(res['value'], 'Errors') and res['value'].Errors:
3684+ for error in res['value'].Errors.Error:
3685+ message = '[%s] %s' % (error.Code, error.Message)
3686+ raise orm.except_orm('Error', message)
3687+
3688+ additional_services = {}
3689+ for service in res['value'].AdditionalService:
3690+ service_code = service.PRZL
3691+ additional_services[service_code] = {'name': service.Description}
3692+
3693+ return additional_services
3694+
3695+ def _update_additional_services(self, cr, uid, ids, web_service,
3696+ additional_services, context=None):
3697+ if context is None:
3698+ context = {}
3699+ ir_model_data_obj = self.pool.get('ir.model.data')
3700+ carrier_option_obj = self.pool.get('delivery.carrier.template.option')
3701+
3702+ postlogistics_partner = ir_model_data_obj.get_object(
3703+ cr, uid, 'delivery_carrier_label_postlogistics', 'postlogistics', context=context)
3704+
3705+ for service_code, data in additional_services.iteritems():
3706+
3707+ option_ids = carrier_option_obj.search(cr, uid, [
3708+ ('code', '=', service_code),
3709+ ('postlogistics_type', '=', 'additional')
3710+ ], context=context)
3711+
3712+ if option_ids:
3713+ carrier_option_obj.write(cr, uid, option_ids, data, context=context)
3714+ else:
3715+ data.update(code=service_code,
3716+ postlogistics_type='additional',
3717+ partner_id=postlogistics_partner.id)
3718+ carrier_option_obj.create(cr, uid, data, context=context)
3719+ lang = context.get('lang', 'en')
3720+ _logger.info("Updated additional services [%s]" % (lang))
3721+
3722+ def _update_basic_services(self, cr, uid, ids, web_service, company, group_id, context=None):
3723+ """ Update of basic services
3724+
3725+ A basic service can be part only of one service group
3726+
3727+ :return: {additional_services: {<service_code>: service_data}
3728+ delivery_instructions: {<service_code>: service_data}
3729+ }
3730+
3731+ """
3732+ if context is None:
3733+ context = {}
3734+ ir_model_data_obj = self.pool.get('ir.model.data')
3735+ service_group_obj = self.pool.get('postlogistics.service.group')
3736+ carrier_option_obj = self.pool.get('delivery.carrier.template.option')
3737+
3738+ xmlid = 'delivery_carrier_label_postlogistics', 'postlogistics'
3739+ postlogistics_partner = ir_model_data_obj.get_object(
3740+ cr, uid, *xmlid, context=context)
3741+ lang = context.get('lang', 'en')
3742+
3743+ group = service_group_obj.browse(cr, uid, group_id, context=context)
3744+
3745+ res = web_service.read_basic_services(company, group.group_extid, lang)
3746+ if 'errors' in res:
3747+ errors = '\n'.join(res['errors'])
3748+ error_message = (_('Could not retrieve Postlogistics base '
3749+ 'services:\n%s') % errors)
3750+ raise orm.except_orm(_('Error'), error_message)
3751+
3752+ additional_services = {}
3753+ delivery_instructions = {}
3754+ # Create or update basic service
3755+ for service in res['value'].BasicService:
3756+ service_code = ','.join(service.PRZL)
3757+ option_ids = carrier_option_obj.search(cr, uid, [
3758+ ('code', '=', service_code),
3759+ ('postlogistics_service_group_id', '=', group_id),
3760+ ('postlogistics_type', '=', 'basic')
3761+ ], context=context)
3762+ data = {'name': service.Description}
3763+ if option_ids:
3764+ carrier_option_obj.write(cr, uid, option_ids, data, context=context)
3765+ option_id = option_ids[0]
3766+ else:
3767+ data.update(code=service_code,
3768+ postlogistics_service_group_id=group_id,
3769+ partner_id=postlogistics_partner.id,
3770+ postlogistics_type='basic')
3771+ option_id = carrier_option_obj.create(cr, uid, data, context=context)
3772+
3773+ # Get related services
3774+ allowed_services = self._get_additional_services(
3775+ cr, uid, ids, web_service, company, service_code, context=context)
3776+ for key, value in additional_services.iteritems():
3777+ if key in allowed_services:
3778+ additional_services[key]['postlogistics_basic_service_ids'][0][2].append(option_id)
3779+ del allowed_services[key]
3780+ for key, value in allowed_services.iteritems():
3781+ additional_services[key] = value
3782+ additional_services[key]['postlogistics_basic_service_ids'] = [(6, 0, [option_id])]
3783+
3784+ allowed_services = self._get_delivery_instructions(
3785+ cr, uid, ids, web_service, company, service_code, context=context)
3786+ for key, value in delivery_instructions.iteritems():
3787+ if key in allowed_services:
3788+ delivery_instructions[key]['postlogistics_basic_service_ids'][0][2].append(option_id)
3789+ del allowed_services[key]
3790+ for key, value in allowed_services.iteritems():
3791+ delivery_instructions[key] = value
3792+ delivery_instructions[key]['postlogistics_basic_service_ids'] = [(6, 0, [option_id])]
3793+
3794+ _logger.info("Updated '%s' basic service [%s]." % (group.name, lang))
3795+ return {'additional_services': additional_services,
3796+ 'delivery_instructions': delivery_instructions}
3797+
3798+ def _update_service_groups(self, cr, uid, ids, web_service, company, context=None):
3799+ """ Also updates additional services and delivery instructions
3800+ as they are shared between groups
3801+
3802+ """
3803+ if context is None:
3804+ context = {}
3805+ service_group_obj = self.pool.get('postlogistics.service.group')
3806+
3807+ lang = context.get('lang', 'en')
3808+
3809+ res = web_service.read_service_groups(company, lang)
3810+ if 'errors' in res:
3811+ errors = '\n'.join(res['errors'])
3812+ error_message = (_('Could not retrieve Postlogistics group '
3813+ 'services:\n%s') % errors)
3814+ raise orm.except_orm(_('Error'), error_message)
3815+
3816+ additional_services = {}
3817+ delivery_instructions = {}
3818+
3819+ # Create or update groups
3820+ for group in res['value'].ServiceGroup:
3821+ group_extid = group.ServiceGroupID
3822+ group_ids = service_group_obj.search(
3823+ cr, uid, [('group_extid', '=', group_extid)], context=context)
3824+ data = {'name': group.Description}
3825+ if group_ids:
3826+ service_group_obj.write(cr, uid, group_ids, data, context=context)
3827+ group_id = group_ids[0]
3828+ else:
3829+ data['group_extid'] = group_extid
3830+ group_id = service_group_obj.create(cr, uid, data, context=context)
3831+
3832+ # Get related services for all basic services of this group
3833+ res = self._update_basic_services(cr, uid, ids, web_service,
3834+ company, group_id, context=context)
3835+
3836+ allowed_services = res.get('additional_services', {})
3837+ for key, value in additional_services.iteritems():
3838+ if key in allowed_services:
3839+ option_ids = allowed_services[key]['postlogistics_basic_service_ids'][0][2]
3840+ additional_services[key]['postlogistics_basic_service_ids'][0][2].extend(option_ids)
3841+ del allowed_services[key]
3842+ additional_services.update(allowed_services)
3843+
3844+ allowed_services = res.get('delivery_instructions', {})
3845+ for key, value in delivery_instructions.iteritems():
3846+ if key in allowed_services:
3847+ option_ids = allowed_services[key]['postlogistics_basic_service_ids'][0][2]
3848+ delivery_instructions[key]['postlogistics_basic_service_ids'][0][2].extend(option_ids)
3849+ del allowed_services[key]
3850+ delivery_instructions.update(allowed_services)
3851+
3852+ # Update related services
3853+ self._update_additional_services(cr, uid, ids, web_service,
3854+ additional_services, context=context)
3855+ self._update_delivery_instructions(cr, uid, ids, web_service,
3856+ delivery_instructions, context=context)
3857+
3858+ def update_postlogistics_options(self, cr, uid, ids, context=None):
3859+ """ This action will update all postlogistics option by
3860+ importing services from PostLogistics WebService API
3861+
3862+ The object we create are 'delivey.carrier.template.option'
3863+
3864+ """
3865+ if context is None:
3866+ context = {}
3867+ user_obj = self.pool.get('res.users')
3868+ for config in self.browse(cr, uid, ids, context=context):
3869+ company = config.company_id
3870+ web_service = PostlogisticsWebService(company)
3871+
3872+ # make sure we create source text in en_US
3873+ ctx = context.copy()
3874+ ctx['lang'] = 'en_US'
3875+ self._update_service_groups(cr, uid, ids, web_service, company, context=ctx)
3876+
3877+ language_obj = self.pool.get('res.lang')
3878+ language_ids = language_obj.search(cr, uid, [], context=context)
3879+
3880+ languages = language_obj.browse(cr, uid, language_ids, context=context)
3881+
3882+ # handle translations
3883+ # we call the same methode with a different language context
3884+ for lang_br in languages:
3885+ lang = lang_br.code
3886+ ctx = context.copy()
3887+ ctx['lang'] = lang_br.code
3888+ postlogistics_lang = web_service._get_language(lang)
3889+ # add translations only for languages that exists on postlogistics
3890+ # english source will be kept for other languages
3891+ if postlogistics_lang == 'en':
3892+ continue
3893+ self._update_service_groups(cr, uid, ids, web_service, company, context=ctx)
3894+ return True
3895
3896=== added file 'delivery_carrier_label_postlogistics/res_config_view.xml'
3897--- delivery_carrier_label_postlogistics/res_config_view.xml 1970-01-01 00:00:00 +0000
3898+++ delivery_carrier_label_postlogistics/res_config_view.xml 2014-01-13 11:23:36 +0000
3899@@ -0,0 +1,110 @@
3900+<?xml version="1.0" encoding="utf-8"?>
3901+<openerp>
3902+ <data>
3903+
3904+ <record id="view_postlogistics_config_settings" model="ir.ui.view">
3905+ <field name="name">postlogistics settings</field>
3906+ <field name="model">postlogistics.config.settings</field>
3907+ <field name="arch" type="xml">
3908+ <form string="Configure Postlogistics" version="7.0" class="oe_form_configuration">
3909+ <header>
3910+ <button string="Apply" type="object" name="execute" class="oe_highlight"/>
3911+ or
3912+ <button string="Cancel" type="object" name="cancel" class="oe_link"/>
3913+ </header>
3914+
3915+ <group groups="base.group_multi_company">
3916+ <div>
3917+ <div>
3918+ <label for="company_id" string="Select Company"/>
3919+ <field name="company_id"
3920+ widget="selection"
3921+ on_change="onchange_company_id(company_id, context)"
3922+ class="oe_inline"/>
3923+ </div>
3924+ </div>
3925+ </group>
3926+ <separator string="Web Service Authentification"/>
3927+ <group>
3928+ <div>
3929+ <div>
3930+ <label for="username"/>
3931+ <field name="username" class="oe_inline"/>
3932+ </div>
3933+ <div>
3934+ <label for="password"/>
3935+ <field name="password" class="oe_inline"/>
3936+ </div>
3937+ </div>
3938+ </group>
3939+ <separator string="Licenses"/>
3940+ <group>
3941+ <div>
3942+ <div>
3943+ <label for="license_less_1kg"/>
3944+ <field name="license_less_1kg" class="oe_inline"/>
3945+ </div>
3946+ <div>
3947+ <label for="license_more_1kg"/>
3948+ <field name="license_more_1kg" class="oe_inline"/>
3949+ </div>
3950+ <div>
3951+ <label for="license_vinolog"/>
3952+ <field name="license_vinolog" class="oe_inline"/>
3953+ </div>
3954+ </div>
3955+ </group>
3956+ <separator string="Sender Informations"/>
3957+ <group>
3958+ <div>
3959+ <div>
3960+ <label for="logo"/>
3961+ <field name="logo" widget="image"/>
3962+ </div>
3963+ <div>
3964+ <label for="office"/>
3965+ <field name="office" class="oe_inline"/>
3966+ </div>
3967+ </div>
3968+ </group>
3969+ <separator string="Default configs"/>
3970+ <group>
3971+ <div>
3972+ <div>
3973+ <label for="default_label_layout"/>
3974+ <field name="default_label_layout" class="oe_inline"/>
3975+ </div>
3976+ <div>
3977+ <label for="default_output_format"/>
3978+ <field name="default_output_format" class="oe_inline"/>
3979+ </div>
3980+ <div>
3981+ <label for="default_resolution"/>
3982+ <field name="default_resolution" class="oe_inline"/>
3983+ </div>
3984+ </div>
3985+ </group>
3986+ <group>
3987+ <div>
3988+ <div>
3989+ <button string="Update PostLogistics Services" type="object" name="update_postlogistics_options" class="oe_highlight"/>
3990+ </div>
3991+ </div>
3992+ </group>
3993+ </form>
3994+ </field>
3995+ </record>
3996+
3997+ <record id="action_postlogistics_config" model="ir.actions.act_window">
3998+ <field name="name">Configure Postlogistics</field>
3999+ <field name="type">ir.actions.act_window</field>
4000+ <field name="res_model">postlogistics.config.settings</field>
4001+ <field name="view_mode">form</field>
4002+ <field name="target">inline</field>
4003+ </record>
4004+
4005+ <menuitem id="menu_postlogistics_config" name="Postlogistics" parent="base.menu_config"
4006+ sequence="20" action="action_postlogistics_config"/>
4007+
4008+ </data>
4009+</openerp>
4010
4011=== added file 'delivery_carrier_label_postlogistics/res_partner_data.xml'
4012--- delivery_carrier_label_postlogistics/res_partner_data.xml 1970-01-01 00:00:00 +0000
4013+++ delivery_carrier_label_postlogistics/res_partner_data.xml 2014-01-13 11:23:36 +0000
4014@@ -0,0 +1,134 @@
4015+<?xml version="1.0" encoding="utf-8"?>
4016+<openerp>
4017+ <data noupdate="1">
4018+ <record id="postlogistics" model="res.partner">
4019+ <field name="image">/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAMCA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VIBto20UVQBt
4140+o20UVIBto20UUAG2jbRRQAbaNtFFABto20UVQBto20UUAG2jbRRQAbaNtFFABto20UVIBtoooqgP
4141+/9k=</field>
4142+ <field name="name">PostLogistics</field>
4143+ <field name="customer" eval="False"/>
4144+ <field name="supplier" eval="False"/>
4145+ <field name="email">webservice@post.ch</field>
4146+ </record>
4147+ </data>
4148+</openerp>
4149
4150=== added directory 'delivery_carrier_label_postlogistics/security'
4151=== added file 'delivery_carrier_label_postlogistics/security/ir.model.access.csv'
4152--- delivery_carrier_label_postlogistics/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
4153+++ delivery_carrier_label_postlogistics/security/ir.model.access.csv 2014-01-13 11:23:36 +0000
4154@@ -0,0 +1,3 @@
4155+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
4156+access_postlogistics_service_group_salesman,postlogistics.service.group.salesman,model_postlogistics_service_group,base.group_sale_salesman,1,0,0,0
4157+access_postlogistics_service_group_manager,postlogistics.service.group.manager,model_postlogistics_service_group,base.group_sale_manager,1,1,1,1
4158
4159=== added file 'delivery_carrier_label_postlogistics/stock.py'
4160--- delivery_carrier_label_postlogistics/stock.py 1970-01-01 00:00:00 +0000
4161+++ delivery_carrier_label_postlogistics/stock.py 2014-01-13 11:23:36 +0000
4162@@ -0,0 +1,115 @@
4163+# -*- coding: utf-8 -*-
4164+##############################################################################
4165+#
4166+# Author: Yannick Vaucher
4167+# Copyright 2013 Camptocamp SA
4168+#
4169+# This program is free software: you can redistribute it and/or modify
4170+# it under the terms of the GNU Affero General Public License as
4171+# published by the Free Software Foundation, either version 3 of the
4172+# License, or (at your option) any later version.
4173+#
4174+# This program is distributed in the hope that it will be useful,
4175+# but WITHOUT ANY WARRANTY; without even the implied warranty of
4176+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4177+# GNU Affero General Public License for more details.
4178+#
4179+# You should have received a copy of the GNU Affero General Public License
4180+# along with this program. If not, see <http://www.gnu.org/licenses/>.
4181+#
4182+##############################################################################
4183+from openerp.osv import orm, fields
4184+
4185+from postlogistics.web_service import PostlogisticsWebService
4186+
4187+
4188+class stock_picking(orm.Model):
4189+ _inherit = 'stock.picking'
4190+
4191+ def _generate_postlogistics_label(self, cr, uid, picking,
4192+ webservice_class=None, context=None):
4193+ """ Generate labels and write tracking numbers received """
4194+ user_obj = self.pool.get('res.users')
4195+ user = user_obj.browse(cr, uid, uid, context=context)
4196+ company = user.company_id
4197+ if webservice_class is None:
4198+ webservice_class = PostlogisticsWebService
4199+
4200+ web_service = webservice_class(company)
4201+ res = web_service.generate_label(picking, user.lang)
4202+
4203+ if 'errors' in res:
4204+ raise orm.except_orm('Error', '\n'.join(res['errors']))
4205+
4206+ trackings = set([line.tracking_id for line in picking.move_lines])
4207+
4208+ labels = []
4209+ # if there are no pack defined, write tracking_number on picking
4210+ # otherwise, write it on serial field of each pack
4211+ for track in trackings:
4212+ if not track:
4213+ # ignore lines without tracking when there is tracking
4214+ # in a picking
4215+ if len(trackings) > 1:
4216+ continue
4217+ label = res['value'][0]
4218+ tracking_number = label['tracking_number']
4219+ self.write(cr, uid, picking.id,
4220+ {'carrier_tracking_ref': tracking_number},
4221+ context=context)
4222+ else:
4223+ label = None
4224+ for search_label in res['value']:
4225+ if track.name in search_label['item_id'].split('+')[-1]:
4226+ label = search_label
4227+ tracking_number = label['tracking_number']
4228+ track.write({'serial': tracking_number})
4229+ break
4230+ labels.append({'tracking_id': track and track.id or False,
4231+ 'file': label['binary'].decode('base64'),
4232+ 'file_type': label['file_type'],
4233+ 'name': tracking_number,
4234+ })
4235+
4236+ return labels
4237+
4238+ def generate_shipping_labels(self, cr, uid, ids, context=None):
4239+ """ Add label generation for Postlogistics """
4240+ if isinstance(ids, (long, int)):
4241+ ids = [ids]
4242+ assert len(ids) == 1
4243+ picking = self.browse(cr, uid, ids[0], context=context)
4244+ if picking.carrier_id.type == 'postlogistics':
4245+ return self._generate_postlogistics_label(cr, uid, picking,
4246+ context=context)
4247+ return super(stock_picking, self
4248+ ).generate_shipping_labels(cr, uid, ids, context=context)
4249+
4250+
4251+class ShippingLabel(orm.Model):
4252+ """ Child class of ir attachment to identify which are labels """
4253+ _inherit = 'shipping.label'
4254+
4255+ def _get_file_type_selection(self, cr, uid, context=None):
4256+ """ Return a sorted list of extensions of label file format
4257+
4258+ :return: list of tuple (code, name)
4259+
4260+ """
4261+ file_types = super(ShippingLabel, self
4262+ )._get_file_type_selection(cr, uid, context=context)
4263+ new_types = [('eps', 'EPS'),
4264+ ('gif', 'GIF'),
4265+ ('jpg', 'JPG'),
4266+ ('png', 'PNG'),
4267+ ('pdf', 'PDF'),
4268+ ('spdf', 'sPDF'),
4269+ ('zpl2', 'ZPL2')]
4270+ add_types = [t for t in new_types if not t in file_types]
4271+ file_types.extend(add_types)
4272+ file_types.sort(key=lambda t: t[0])
4273+ return file_types
4274+
4275+ _columns = {
4276+ 'file_type': fields.selection(_get_file_type_selection, 'File type')
4277+ }

Subscribers

People subscribed via source and target branches