Merge lp:~mallorymarcot/unifield-server/us-5201 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 5264
Proposed branch: lp:~mallorymarcot/unifield-server/us-5201
Merge into: lp:unifield-server
Diff against target: 52 lines (+34/-0)
2 files modified
bin/addons/msf_profile/i18n/fr_MF.po (+7/-0)
bin/addons/purchase/purchase_order_line.py (+27/-0)
To merge this branch: bzr merge lp:~mallorymarcot/unifield-server/us-5201
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+361911@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
2--- bin/addons/msf_profile/i18n/fr_MF.po 2019-01-08 15:04:28 +0000
3+++ bin/addons/msf_profile/i18n/fr_MF.po 2019-01-17 16:06:21 +0000
4@@ -103837,3 +103837,10 @@
5 #: view:check.ppl.integrity:0
6 msgid "Go Back"
7 msgstr "Précédent"
8+
9+#. module: purchase
10+#: code:addons/purchase/purchase_order_line.py:604
11+#: constraint:purchase.order.line:0
12+#, python-format
13+msgid "Price is too big"
14+msgstr "Le prix est trop grand"
15
16=== modified file 'bin/addons/purchase/purchase_order_line.py'
17--- bin/addons/purchase/purchase_order_line.py 2018-11-09 16:32:18 +0000
18+++ bin/addons/purchase/purchase_order_line.py 2019-01-17 16:06:21 +0000
19@@ -578,6 +578,33 @@
20 'cancelled_by_sync': False,
21 }
22
23+
24+ def _check_max_price(self, cr, uid, ids, context=None):
25+ if not context:
26+ context = {}
27+
28+ for pol in self.browse(cr, uid, ids, context=context):
29+ if pol.product_qty > 99999999999:
30+ return False
31+
32+ total = pol.product_qty * pol.price_unit
33+ total_int = int(total)
34+ total_dec = round(total - total_int, 2)
35+
36+ nb_digits_allowed = 15
37+ if total_dec:
38+ nb_digits_allowed -= 3
39+
40+ if len(str(total_int)) > nb_digits_allowed:
41+ return False
42+
43+ return True
44+
45+ _constraints = [
46+ (_check_max_price, _("Price is too big"), ['price_unit', 'product_qty']),
47+ ]
48+
49+
50 def _get_destination_ok(self, cr, uid, lines, context):
51 dest_ok = False
52 for line in lines:

Subscribers

People subscribed via source and target branches