Repository
OCA/delivery-carrier · module folder · Try on Runboat
Module version
2.0.0
Category
Delivery
Folder size
2.96 MB
License
AGPL-3
Application
Yes
Auto-installable
No
Website
https://github.com/OCA/delivery-carrier
Last tracking update
2026-08-07 08:42:52
Authors
Camptocamp, Odoo Community Association (OCA)
Maintainers
Camptocamp
Committers
Simone Orsi, Guewen Baconnier, Akim Juillerat, Maksym Yankin, Weblate, OCA-git-bot, oca-ci, Mmequignon, Camille Morand, Bhavesh Heliconia, Hadrien Huvelle
Odoo dependencies
Python dependencies
openupgradelib
System dependencies
None
Required by
delivery_postlogistics_dangerous_goods, delivery_postlogistics_server_env
Description
This module uses [PostLogistics BarCodes
WebService](https://www.post.ch/en/business/a-z-of-subjects/dropping-off-mail-items/business-sending-letters/sending-consignments-web-service-barcode)
to generate labels for your Delivery Orders.

It adds a Create label button on Delivery Orders. A generated label will
be an attachement of your Delivery Order.

To see it, please install documents module.

You can create multiple delivery method to match your diffent package
types.

Code Analysis

Views touched (6)
XML IDNameModelTypeStatus
delivery_carrier_postlogistics_inherit_view delivery.carrier form Inherits delivery.view_delivery_carrier_form
postlogistics_license_view_list postlogistics.license.list.view postlogistics.license list New
stock_package_type_form_delivery stock.package.type form Inherits stock_delivery.stock_package_type_form_delivery
view_partner_property_form res.partner form Inherits delivery.view_partner_property_form
view_picking_withcarrier_out_form stock.picking form Inherits stock_delivery.view_picking_withcarrier_out_form
view_quant_package_form stock.quant.package form Inherits stock.view_quant_package_form
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (9)

New fields (14)
  • delivery_type Selection
    ondelete={'postlogistics': 'set default'} selection_add=[('postlogistics', 'PostLogistics')]
  • postlogistics_client_id Char
    groups='base.group_system' string='Client ID'
  • postlogistics_client_secret Char
    groups='base.group_system' string='Client Secret'
  • postlogistics_default_package_type_id Many2one → stock.package.type
    default=<expr> domain=[('package_carrier_type', '=', 'postlogistics')] args: 'stock.package.type'
  • postlogistics_endpoint_url Char
    required=False string='Endpoint URL'
  • postlogistics_label_layout Many2one → delivery.carrier.template.option
    comodel_name='delivery.carrier.template.option' domain=[('type', '=', 'label_layout')] string='Label layout'
  • postlogistics_license_id Many2one → postlogistics.license
    comodel_name='postlogistics.license' string='Franking License'
  • postlogistics_logo Binary
    help='Optional company logo to show on label.\nIf using an image / logo, please note the following:\n– Image width: 47 mm\n– Image height: 25 mm\n– File size: max. 30 kb\n– File format: GIF or PNG\n– Colour table: indexed colours, max. 200 colours\n– The logo will be printed rotated counter-clockwise by 90°\nWe recommend using a black and white logo for printing in the ZPL2 format.' string='Company Logo on Post labels'
  • postlogistics_office Char
    help='Post office which will receive the shipped goods' string='Domicile Post office'
  • postlogistics_output_format Many2one → delivery.carrier.template.option
    comodel_name='delivery.carrier.template.option' domain=[('type', '=', 'output_format')] string='Output format'
  • postlogistics_proclima_logo Boolean
    help='The “pro clima” logo indicates an item for which the surcharge for carbon-neutral shipping has been paid and a contract to that effect has been signed. For Letters with barcode (BMB) domestic, the ProClima logo is printed automatically (at no additional charge)' args: 'Print ProClima logo'
  • postlogistics_resolution Many2one → delivery.carrier.template.option
    comodel_name='delivery.carrier.template.option' domain=[('type', '=', 'resolution')] string='Resolution'
  • postlogistics_tracking_format Selection
    default='postlogistics' help='Allows you to define how the ItemNumber (the last 8 digits) of the tracking number will be generated:\n- Default postlogistics numbers: The webservice generates it for you.\n- Picking number with pack counter: Generate it using the digits of picking name and add the pack number. 2 digits forpack number and 6 digits for picking number. (eg. 07000042 for picking 42 and 7th pack' string='Tracking number format' args: [('postlogistics', 'Use default postlogistics tracking numbers'), ('picking_num', 'Use picking number with pack counter')]
  • zpl_patch_string Char
    default='^XA^CW0,E:TT0003M_.TTF^XZ^XA^CI28' string='ZPL Patch String'
Public methods (6)
  • postlogistics_cancel_shipment(self, pickings)
  • postlogistics_get_return_label(self, picking, tracking_number=None, origin_date=None)
  • postlogistics_get_tracking_link(self, picking)
  • postlogistics_rate_shipment(self, order)
  • postlogistics_send_shipping(self, pickings)
    It will generate the labels for all the packages of the picking. Packages are mandatory in this case
  • verify_credentials(self)

New fields (1)
  • type Selection
    ondelete={'label_layout': 'set default', 'output_format': 'set default', 'resolution': 'set default'} selection_add=['basic', ('label_layout', 'Label Layout'), ('output_format', 'Output Format'), ('resolution', 'Output Resolution')]
Public methods (0)

No public methods.

New fields (4)
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> required=True string='Company'
  • name Char
    required=True translate=True
  • number Char
    required=True
  • sequence Integer
    help='Gives the sequence on company to define priority on license when multiple licenses are available for the same group of service.'
Public methods (0)

No public methods.

New fields (2)
  • delivery_carrier_template_option_ids Many2many → delivery.carrier.template.option
    column1='partner_id' column2='option_id' relation='delivery_carrier_template_options_res_partners_rel' string='Postlogistics Options' args: 'delivery.carrier.template.option'
  • postlogistics_notification Selection
    default='disabled' args: [('disabled', 'Disabled'), ('email', 'Email'), ('sms', 'Mobile SMS'), ('phone', 'Phone Call')]
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (1)
  • package_carrier_type Selection
    ondelete={'postlogistics': 'set default'} selection_add=[('postlogistics', 'PostLogistics')]
Public methods (0)

No public methods.

New fields (4)
  • delivery_fixed_date Date
    help='Specific delivery date (ZAW3217)' args: 'Fixed delivery date'
  • delivery_mobile Char
    help='For notify delivery by telephone (ZAW3213)' args: 'Mobile'
  • delivery_phone Char
    help='For notify delivery by telephone (ZAW3213)' args: 'Phone'
  • delivery_place Char
    help='For Deposit item service (ZAW3219)'
Public methods (13)
  • action_generate_carrier_label(self)
  • attach_shipping_label(self, label)
    Attach a label returned by generate_shipping_labels to a picking
  • generate_postlogistics_shipping_labels(self, packages=None)
    Add label generation for PostLogistics
  • get_package_number_hook(self, package)
    Hook method to customize the package number retrieval
  • get_recipient_partner_hook(self)
    Hook method to customize the partner retrieval
  • info_from_label(self, label, zpl_patch_string=False, package_id=False)
  • postlogistics_cod_amount(self)
    Return the PostLogistics Cash on Delivery amount of a picking If the picking delivers the whole sales order, we use the total amount of the sales order. Otherwise, we don't know the value of each picking so we raise an error. The user has to create packages with the cash on delivery price on each package.
  • postlogistics_label_cash_on_delivery(self, package=None)
  • postlogistics_label_get_item_additional_data(self, package=None)
  • postlogistics_label_prepare_attributes(self, pack=None, pack_num=None, pack_total=None, pack_weight=None)
    This method aims to prepare a dictionary of attributes to be sent to the PostLogistics API
  • postlogistics_label_prepare_customer(self)
    Create a ns0:Customer as a dict from picking This is the PostLogistics Customer, thus the sender :param picking: picking browse record :return a dict containing data for ns0:Customer
  • postlogistics_label_prepare_recipient(self, sanitize_mapping=None)
    Create a ns0:Recipient as a dict from a partner :param partner: partner browse record :return a dict containing data for ns0:Recipient
  • write_tracking_number_label(self, label_result, packages)
    If there are no pack defined, write tracking_number on picking otherwise, write it on parcel_tracking field of each pack. Note we can receive multiple labels for a same package

New fields (3)
  • package_carrier_type Selection
    related='package_type_id.package_carrier_type' string="Packaging's Carrier"
  • parcel_tracking Char
  • postlogistics_manual_cod_amount Float
    help='If the cash on delivery amount for this package is different than the total of the sales order, write the amount there.' args: 'PostLogistics Cash On Delivery Amount'
Public methods (1)
  • postlogistics_cod_amount(self)
    Return the PostLogistics Cash on Delivery amount of a package If we have only 1 package which delivers the whole sales order we use the total amount of the sales order. Otherwise we don't know the value of each package so we raise an error and the user has to write the prices on the packages. When a price is manually set on a package, it's always used as the cash on delivery amount.

New fields (0)

No new fields.

Public methods (0)

No public methods.

Loading…

Loading…

Loading…