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
=== modified file 'stock/product.py'
--- stock/product.py 2012-11-29 22:26:45 +0000
+++ stock/product.py 2012-12-17 09:46:21 +0000
@@ -22,6 +22,7 @@
22from osv import fields, osv22from osv import fields, osv
23from tools.translate import _23from tools.translate import _
24import decimal_precision as dp24import decimal_precision as dp
25from datetime import datetime
2526
26class product_product(osv.osv):27class product_product(osv.osv):
27 _inherit = "product.product"28 _inherit = "product.product"
@@ -126,7 +127,7 @@
126 'journal_id': journal_id,127 'journal_id': journal_id,
127 'company_id': company_id128 'company_id': company_id
128 })129 })
129130
130 move_ids.append(move_id)131 move_ids.append(move_id)
131132
132133
@@ -149,12 +150,14 @@
149 'account_id': stock_input_acc,150 'account_id': stock_input_acc,
150 'debit': amount_diff,151 'debit': amount_diff,
151 'move_id': move_id,152 'move_id': move_id,
153 'date':datetime.now().strftime('%Y-%m-%d')
152 })154 })
153 move_line_obj.create(cr, uid, {155 move_line_obj.create(cr, uid, {
154 'name': product.categ_id.name,156 'name': product.categ_id.name,
155 'account_id': account_valuation_id,157 'account_id': account_valuation_id,
156 'credit': amount_diff,158 'credit': amount_diff,
157 'move_id': move_id159 'move_id': move_id,
160 'date':datetime.now().strftime('%Y-%m-%d')
158 })161 })
159 elif diff < 0:162 elif diff < 0:
160 if not stock_output_acc:163 if not stock_output_acc:
@@ -174,13 +177,15 @@
174 'name': product.name,177 'name': product.name,
175 'account_id': stock_output_acc,178 'account_id': stock_output_acc,
176 'credit': amount_diff,179 'credit': amount_diff,
177 'move_id': move_id180 'move_id': move_id,
181 'date':datetime.now().strftime('%Y-%m-%d')
178 })182 })
179 move_line_obj.create(cr, uid, {183 move_line_obj.create(cr, uid, {
180 'name': product.categ_id.name,184 'name': product.categ_id.name,
181 'account_id': account_valuation_id,185 'account_id': account_valuation_id,
182 'debit': amount_diff,186 'debit': amount_diff,
183 'move_id': move_id187 'move_id': move_id,
188 'date': datetime.now().strftime('%Y-%m-%d')
184 })189 })
185190
186 self.write(cr, uid, rec_id, {'standard_price': new_price})191 self.write(cr, uid, rec_id, {'standard_price': new_price})

Subscribers

People subscribed via source and target branches

to all changes: