details:   https://code.tryton.org/tryton/commit/51d3e0bcd5fb
branch:    default
user:      Cédric Krier <[email protected]>
date:      Mon Jan 26 15:42:27 2026 +0100
description:
        Add UNECE allowance, charge and special service code
diffstat:

 modules/edocument_unece/CHANGELOG                      |    1 +
 modules/edocument_unece/doc/design.rst                 |   15 +
 modules/edocument_unece/product.py                     |  396 +++++++++++++++++
 modules/edocument_unece/product.xml                    |    6 +
 modules/edocument_unece/tryton.cfg                     |    3 +-
 modules/edocument_unece/view/product_template_form.xml |   12 +
 6 files changed, 432 insertions(+), 1 deletions(-)

diffs (494 lines):

diff -r c8c9393ee249 -r 51d3e0bcd5fb modules/edocument_unece/CHANGELOG
--- a/modules/edocument_unece/CHANGELOG Mon Jan 26 12:08:41 2026 +0100
+++ b/modules/edocument_unece/CHANGELOG Mon Jan 26 15:42:27 2026 +0100
@@ -1,3 +1,4 @@
+* Add allowance, charge and special service code
 
 Version 7.8.0 - 2025-12-15
 --------------------------
diff -r c8c9393ee249 -r 51d3e0bcd5fb modules/edocument_unece/doc/design.rst
--- a/modules/edocument_unece/doc/design.rst    Mon Jan 26 12:08:41 2026 +0100
+++ b/modules/edocument_unece/doc/design.rst    Mon Jan 26 15:42:27 2026 +0100
@@ -18,6 +18,21 @@
    The `Unit of Measure <product:model-product.uom>` concept is introduced by
    the :doc:`Product Module <product:index>`.
 
+.. _concept-product:
+
+Product
+=======
+
+The *Product* gains new properties to store the `UNECE code 5189
+<https://unece.org/fileadmin/DAM/trade/untdid/d16b/tred/tred5189.htm>`_ and the
+`UNECE code 7161
+<https://unece.org/fileadmin/DAM/trade/untdid/i98a/uncl/uncl7161.htm>`_
+
+.. seealso::
+
+   The `Product <product:concept-product>` concept is introduced by the
+   :doc:`Product Module <product:index>`.
+
 .. _model-account.tax:
 
 Tax
diff -r c8c9393ee249 -r 51d3e0bcd5fb modules/edocument_unece/product.py
--- a/modules/edocument_unece/product.py        Mon Jan 26 12:08:41 2026 +0100
+++ b/modules/edocument_unece/product.py        Mon Jan 26 15:42:27 2026 +0100
@@ -2,6 +2,381 @@
 # this repository contains the full copyright notices and license terms.
 from trytond.model import fields
 from trytond.pool import PoolMeta
