Merge lp:~matjaz-6/openerpsl/openerpsl_01_25 into lp:openerpsl/7.0

Proposed by Matjaz Kalic
Status: Merged
Merged at revision: 323
Proposed branch: lp:~matjaz-6/openerpsl/openerpsl_01_25
Merge into: lp:openerpsl/7.0
Diff against target: 46 lines (+13/-2)
2 files modified
mrp_procurement_qty/stock.py (+12/-1)
mrp_procurement_qty/wizard/delivery_order_return.py (+1/-1)
To merge this branch: bzr merge lp:~matjaz-6/openerpsl/openerpsl_01_25
Reviewer Review Type Date Requested Status
Mentis Pending
Review via email: mp+204516@code.launchpad.net

Description of the change

[FIX] mrp_procurement_qty/stock.py (group invoice lines with 0.0001 diff; right price for sale lines without product_id)

To post a comment you must log in.
323. By Dušan Laznik (Mentis)

[FIX] mrp_procurement_qty/stock.py (group invoice lines with 0.0001 diff; right price for sale lines without product_id)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mrp_procurement_qty/stock.py'
2--- mrp_procurement_qty/stock.py 2014-01-28 15:31:45 +0000
3+++ mrp_procurement_qty/stock.py 2014-02-03 15:29:48 +0000
4@@ -157,10 +157,14 @@
5 def _merge_invoice_lines(self, cr, uid, vals, context=None):
6 invoice_line_obj = self.pool.get('account.invoice.line')
7
8+ price_lo = vals['price_unit'] - 0.0001
9+ price_hi = vals['price_unit'] + 0.0001
10+
11 invoice_line_ids = invoice_line_obj.search(cr, uid, [
12 ('invoice_id', '=', vals['invoice_id']),
13 ('product_id', '=', vals['product_id']),
14- ('price_unit', '=', vals['price_unit']),
15+ ('price_unit', '>=', price_lo),
16+ ('price_unit', '<=', price_hi),
17 ('discount', '=', vals['discount'])
18 ])
19
20@@ -275,6 +279,13 @@
21 'invoice_state': 'invoiced',
22 }, context=context)
23 return res
24+
25+ def _get_price_unit_invoice(self, cursor, user, move_line, type):
26+ #Ce obstaja product_id na movu in obstaja povezava na sale line in tam ne obstaja product_id -> vracilo
27+ if move_line.sale_line_id and not move_line.sale_line_id.product_id.id and move_line.product_id.id:
28+ return move_line.sale_line_id.price_unit
29+ return super(stock_picking, self)._get_price_unit_invoice(cursor, user, move_line, type)
30+
31
32 stock_picking()
33
34
35=== modified file 'mrp_procurement_qty/wizard/delivery_order_return.py'
36--- mrp_procurement_qty/wizard/delivery_order_return.py 2014-01-31 13:02:06 +0000
37+++ mrp_procurement_qty/wizard/delivery_order_return.py 2014-02-03 15:29:48 +0000
38@@ -131,7 +131,7 @@
39 value = self.pool.get('account.tax').compute_all(cr, uid, sale_line.tax_id, _price, (0 - sale_line.product_qty_returned), new_product_id[0], sale_line.order_id.partner_id)['total']
40 dict_temp['price_total'] = value
41 #sum_price = sum_price + _price_tax
42- sum_price_total = sum_price_total - value
43+ sum_price_total = sum_price_total + value #ker je value vedno negativen
44 else:
45 dict_temp['price'] = ''
46 dict_temp['price_total'] = ''

Subscribers

People subscribed via source and target branches