Merge lp:~openerp-dev/openobject-addons/trunk-bug-1090136-dhr into lp:openobject-addons

Proposed by Dharti Ratani(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1090136-dhr
Merge into: lp:openobject-addons
Diff against target: 54 lines (+9/-4)
1 file modified
stock/product.py (+9/-4)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1090136-dhr
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+140153@code.launchpad.net

Description of the change

Hello,

     Solved integrity error while updating product's cost with costing method="Average" from update wizard.

Thanks.

To post a comment you must log in.

Unmerged revisions

8357. By Dharti Ratani(OpenERP)

[FIX]Solved Integrity error while update product cost though update wizard

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/product.py'
2--- stock/product.py 2012-11-29 22:26:45 +0000
3+++ stock/product.py 2012-12-17 09:46:21 +0000
4@@ -22,6 +22,7 @@
5 from osv import fields, osv
6 from tools.translate import _
7 import decimal_precision as dp
8+from datetime import datetime
9
10 class product_product(osv.osv):
11 _inherit = "product.product"
12@@ -126,7 +127,7 @@
13 'journal_id': journal_id,
14 'company_id': company_id
15 })
16-
17+
18 move_ids.append(move_id)
19
20
21@@ -149,12 +150,14 @@
22 'account_id': stock_input_acc,
23 'debit': amount_diff,
24 'move_id': move_id,
25+ 'date':datetime.now().strftime('%Y-%m-%d')
26 })
27 move_line_obj.create(cr, uid, {
28 'name': product.categ_id.name,
29 'account_id': account_valuation_id,
30 'credit': amount_diff,
31- 'move_id': move_id
32+ 'move_id': move_id,
33+ 'date':datetime.now().strftime('%Y-%m-%d')
34 })
35 elif diff < 0:
36 if not stock_output_acc:
37@@ -174,13 +177,15 @@
38 'name': product.name,
39 'account_id': stock_output_acc,
40 'credit': amount_diff,
41- 'move_id': move_id
42+ 'move_id': move_id,
43+ 'date':datetime.now().strftime('%Y-%m-%d')
44 })
45 move_line_obj.create(cr, uid, {
46 'name': product.categ_id.name,
47 'account_id': account_valuation_id,
48 'debit': amount_diff,
49- 'move_id': move_id
50+ 'move_id': move_id,
51+ 'date': datetime.now().strftime('%Y-%m-%d')
52 })
53
54 self.write(cr, uid, rec_id, {'standard_price': new_price})

Subscribers

People subscribed via source and target branches

to all changes: