Skip to content

terhoy/picking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dolibarr – Picking Module

A free, open-source Dolibarr module that adds warehouse location and user information as substitution variables to shipment (expedition) ODT documents, such as picking lists.

Features

  • Adds {picking_*} and {line_*} substitution variables to shipment ODT templates
  • Warehouse reference and description per shipment line
  • Product reference and label per line
  • Customer name, creation date, and creating-user details on the shipment header
  • Formatted picking reference number with configurable prefix (e.g. PKL-000042)
  • Ready-to-use ODT templates in Norwegian (nb_NO) and English (en_US)
  • Full internationalisation via .lang files (English + Norwegian included)
  • Debug mode controlled by a Dolibarr constant (no code changes required)
  • No database schema changes – purely substitution-based
  • Follows all Dolibarr module conventions

Substitution variables

Shipment / expedition level

Variable Description
{picking_ref} Formatted picking reference (e.g. PKL-000042)
{picking_customer_name} Third-party / customer name
{object_date_creation_locale} Shipment creation date, locale-formatted
{picking_user_fullname} Full name of the creating user
{picking_user_login} Login of the creating user
{picking_user_firstname} First name of the creating user
{picking_user_lastname} Last name of the creating user

Line level

Variable Description
{line_warehouse} Warehouse reference (e.g. Valand låve)
{line_warehouse_desc} Warehouse description
{line_product_ref} Product reference code
{line_product_label} Product label / name

Debug variables ({picking_debug}, {picking_debug_id}, {line_debug_id}, {line_debug_entrepot}) are only populated when the Dolibarr constant PICKING_DEBUG is set to 1. Always disable in production.

Requirements

  • Dolibarr ≥ 15.0
  • PHP ≥ 7.4
  • Modules Expedition (Shipments) and Stock must be active

Installation

Option A – Download ZIP (GitHub)

When downloading a ZIP from GitHub, the folder is named Dolibarr-Picking-Module-main/ (or similar). It must be renamed to picking/ before copying, otherwise Dolibarr will not find the module.

  1. Download and unpack the ZIP archive.
  2. Rename the unpacked folder to picking.
  3. Copy the picking/ folder into <dolibarr_root>/htdocs/custom/:
    htdocs/custom/picking/
    
  4. Log in as administrator and go to Home → Setup → Modules.
  5. Find Picking (or Plukkliste) in the Technical tools category and click Activate.
  6. The ODT templates are now available automatically in shipment documents.

Note: Verify that your Dolibarr installation has the custom/ directory enabled. The following two lines must be present in conf/conf.php:

$dolibarr_main_url_root_alt='/custom';
$dolibarr_main_document_root_alt='/path/to/htdocs/custom';

Option B – Git clone (recommended for self-hosters)

cd <dolibarr_root>/htdocs/custom
git clone https://github.com/terhoy/Dolibarr-Picking-Module picking

Then activate the module from the Dolibarr admin interface as described above.

Using the ODT templates

After activation, the module automatically registers the templates/ directory so Dolibarr can find the included ODT files. To use them:

  1. Open a shipment (expedition) in Dolibarr.
  2. In the document section, select generic_shipment_odt as the document model if not already set.
  3. In the template dropdown, choose picking_list_nb_NO.odt (Norwegian) or picking_list_en_US.odt (English) and click Generate.

You can also upload your own ODT template (e.g. PLUKKLISTE.odt) via Shipments → Setup → ODT templates.

Configuration

After activation, go to Home → Setup → Modules → Picking → Setup to configure:

Constant Default Description
PICKING_REF_PREFIX PKL Prefix for picking reference numbers
PICKING_DEBUG 0 Set to 1 to enable debug substitution variables

Directory structure

picking/
├── README.md
├── LICENSE
├── CHANGELOG.md
├── admin/
│   └── setup.php                      # Module configuration page
├── class/
│   └── actions_picking.class.php      # Hook handler class (extend as needed)
├── core/
│   ├── modules/
│   │   └── modPicking.class.php       # Module descriptor
│   └── substitutions/
│       └── functions_picking.lib.php  # Substitution functions
├── img/
│   └── object_picking.png             # Module icon (32×32 px)
├── langs/
│   ├── en_US/
│   │   └── picking.lang               # English translations
│   └── nb_NO/
│       └── picking.lang               # Norwegian Bokmål translations
└── templates/
    ├── picking_list_nb_NO.odt         # Norwegian picking list template
    ├── picking_list_en_US.odt         # English picking list template
    └── PLUKKLISTE.odt                 # Alternative Norwegian template

ODT template syntax

When creating your own ODT template, use the following syntax for repeating product lines. BEGIN and END tags must be in the same table row as the data variables, in the first and last cell respectively:

┌─────────────────────────────┬────────┬──────────────────┬──────────┐
│ Produkt                     │ Antall │ Lager            │ Plukket  │
├─────────────────────────────┼────────┼──────────────────┼──────────┤
│[!-- BEGIN row.lines --]     │        │                  │          │
│{line_product_label}         │{line_  │{line_warehouse}  │[!-- END  │
│                             │qty}    │                  │row.lines │
│                             │        │                  │--]       │
└─────────────────────────────┴────────┴──────────────────┴──────────┘

Important: When editing ODT files in Google Docs or Microsoft Word, always paste substitution variables as plain text and avoid editing inside an existing tag. Office applications can silently split tag text into fragments, making them unrecognisable to Dolibarr.

Contributing

Pull requests are welcome. Please open an issue first to discuss what you would like to change. All contributions must:

  • Follow Dolibarr coding standards
  • Include or update .lang entries for both en_US and nb_NO
  • Pass a manual test against Dolibarr ≥ 15

Licence

GPL-3.0 © terhoy

About

A free, open-source Dolibarr module that adds warehouse/picking substitution variables to shipment (expedition) documents, such as ODT picking lists.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages