From 04fb3dfcfffe5d2abfcf6f3ebe9d693101d5aa20 Mon Sep 17 00:00:00 2001 From: Joren Van Onder Date: Fri, 17 Apr 2015 17:53:13 +0200 Subject: [IMP] pos_mercury: pos extension for electronic card payment. This new module integrate the 'Mercury Pay' electronic payment provider with the point of sale. This commit is the end result of a large branch whose main author is Joren Van Onder , with additional contributions from Martin Donies and Frederic van der Essen --- addons/barcodes/barcodes.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'addons/barcodes/barcodes.py') diff --git a/addons/barcodes/barcodes.py b/addons/barcodes/barcodes.py index c9b9118728a..5a780657c1a 100644 --- a/addons/barcodes/barcodes.py +++ b/addons/barcodes/barcodes.py @@ -173,26 +173,28 @@ class barcode_nomenclature(osv.osv): return parsed_result -ENCODINGS = [ - ('any','Any'), - ('ean13','EAN-13'), - ('ean8','EAN-8'), - ('upca','UPC-A'), -] - class barcode_rule(models.Model): _name = 'barcode.rule' _order = 'sequence asc' + @api.model + def _encoding_selection_list(self): + return [ + ('any', 'Any'), + ('ean13', 'EAN-13'), + ('ean8', 'EAN-8'), + ('upca', 'UPC-A'), + ] + @api.model def _get_type_selection(self): return [('alias','Alias'),('product','Unit Product')] - + _columns = { 'name': fields.char('Rule Name', size=32, required=True, help='An internal identification for this barcode nomenclature rule'), 'barcode_nomenclature_id': fields.many2one('barcode.nomenclature','Barcode Nomenclature'), 'sequence': fields.integer('Sequence', help='Used to order rules such that rules with a smaller sequence match first'), - 'encoding': fields.selection(ENCODINGS,'Encoding',required=True,help='This rule will apply only if the barcode is encoded with the specified encoding'), + 'encoding': fields.selection('_encoding_selection_list','Encoding',required=True,help='This rule will apply only if the barcode is encoded with the specified encoding'), 'type': fields.selection('_get_type_selection','Type', required=True), 'pattern': fields.char('Barcode Pattern', size=32, help="The barcode matching pattern", required=True), 'alias': fields.char('Alias',size=32,help='The matched pattern will alias to this barcode', required=True), -- cgit v1.2.3