Merge lp:~unifield-team/unifield-server/us-2309 into lp:unifield-server

Proposed by Quentin THEURET @Amaris
Status: Merged
Merged at revision: 4207
Proposed branch: lp:~unifield-team/unifield-server/us-2309
Merge into: lp:unifield-server
Diff against target: 140 lines (+22/-10)
8 files modified
bin/addons/analytic_distribution_supply/account_commitment.py (+6/-1)
bin/addons/analytic_distribution_supply/purchase.py (+3/-2)
bin/addons/procurement_request/procurement_request.py (+3/-1)
bin/addons/purchase/purchase.py (+2/-0)
bin/addons/purchase_override/purchase.py (+4/-4)
bin/addons/sale/sale.py (+2/-0)
bin/addons/sale_override/sale.py (+1/-1)
bin/addons/sourcing/sale_order_line.py (+1/-1)
To merge this branch: bzr merge lp:~unifield-team/unifield-server/us-2309
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+316561@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jeff Allen (jr.allen) wrote :

Don't know if this comment is helpful or not...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/analytic_distribution_supply/account_commitment.py'
2--- bin/addons/analytic_distribution_supply/account_commitment.py 2014-03-07 14:09:26 +0000
3+++ bin/addons/analytic_distribution_supply/account_commitment.py 2017-02-15 09:48:45 +0000
4@@ -90,7 +90,12 @@
5 if not total_amount:
6 continue
7 # compute percentage
8- percentage = (total_amount / line.amount) * 100 or 0.0
9+ if line.amount:
10+ percentage = (total_amount / line.amount) * 100 or 0.0
11+ elif not total_amount:
12+ percentage = 100
13+ else:
14+ percentage = 0
15 vals.update({'percentage': percentage})
16 # create cost_center_line
17 self.pool.get('cost.center.distribution.line').create(cr, uid, vals, context=context)
18
19=== modified file 'bin/addons/analytic_distribution_supply/purchase.py'
20--- bin/addons/analytic_distribution_supply/purchase.py 2016-12-05 13:25:10 +0000
21+++ bin/addons/analytic_distribution_supply/purchase.py 2017-02-15 09:48:45 +0000
22@@ -220,8 +220,9 @@
23 # Create commitment lines
24 line_id = self.pool.get('account.commitment.line').create(cr, uid, {
25 'commit_id': commit_id,
26- 'amount': total_amount,
27- 'initial_amount': total_amount, 'account_id': account_id,
28+ 'amount': total_amount < 0.00001 and 0.00001 or total_amount,
29+ 'initial_amount': total_amount < 0.00001 and 0.00001 or total_amount,
30+ 'account_id': account_id,
31 'purchase_order_line_ids': [(6,0,[x.id for x in po_lines[account_id]])]
32 }, context=context)
33 created_commitment_lines.append(line_id)
34
35=== modified file 'bin/addons/procurement_request/procurement_request.py'
36--- bin/addons/procurement_request/procurement_request.py 2016-11-17 10:50:45 +0000
37+++ bin/addons/procurement_request/procurement_request.py 2017-02-15 09:48:45 +0000
38@@ -658,6 +658,8 @@
39 if line.order_id.procurement_request:
40 subtotal = line.cost_price * line.product_uom_qty
41 res[line.id] = cur_obj.round(cr, uid, curr_browse.rounding, subtotal)
42+ if line.cost_price > 0 and res[line.id] < 0.01:
43+ res[line.id] = 0.01
44 else:
45 new_ids.append(line.id)
46
47@@ -730,7 +732,7 @@
48 return res
49
50 _columns = {
51- 'cost_price': fields.float(string='Cost price'),
52+ 'cost_price': fields.float(string='Cost price', digits_compute=dp.get_precision('Sale Price Computation')),
53 'procurement_request': fields.boolean(string='Internal Request', readonly=True),
54 'latest': fields.char(size=64, string='Latest documents', readonly=True),
55 'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal', digits_compute=dp.get_precision('Sale Price')),
56
57=== modified file 'bin/addons/purchase/purchase.py'
58--- bin/addons/purchase/purchase.py 2016-10-21 09:57:27 +0000
59+++ bin/addons/purchase/purchase.py 2017-02-15 09:48:45 +0000
60@@ -675,6 +675,8 @@
61 taxes = tax_obj.compute_all(cr, uid, line.taxes_id, line.price_unit, line.product_qty)
62 cur = line.order_id.pricelist_id.currency_id
63 res[line.id] = cur_obj.round(cr, uid, cur.rounding, taxes['total'])
64+ if line.price_unit > 0 and res[line.id] < 0.01:
65+ res[line.id] = 0.01
66 return res
67
68 _columns = {
69
70=== modified file 'bin/addons/purchase_override/purchase.py'
71--- bin/addons/purchase_override/purchase.py 2017-02-06 10:46:50 +0000
72+++ bin/addons/purchase_override/purchase.py 2017-02-15 09:48:45 +0000
73@@ -1223,7 +1223,7 @@
74 for po in self.browse(cr, uid, ids, context=context):
75 line_error = []
76 if po.order_type == 'regular':
77- cr.execute('SELECT line_number FROM purchase_order_line WHERE (price_unit*product_qty < 0.01 OR price_unit = 0.00) AND order_id = %s', (po.id,))
78+ cr.execute('SELECT line_number FROM purchase_order_line WHERE (price_unit*product_qty < 0.00001 OR price_unit = 0.00) AND order_id = %s', (po.id,))
79 line_errors = cr.dictfetchall()
80 for l_id in line_errors:
81 if l_id not in line_error:
82@@ -1315,7 +1315,7 @@
83 raise osv.except_osv(_('Error'), _('Delivery Confirmed Date is a mandatory field.'))
84 # for all lines, if the confirmed date is not filled, we copy the header value
85 if is_regular:
86- cr.execute('SELECT line_number FROM purchase_order_line WHERE (price_unit*product_qty < 0.01 OR price_unit = 0.00) AND order_id = %s', (po['id'],))
87+ cr.execute('SELECT line_number FROM purchase_order_line WHERE (price_unit*product_qty < 0.00001 OR price_unit = 0.00) AND order_id = %s', (po['id'],))
88 line_errors = cr.dictfetchall()
89 for l_id in line_errors:
90 if l_id not in line_error:
91@@ -1619,8 +1619,8 @@
92 sol.currency_id.id, line.price_unit or 0.0,
93 round=False, context=date_context)
94
95- if so.order_type == 'regular' and price_unit_converted < 0.01:
96- price_unit_converted = 0.01
97+ if so.order_type == 'regular' and price_unit_converted < 0.00001:
98+ price_unit_converted = 0.00001
99
100 line_qty = line.product_qty
101 if line.procurement_id:
102
103=== modified file 'bin/addons/sale/sale.py'
104--- bin/addons/sale/sale.py 2016-11-09 16:19:23 +0000
105+++ bin/addons/sale/sale.py 2017-02-15 09:48:45 +0000
106@@ -987,6 +987,8 @@
107 taxes = tax_obj.compute_all(cr, uid, line.tax_id, price, line.product_uom_qty, line.order_id.partner_invoice_id.id, line.product_id, line.order_id.partner_id)
108 cur = line.order_id.pricelist_id.currency_id
109 res[line.id] = cur_obj.round(cr, uid, cur.rounding, taxes['total'])
110+ if price > 0 and res[line.id] < 0.01:
111+ res[line.id] = 0.01
112 return res
113
114 def _number_packages(self, cr, uid, ids, field_name, arg, context=None):
115
116=== modified file 'bin/addons/sale_override/sale.py'
117--- bin/addons/sale_override/sale.py 2017-01-23 16:14:11 +0000
118+++ bin/addons/sale_override/sale.py 2017-02-15 09:48:45 +0000
119@@ -1301,7 +1301,7 @@
120 reset_soq.append(line.id)
121 no_price_lines = []
122 if order.order_type == 'regular':
123- cr.execute('SELECT line_number FROM sale_order_line WHERE (price_unit*product_uom_qty < 0.01 OR price_unit = 0.00) AND order_id = %s', (order.id,))
124+ cr.execute('SELECT line_number FROM sale_order_line WHERE (price_unit*product_uom_qty < 0.00001 OR price_unit = 0.00) AND order_id = %s', (order.id,))
125 line_errors = cr.dictfetchall()
126 for l_id in line_errors:
127 if l_id not in no_price_lines:
128
129=== modified file 'bin/addons/sourcing/sale_order_line.py'
130--- bin/addons/sourcing/sale_order_line.py 2016-12-13 08:05:51 +0000
131+++ bin/addons/sourcing/sale_order_line.py 2017-02-15 09:48:45 +0000
132@@ -1363,7 +1363,7 @@
133 if line['order_id'][0] not in order_to_check:
134 order_to_check.update({line['order_id'][0]: state_to_use})
135
136- if order_type == 'regular' and not order_proc and line['price_unit'] * line['product_uom_qty'] < 0.01:
137+ if order_type == 'regular' and not order_proc and line['price_unit'] * line['product_uom_qty'] < 0.00001:
138 raise osv.except_osv(
139 _('Warning'),
140 _('You cannot confirm the sourcing of a line with a subtotal of zero.'),

Subscribers

People subscribed via source and target branches

to all changes: