[FIX] stock: wrong stock accounting entries while doing return of any purchase/sales
Accounting entries should be reverse while doing any return bzr revid: rha@tinyerp.com-20120924074036-0h7sybkwaegvg4tz
This commit is contained in:
parent
d61bae80e5
commit
70f6e847f3
|
@ -2300,6 +2300,10 @@ class stock_move(osv.osv):
|
||||||
or move.location_id.company_id != move.location_dest_id.company_id):
|
or move.location_id.company_id != move.location_dest_id.company_id):
|
||||||
journal_id, acc_src, acc_dest, acc_valuation = self._get_accounting_data_for_valuation(cr, uid, move, src_company_ctx)
|
journal_id, acc_src, acc_dest, acc_valuation = self._get_accounting_data_for_valuation(cr, uid, move, src_company_ctx)
|
||||||
reference_amount, reference_currency_id = self._get_reference_accounting_values_for_valuation(cr, uid, move, src_company_ctx)
|
reference_amount, reference_currency_id = self._get_reference_accounting_values_for_valuation(cr, uid, move, src_company_ctx)
|
||||||
|
#returning goods to supplier
|
||||||
|
if move.location_dest_id.usage == 'supplier':
|
||||||
|
account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_valuation, acc_src, reference_amount, reference_currency_id, context))]
|
||||||
|
else:
|
||||||
account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_valuation, acc_dest, reference_amount, reference_currency_id, context))]
|
account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_valuation, acc_dest, reference_amount, reference_currency_id, context))]
|
||||||
|
|
||||||
# Incoming moves (or cross-company input part)
|
# Incoming moves (or cross-company input part)
|
||||||
|
@ -2308,6 +2312,10 @@ class stock_move(osv.osv):
|
||||||
or move.location_id.company_id != move.location_dest_id.company_id):
|
or move.location_id.company_id != move.location_dest_id.company_id):
|
||||||
journal_id, acc_src, acc_dest, acc_valuation = self._get_accounting_data_for_valuation(cr, uid, move, dest_company_ctx)
|
journal_id, acc_src, acc_dest, acc_valuation = self._get_accounting_data_for_valuation(cr, uid, move, dest_company_ctx)
|
||||||
reference_amount, reference_currency_id = self._get_reference_accounting_values_for_valuation(cr, uid, move, src_company_ctx)
|
reference_amount, reference_currency_id = self._get_reference_accounting_values_for_valuation(cr, uid, move, src_company_ctx)
|
||||||
|
#goods return from customer
|
||||||
|
if move.location_id.usage == 'customer':
|
||||||
|
account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_dest, acc_valuation, reference_amount, reference_currency_id, context))]
|
||||||
|
else:
|
||||||
account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_src, acc_valuation, reference_amount, reference_currency_id, context))]
|
account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_src, acc_valuation, reference_amount, reference_currency_id, context))]
|
||||||
|
|
||||||
move_obj = self.pool.get('account.move')
|
move_obj = self.pool.get('account.move')
|
||||||
|
|
Loading…
Reference in New Issue