Skip to content

Commit

Permalink
[FIX] in v10, we can add value to selection fieldw
Browse files Browse the repository at this point in the history
  • Loading branch information
Invitu authored and legalsylvain committed Jan 2, 2018
1 parent eedaa21 commit 183462a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pos_price_to_weight/data/barcode_rule.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

<record id="rule_price_to_weight" model="barcode.rule">
<field name="name">Price Barcodes (Computed Weight) 2 Decimals</field>
<field name="barcode_nomenclature_id" ref="barcodes.default_barcode_nomenclature"/>
<field name="barcode_nomenclature_id" ref="barcodes.default_barcode_nomenclature"/>
<field name="type">price_to_weight</field>
<field name="pattern">02.....{NNNDD}</field>
<field name="sequence">15</field>
Expand Down
11 changes: 4 additions & 7 deletions pos_price_to_weight/models/barcode_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import _, api, models
from odoo import _, fields, models


class BarcodeRule(models.Model):
_inherit = 'barcode.rule'

@api.model
def _get_type_selection(self):
res = super(BarcodeRule, self)._get_type_selection()
res.append(
('price_to_weight', _('Priced Product (Computed Weight)')))
return res
type = fields.Selection(selection_add=[
('price_to_weight', _('Priced Product (Computed Weight)'))
])

0 comments on commit 183462a

Please sign in to comment.