Skip to content

Commit

Permalink
🚑 improved search to take uid from pos_reference
Browse files Browse the repository at this point in the history
  • Loading branch information
KolushovAlexandr committed Dec 19, 2018
1 parent 6eaac4e commit 45f0328
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pos_qr_payments/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"category": "Hidden",
# "live_test_url": "",
"images": [],
"version": "11.0.1.0.0",
"version": "11.0.1.0.1",
"application": False,

"author": "IT-Projects LLC, Ivan Yelizariev",
Expand Down
5 changes: 5 additions & 0 deletions pos_qr_payments/doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
`1.0.1`
-------

- **FIX** - Error related to pos reference in different translations

`1.0.0`
-------

Expand Down
5 changes: 4 additions & 1 deletion pos_qr_payments/models/pos_order.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from odoo import models, api, fields
import re


class PosOrder(models.Model):
Expand All @@ -11,4 +13,5 @@ class PosOrder(models.Model):
@api.depends('pos_reference')
def _compute_pos_reference_uid(self):
for r in self:
r.pos_reference_uid = (r.pos_reference or ' ').split(' ', 1)[1]
reference = re.search(r'\d{1,}-\d{1,}-\d{1,}', r.pos_reference)
r.pos_reference_uid = reference and reference.group(0) or ''

0 comments on commit 45f0328

Please sign in to comment.