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
=== modified file 'bin/addons/analytic_distribution_supply/account_commitment.py'
--- bin/addons/analytic_distribution_supply/account_commitment.py 2014-03-07 14:09:26 +0000
+++ bin/addons/analytic_distribution_supply/account_commitment.py 2017-02-15 09:48:45 +0000
@@ -90,7 +90,12 @@
90 if not total_amount:90 if not total_amount:
91 continue91 continue
92 # compute percentage92 # compute percentage
93 percentage = (total_amount / line.amount) * 100 or 0.093 if line.amount:
94 percentage = (total_amount / line.amount) * 100 or 0.0
95 elif not total_amount:
96 percentage = 100
97 else:
98 percentage = 0
94 vals.update({'percentage': percentage})99 vals.update({'percentage': percentage})
95 # create cost_center_line100 # create cost_center_line
96 self.pool.get('cost.center.distribution.line').create(cr, uid, vals, context=context)101 self.pool.get('cost.center.distribution.line').create(cr, uid, vals, context=context)
97102
=== modified file 'bin/addons/analytic_distribution_supply/purchase.py'
--- bin/addons/analytic_distribution_supply/purchase.py 2016-12-05 13:25:10 +0000
+++ bin/addons/analytic_distribution_supply/purchase.py 2017-02-15 09:48:45 +0000
@@ -220,8 +220,9 @@
220 # Create commitment lines220 # Create commitment lines
221 line_id = self.pool.get('account.commitment.line').create(cr, uid, {221 line_id = self.pool.get('account.commitment.line').create(cr, uid, {
222 'commit_id': commit_id,222 'commit_id': commit_id,
223 'amount': total_amount,223 'amount': total_amount < 0.00001 and 0.00001 or total_amount,
224 'initial_amount': total_amount, 'account_id': account_id,224 'initial_amount': total_amount < 0.00001 and 0.00001 or total_amount,
225 'account_id': account_id,
225 'purchase_order_line_ids': [(6,0,[x.id for x in po_lines[account_id]])]226 'purchase_order_line_ids': [(6,0,[x.id for x in po_lines[account_id]])]
226 }, context=context)227 }, context=context)
227 created_commitment_lines.append(line_id)228 created_commitment_lines.append(line_id)
228229
=== modified file 'bin/addons/procurement_request/procurement_request.py'
--- bin/addons/procurement_request/procurement_request.py 2016-11-17 10:50:45 +0000
+++ bin/addons/procurement_request/procurement_request.py 2017-02-15 09:48:45 +0000
@@ -658,6 +658,8 @@
658 if line.order_id.procurement_request:658 if line.order_id.procurement_request:
659 subtotal = line.cost_price * line.product_uom_qty659 subtotal = line.cost_price * line.product_uom_qty
660 res[line.id] = cur_obj.round(cr, uid, curr_browse.rounding, subtotal)660 res[line.id] = cur_obj.round(cr, uid, curr_browse.rounding, subtotal)
661 if line.cost_price > 0 and res[line.id] < 0.01:
662 res[line.id] = 0.01
661 else:663 else:
662 new_ids.append(line.id)664 new_ids.append(line.id)
663665
@@ -730,7 +732,7 @@
730 return res732 return res
731733
732 _columns = {734 _columns = {
733 'cost_price': fields.float(string='Cost price'),735 'cost_price': fields.float(string='Cost price', digits_compute=dp.get_precision('Sale Price Computation')),
734 'procurement_request': fields.boolean(string='Internal Request', readonly=True),736 'procurement_request': fields.boolean(string='Internal Request', readonly=True),
735 'latest': fields.char(size=64, string='Latest documents', readonly=True),737 'latest': fields.char(size=64, string='Latest documents', readonly=True),
736 'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal', digits_compute=dp.get_precision('Sale Price')),738 'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal', digits_compute=dp.get_precision('Sale Price')),
737739
=== modified file 'bin/addons/purchase/purchase.py'
--- bin/addons/purchase/purchase.py 2016-10-21 09:57:27 +0000
+++ bin/addons/purchase/purchase.py 2017-02-15 09:48:45 +0000
@@ -675,6 +675,8 @@
675 taxes = tax_obj.compute_all(cr, uid, line.taxes_id, line.price_unit, line.product_qty)675 taxes = tax_obj.compute_all(cr, uid, line.taxes_id, line.price_unit, line.product_qty)
676 cur = line.order_id.pricelist_id.currency_id676 cur = line.order_id.pricelist_id.currency_id
677 res[line.id] = cur_obj.round(cr, uid, cur.rounding, taxes['total'])677 res[line.id] = cur_obj.round(cr, uid, cur.rounding, taxes['total'])
678 if line.price_unit > 0 and res[line.id] < 0.01:
679 res[line.id] = 0.01
678 return res680 return res
679681
680 _columns = {682 _columns = {
681683
=== modified file 'bin/addons/purchase_override/purchase.py'
--- bin/addons/purchase_override/purchase.py 2017-02-06 10:46:50 +0000
+++ bin/addons/purchase_override/purchase.py 2017-02-15 09:48:45 +0000
@@ -1223,7 +1223,7 @@
1223 for po in self.browse(cr, uid, ids, context=context):1223 for po in self.browse(cr, uid, ids, context=context):
1224 line_error = []1224 line_error = []
1225 if po.order_type == 'regular':1225 if po.order_type == 'regular':
1226 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,))1226 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,))
1227 line_errors = cr.dictfetchall()1227 line_errors = cr.dictfetchall()
1228 for l_id in line_errors:1228 for l_id in line_errors:
1229 if l_id not in line_error:1229 if l_id not in line_error:
@@ -1315,7 +1315,7 @@
1315 raise osv.except_osv(_('Error'), _('Delivery Confirmed Date is a mandatory field.'))1315 raise osv.except_osv(_('Error'), _('Delivery Confirmed Date is a mandatory field.'))
1316 # for all lines, if the confirmed date is not filled, we copy the header value1316 # for all lines, if the confirmed date is not filled, we copy the header value
1317 if is_regular:1317 if is_regular:
1318 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'],))1318 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'],))
1319 line_errors = cr.dictfetchall()1319 line_errors = cr.dictfetchall()
1320 for l_id in line_errors:1320 for l_id in line_errors:
1321 if l_id not in line_error:1321 if l_id not in line_error:
@@ -1619,8 +1619,8 @@
1619 sol.currency_id.id, line.price_unit or 0.0,1619 sol.currency_id.id, line.price_unit or 0.0,
1620 round=False, context=date_context)1620 round=False, context=date_context)
16211621
1622 if so.order_type == 'regular' and price_unit_converted < 0.01:1622 if so.order_type == 'regular' and price_unit_converted < 0.00001:
1623 price_unit_converted = 0.011623 price_unit_converted = 0.00001
16241624
1625 line_qty = line.product_qty1625 line_qty = line.product_qty
1626 if line.procurement_id:1626 if line.procurement_id:
16271627
=== modified file 'bin/addons/sale/sale.py'
--- bin/addons/sale/sale.py 2016-11-09 16:19:23 +0000
+++ bin/addons/sale/sale.py 2017-02-15 09:48:45 +0000
@@ -987,6 +987,8 @@
987 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)987 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)
988 cur = line.order_id.pricelist_id.currency_id988 cur = line.order_id.pricelist_id.currency_id
989 res[line.id] = cur_obj.round(cr, uid, cur.rounding, taxes['total'])989 res[line.id] = cur_obj.round(cr, uid, cur.rounding, taxes['total'])
990 if price > 0 and res[line.id] < 0.01:
991 res[line.id] = 0.01
990 return res992 return res
991993
992 def _number_packages(self, cr, uid, ids, field_name, arg, context=None):994 def _number_packages(self, cr, uid, ids, field_name, arg, context=None):
993995
=== modified file 'bin/addons/sale_override/sale.py'
--- bin/addons/sale_override/sale.py 2017-01-23 16:14:11 +0000
+++ bin/addons/sale_override/sale.py 2017-02-15 09:48:45 +0000
@@ -1301,7 +1301,7 @@
1301 reset_soq.append(line.id)1301 reset_soq.append(line.id)
1302 no_price_lines = []1302 no_price_lines = []
1303 if order.order_type == 'regular':1303 if order.order_type == 'regular':
1304 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,))1304 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,))
1305 line_errors = cr.dictfetchall()1305 line_errors = cr.dictfetchall()
1306 for l_id in line_errors:1306 for l_id in line_errors:
1307 if l_id not in no_price_lines:1307 if l_id not in no_price_lines:
13081308
=== modified file 'bin/addons/sourcing/sale_order_line.py'
--- bin/addons/sourcing/sale_order_line.py 2016-12-13 08:05:51 +0000
+++ bin/addons/sourcing/sale_order_line.py 2017-02-15 09:48:45 +0000
@@ -1363,7 +1363,7 @@
1363 if line['order_id'][0] not in order_to_check:1363 if line['order_id'][0] not in order_to_check:
1364 order_to_check.update({line['order_id'][0]: state_to_use})1364 order_to_check.update({line['order_id'][0]: state_to_use})
13651365
1366 if order_type == 'regular' and not order_proc and line['price_unit'] * line['product_uom_qty'] < 0.01:1366 if order_type == 'regular' and not order_proc and line['price_unit'] * line['product_uom_qty'] < 0.00001:
1367 raise osv.except_osv(1367 raise osv.except_osv(
1368 _('Warning'),1368 _('Warning'),
1369 _('You cannot confirm the sourcing of a line with a subtotal of zero.'),1369 _('You cannot confirm the sourcing of a line with a subtotal of zero.'),

Subscribers

People subscribed via source and target branches

to all changes: