diff options
| author | Joren Van Onder <jov@odoo.com> | 2015-04-17 17:53:13 +0200 |
|---|---|---|
| committer | Frédéric van der Essen <fva@odoo.com> | 2015-07-02 16:42:36 +0200 |
| commit | 04fb3dfcfffe5d2abfcf6f3ebe9d693101d5aa20 (patch) | |
| tree | 4cfe24f22bfefa25903ff6106842ad36410a515e /addons/barcodes/barcodes.py | |
| parent | 3a26daeb296a1efdae9c5514c0ef142d82fb8702 (diff) | |
[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 <jov@odoo.com>, with additional
contributions from Martin Donies <mdo@odoo.com> and Frederic van
der Essen <fva@odoo.com>
Diffstat (limited to 'addons/barcodes/barcodes.py')
| -rw-r--r-- | addons/barcodes/barcodes.py | 20 |
1 files changed, 11 insertions, 9 deletions
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), |