+from trytond.pyson import Eval
+
+UNCL5189 = [
+    ('1', "Handling commission"),
+    ('2', "Amendment commission"),
+    ('3', "Acceptance commission"),
+    ('4', "Commission for obtaining acceptance"),
+    ('5', "Commission on delivery"),
+    ('6', "Advising commission"),
+    ('7', "Confirmation commission"),
+    ('8', "Deferred payment commission"),
+    ('9', "Commission for taking up documents"),
+    ('10', "Opening commission"),
+    ('11', "Fee for payment under reserve"),
+    ('12', "Discrepancy fee"),
+    ('13', "Domicilation commission"),
+    ('14', "Commission for release of goods"),
+    ('15', "Collection commission"),
+    ('16', "Negotiation commission"),
+    ('17', "Return commission"),
+    ('18', "B/L splitting charges"),
+    ('19', "Trust commission"),
+    ('20', "Transfer commission"),
+    ('21', "Commission for opening irrevocable documentary credits"),
+    ('22', "Pre-advice commission"),
+    ('23', "Supervisory commission"),
+    ('24', "Model charges"),
+    ('25', "Risk commission"),
+    ('26', "Guarantee commission"),
+    ('27', "Reimbursement commission"),
+    ('28', "Stamp duty"),
+    ('29', "Brokerage"),
+    ('30', "Bank charges"),
+    ('31', "Bank charges information"),
+    ('32', "Courier fee"),
+    ('33', "Phone fee"),
+    ('34', "Postage fee"),
+    ('35', "S.W.I.F.T. fee"),
+    ('36', "Telex fee"),
+    ('37', "Penalty for late delivery of documents"),
+    ('38', "Penalty for late delivery of valuation of works"),
+    ('39', "Penalty for execution of works behind schedule"),
+    ('40', "Other penalties"),
+    ('41', "Bonus for works ahead of schedule"),
+    ('42', "Other bonus"),
+    ('44', "Project management cost"),
+    ('45', "Pro rata retention"),
+    ('46', "Contractual retention"),
+    ('47', "Other retentions"),
+    ('48', "Interest on arrears"),
+    ('49', "Interest"),
+    ('50', "Charge per credit cover"),
+    ('51', "Charge per unused credit cover"),
+    ('52', "Minimum commission"),
+    ('53', "Factoring commission"),
+    ('54', "Chamber of commerce charge"),
+    ('55', "Transfer charges"),
+    ('56', "Repatriation charges"),
+    ('57', "Miscellaneous charges"),
+    ('58', "Foreign exchange charges"),
+    ('59', "Agreed debit interest charge"),
+    ('60', "Manufacturer's consumer discount"),
+    ('61', "Fax advice charge"),
+    ('62', "Due to military status"),
+    ('63', "Due to work accident"),
+    ('64', "Special agreement"),
+    ('65', "Production error discount"),
+    ('66', "New outlet discount"),
+    ('67', "Sample discount"),
+    ('68', "End-of-range discount"),
+    ('69', "Charge for a customer specific finish"),
+    ('70', "Incoterm discount"),
+    ('71', "Point of sales threshold allowance"),
+    ('72', "Technical modification costs"),
+    ('73', "Job-order production costs"),
+    ('74', "Off-premises costs"),
+    ('75', "Additional processing costs"),
+    ('76', "Attesting charge"),
+    ('77', "Rush delivery surcharge"),
+    ('78', "Special construction costs"),
+    ('79', "Freight charges"),
+    ('80', "Packing charge"),
+    ('81', "Repair charge"),
+    ('82', "Loading charge"),
+    ('83', "Setup charge"),
+    ('84', "Testing charge"),
+    ('85', "Warehousing charge"),
+    ('86', "Gold surcharge"),
+    ('87', "Copper surcharge"),
+    ('88', "Material surcharge/deduction"),
+    ('89', "Lead surcharge"),
+    ('90', "Price index surcharge"),
+    ('91', "Platinum surcharge"),
+    ('92', "Silver surcharge"),
+    ('93', "Wolfram surcharge"),
+    ('94', "Aluminum surcharge"),
+    ('95', "Discount"),
+    ('96', "Insurance"),
+    ('97', "Minimum order / minimum billing charge"),
+    ('98', "Material surcharge (special materials)"),
+    ('99', "Surcharge"),
+    ('100', "Special rebate"),
+    ('101', "Carbon footprint charge"),
+    ('102', "Fixed long term"),
+    ('103', "Temporary"),
+    ('104', "Standard"),
+    ('105', "Yearly turnover"),
+    ]
+UNCL7161 = [
+    ('AA', "Advertising allowance"),
+    ('AAA', "Telecommunication charges"),
+    ('AAB', "Returned goods charges"),
+    ('AAC', "Modification costs"),
+    ('AAD', "Job-order production"),
+    ('AAE', "Outlays"),
+    ('AAF', "Off-premises surcharge"),
+    ('AAG', "Gold surcharge"),
+    ('AAH', "Processing surcharge"),
+    ('AAI', "Attestation fee"),
+    ('AAJ', "Copper surcharge"),
+    ('AAK', "Energy surcharge"),
+    ('AAL', "Deduction for missing parts"),
+    ('AAM', "Rubber surcharge"),
+    ('AAN', "Brass surcharge"),
+    ('AAO', "Material surcharge/deduction"),
+    ('AAP', "Lead surcharge"),
+    ('AAQ', "Price index surcharge"),
+    ('AAR', "Platinum surcharge"),
+    ('AAS', "Acceptance cost"),
+    ('AAT', "Rush delivery"),
+    ('AAU', "Selenium surcharge"),
+    ('AAV', "Special construction charge"),
+    ('AAW', "Deduction for delayed return"),
+    ('AAX', "Wolfram surcharge"),
+    ('AAY', "Airport fee"),
+    ('AAZ', "Concession fee"),
+    ('ABA', "Compulsory storage fee"),
+    ('ABB', "Defuel"),
+    ('ABC', "Into plane fee"),
+    ('ABD', "Overtime"),
+    ('ABE', "Reservicing charge"),
+    ('ABF', "Tooling cost"),
+    ('ABG', "Tooling charge"),
+    ('ABH', "Throughput allowance"),
+    ('ABI', "Superfund fee"),
+    ('ABJ', "Airport system fee"),
+    ('ABK', "Miscellaneous"),
+    ('ABL', "Packaging surcharge"),
+    ('ABM', "Scrap surcharge"),
+    ('ABN', "Dunnage charge"),
+    ('ABO', "Air freight transportation"),
+    ('ABP', "Carriage charge"),
+    ('ABQ', "Tonnage rebate"),
+    ('ABR', "Containerisation"),
+    ('ABS', "Carton packing"),
+    ('ABT', "Hessian wrapped"),
+    ('ABU', "Polyethylene wrap packing"),
+    ('ABV', "Miscellaneous customs charge"),
+    ('ABW', "Customs duty charge"),
+    ('ABX', "Miscellaneous special tooling charge"),
+    ('ABY', "Tooling amortisation"),
+    ('ABZ', "Miscellaneous rebate or discount"),
+    ('ACA', "Allowance"),
+    ('ACB', "Future discount off retail"),
+    ('ACC', "Miscellaneous setting costs (tooling)"),
+    ('ACD', "Minimum amount costs for quantity based surcharges"),
+    ('ACE', "Below schedule quantity after quantity-based surcharge"),
+    ('ACF', "Miscellaneous treatment"),
+    ('ACG', "Enamelling treatment"),
+    ('ACH', "Heat treatment"),
+    ('ACI', "Plating treatment"),
+    ('ACJ', "Painting"),
+    ('ACK', "Polishing"),
+    ('ACL', "Priming"),
+    ('ACM', "Preservation treatment"),
+    ('ACN', "Miscellaneous other surcharges"),
+    ('ACO', "Alloy surcharge"),
+    ('ACP', "Coke surcharge"),
+    ('ACQ', "Royalty surcharge"),
+    ('ACR', "Wheel handling charge"),
+    ('ACS', "Fitting surcharge"),
+    ('ACT', "Non-standard surcharge"),
+    ('ACU', "Standard surcharge"),
+    ('ACV', "Wheel surcharge"),
+    ('ACW', "Washer surcharge"),
+    ('ACX', "Ocean freight charge"),
+    ('ACY', "Container deposit charge"),
+    ('ACZ', "Damaged merchandise"),
+    ('ADA', "Bopsheet charge"),
+    ('ADB', "Drum deposit"),
+    ('ADC', "Consolidation"),
+    ('ADD', "Inland transportation"),
+    ('ADE', "Bill of lading charge"),
+    ('ADF', "Excise tax-destination"),
+    ('ADG', "Customs bond charge"),
+    ('ADH', "Per pound charge"),
+    ('ADI', "Royalties"),
+    ('ADJ', "Airbag charge"),
+    ('ADK', "Transfer charge"),
+    ('ADL', "Slipsheet charge"),
+    ('ADM', "Binding services"),
+    ('ADN', "Repair or replacement of broken returnable package"),
+    ('ADO', "Efficient logistics"),
+    ('ADP', "Merchandising"),
+    ('ADQ', "Product mix"),
+    ('ADR', "Other services"),
+    ('ADS', "Full pallet ordering"),
+    ('ADT', "Pick-up"),
+    ('ADU', "Handling by the 1st level sub-contractor"),
+    ('ADV', "Handling by the 2nd level sub-contractor"),
+    ('ADX', "Handling by the contractor"),
+    ('ADY', "New product introduction"),
+    ('ADZ', "Direct delivery"),
+    ('AEA', "Diversion"),
+    ('AEB', "Disconnect"),
+    ('AEC', "Distribution"),
+    ('AED', "Handling of hazardous cargo"),
+    ('AEF', "Rents and leases"),
+    ('AEG', "System usage"),
+    ('AEH', "Location differential"),
+    ('AEI', "Aircraft refueling"),
+    ('AEJ', "Fuel shipped into storage"),
+    ('AG ', "Silver surcharge"),
+    ('AJ ', "Adjustments"),
+    ('AL ', "Aluminium surcharge"),
+    ('AM ', "Additional material"),
+    ('AU ', "Authentication charge"),
+    ('CA ', "Cataloguing services"),
+    ('CAA', "Cancellation charge"),
+    ('CAB', "Cartage"),
+    ('CAC', "Cash discount"),
+    ('CAD', "Certification fee"),
+    ('CAE', "Certificate of conformance"),
+    ('CAF', "Certificate of origin"),
+    ('CAG', "Competitive allowance"),
+    ('CAH', "Competitive auto allowance"),
+    ('CAI', "Cutting charge"),
+    ('CAJ', "Consular costs"),
+    ('CAK', "Customer collection rebate"),
+    ('CB ', "Commission"),
+    ('CD ', "Car loading"),
+    ('CG ', "Cleaning charge"),
+    ('CK ', "COD charge"),
+    ('CL ', "Contract allowance"),
+    ('CO ', "Cents off"),
+    ('CP ', "Competitive price"),
+    ('CS ', "Cigarette stamping"),
+    ('CT ', "Count and recount"),
+    ('CW ', "Container allowance"),
+    ('DA ', "Defective allowance"),
+    ('DAA', "Deficit freight"),
+    ('DAB', "Layout/design"),
+    ('DAD', "Driver assigned unloading"),
+    ('DAE', "Distributor discount/allowance"),
+    ('DI ', "Discount"),
+    ('DL ', "Delivery"),
+    ('DM ', "Demurrage"),
+    ('EAA', "Early buy allowance"),
+    ('EAB', "Early payment allowance"),
+    ('EG ', "Engraving"),
+    ('EP ', "Expediting premium"),
+    ('ER ', "Exchange rate guarantee charge"),
+    ('EX ', "Export shipping charge"),
+    ('FA ', "Freight allowance"),
+    ('FAA', "Fabrication charge"),
+    ('FAB', "Freight equalization"),
+    ('FAC', "Freight surcharge"),
+    ('FC ', "Freight charge"),
+    ('FG ', "Free goods"),
+    ('FH ', "Filling/handling charge"),
+    ('FI ', "Finance charge"),
+    ('FN ', "Special finish charge"),
+    ('FR ', "Flat rate"),
+    ('GAA', "Grinding"),
+    ('HAA', "Hose charge"),
+    ('HD ', "Handling"),
+    ('HH ', "Hoisting and hauling"),
+    ('IA ', "Invoice adjustment"),
+    ('IAA', "Installation"),
+    ('IAB', "Installation and warranty"),
+    ('ID ', "Inside delivery charge"),
+    ('IF ', "Inspection fee"),
+    ('IN ', "Insurance"),
+    ('IR ', "Installation and training"),
+    ('IS ', "Invoice services"),
+    ('KO ', "Koshering"),
+    ('L1 ', "Shipper load, carrier count"),
+    ('LA ', "Labelling"),
+    ('LAA', "Labour charge"),
+    ('LAB', "Labour (repair and return orders)"),
+    ('LAC', "License fee"),
+    ('LF ', "Legalisation fee"),
+    ('LS ', "Local sales tax"),
+    ('MA ', "Material allowance (special materials)"),
+    ('MAA', "Mileage or travel"),
+    ('MAB', "Mileage fee (for repair and return)"),
+    ('MAC', "Minimum order/minimum billing charge"),
+    ('MAD', "Monthly rental"),
+    ('MAE', "Mounting"),
+    ('MC ', "Material surcharge (special materials)"),
+    ('MI ', "Mail invoice"),
+    ('ML ', "Mail invoice to each location"),
+    ('NAA', "Non-returnable containers"),
+    ('OA ', "Outside cable connectors"),
+    ('OAA', "Overtime loading"),
+    ('PA ', "Pack invoice with shipment"),
+    ('PAA', "Phosphatizing (steel treatment)"),
+    ('PAB', "Postage charge"),
+    ('PAC', "Premium charge"),
+    ('PAD', "Promotional allowance"),
+    ('PAE', "Promotional discount"),
+    ('PC ', "Packing"),
+    ('PD ', "Palladium surcharge"),
+    ('PI ', "Pick-up allowance"),
+    ('PL ', "Palletizing"),
+    ('PN ', "Pallet charge"),
+    ('PO ', "Per order charge"),
+    ('QAA', "Quantity surcharge"),
+    ('QD ', "Quantity discount"),
+    ('RAA', "Rebate"),
+    ('RAB', "Repack charge"),
+    ('RAC', "Repair"),
+    ('RAD', "Returnable container"),
+    ('RAE', "Resellers discount"),
+    ('RAF', "Restocking charge"),
+    ('RAG', "Roll rebate"),
+    ('RAH', "Road/rail tanker rebate"),
+    ('RE ', "Re-delivery charge"),
+    ('RF ', "Refurbishing charge"),
+    ('RH ', "Rail wagon hire"),
+    ('RO ', "Roe allowance/charge"),
+    ('RP ', "Repair charge"),
+    ('RV ', "Freight charge/costs of loading"),
+    ('SA ', "Salvage"),
+    ('SAA', "Shipping and handling"),
+    ('SAB', "Special allowance"),
+    ('SAC', "Special credit"),
+    ('SAD', "Special packaging"),
+    ('SAE', "Stamping"),
+    ('SAF', "Supplemental items"),
+    ('SAG', "Surcharge (dollar value)"),
+    ('SAH', "Surcharge (percentage)"),
+    ('SAI', "Shipper load, consignee unload"),
+    ('SAJ', "Small packages charge"),
+    ('SC ', "Surcharge"),
+    ('SD ', "Shrinkage allowance"),
+    ('SF ', "Special rebate"),
+    ('SG ', "Shrink-wrap charge"),
+    ('SH ', "Special handling service"),
+    ('SM ', "Special finish"),
+    ('ST ', "Stamp duties"),
+    ('SU ', "Set-up"),
+    ('SZ ', "Steel surcharge"),
+    ('TAA', "Telephone charge"),
+    ('TAB', "Tank rental"),
+    ('TAC', "Testing charge"),
+    ('TAD', "Testing allowance"),
+    ('TAE', "Truckload discount"),
+    ('TD ', "Trade discount"),
+    ('TS ', "State tax"),
+    ('TT ', "Transportation - third party billing"),
+    ('TV ', "Transportation - vendor provided"),
+    ('TX ', "Tax"),
+    ('TZ ', "Temporary allowance"),
+    ('UM ', "Unsaleable merchandise allowance"),
+    ('V1 ', "Drop yard"),
+    ('V2 ', "Drop dock"),
+    ('VAA', "Vendor freight"),
+    ('VAB', "Volume discount"),
+    ('VL ', "Vehicle load allowance"),
+    ('WH ', "Warehousing"),
+    ('XAA', "Combine all same day shipment"),
+    ('YY ', "Split pickup"),
+    ('ZZZ', "Mutually defined"),
+    ]
 
 
 class Uom(metaclass=PoolMeta):
@@ -13,3 +388,24 @@
             ],
         help="Standard code of "
         "the United Nations Economic Commission for Europe.")
+
+
+class Template(metaclass=PoolMeta):
+    __name__ = 'product.template'
+
+    unece_allowance_charge_code = fields.Selection(
+        [(None, "")] + UNCL5189,
+        "UNECE Allowance/Charge Code",
+        states={
+            'invisible': Eval('type') != 'service',
+            },
+        help="Standard code of "
+        "the United Nations Economic Commission for Europe.")
+    unece_special_service_code = fields.Selection(
+        [(None, "")] + UNCL7161,
+        "UNECE Special Service Code",
+        states={
+            'invisible': Eval('type') != 'service',
+            },
+        help="Standard code of "
+        "the United Nations Economic Commission for Europe.")
diff -r c8c9393ee249 -r 51d3e0bcd5fb modules/edocument_unece/product.xml
--- a/modules/edocument_unece/product.xml       Mon Jan 26 12:08:41 2026 +0100
+++ b/modules/edocument_unece/product.xml       Mon Jan 26 15:42:27 2026 +0100
@@ -15,6 +15,12 @@
             <field name="name">product_uom_form</field>
         </record>
 
+        <record model="ir.ui.view" id="product_template_view_form">
+            <field name="model">product.template</field>
+            <field name="inherit" ref="product.template_view_form"/>
+            <field name="name">product_template_form</field>
+        </record>
+
         <record model="product.uom" id="product.uom_unit">
             <field name="unece_code">C62</field>
         </record>
diff -r c8c9393ee249 -r 51d3e0bcd5fb modules/edocument_unece/tryton.cfg
--- a/modules/edocument_unece/tryton.cfg        Mon Jan 26 12:08:41 2026 +0100
+++ b/modules/edocument_unece/tryton.cfg        Mon Jan 26 15:42:27 2026 +0100
@@ -2,6 +2,7 @@
 version=7.9.0
 depends:
     account
+    account_product
     ir
     party
     product
@@ -13,6 +14,6 @@
 model:
     party.Identifier
     product.Uom
+    product.Template
     account.TaxTemplate
     account.Tax
-
diff -r c8c9393ee249 -r 51d3e0bcd5fb 
modules/edocument_unece/view/product_template_form.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/edocument_unece/view/product_template_form.xml    Mon Jan 26 
15:42:27 2026 +0100
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
+<data>
+    <xpath expr="//page[@id='accounting']" position="inside">
+        <newline/>
+        <label name="unece_allowance_charge_code"/>
+        <field name="unece_allowance_charge_code"/>
+        <label name="unece_special_service_code"/>
+        <field name="unece_special_service_code"/>
+    </xpath>
+</data>

Reply via email to