[IMP] Stock:Change field name property_stock_variation into property_stock_valuation_account_id
bzr revid: aag@tinyerp.com-20111010113346-vopj07xuehwpm1u8
This commit is contained in:
parent
78506b24aa
commit
38ed934c8a
|
@ -1978,8 +1978,8 @@ msgid "Future Qty"
|
|||
msgstr ""
|
||||
|
||||
#. module: stock
|
||||
#: field:product.category,property_stock_variation:0
|
||||
msgid "Stock Variation Account"
|
||||
#: field:product.category,property_stock_valuation_account_id:0
|
||||
msgid "Stock Valuation Account"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock
|
||||
|
@ -2036,7 +2036,7 @@ msgid "Location where the system will stock the finished products."
|
|||
msgstr ""
|
||||
|
||||
#. module: stock
|
||||
#: help:product.category,property_stock_variation:0
|
||||
#: help:product.category,property_stock_valuation_account_id:0
|
||||
msgid "When real-time inventory valuation is enabled on a product, this account will hold the current value of the products."
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -2033,14 +2033,14 @@ class stock_move(osv.osv):
|
|||
else:
|
||||
acc_dest = accounts['stock_account_output']
|
||||
|
||||
acc_variation = accounts.get('property_stock_variation', False)
|
||||
acc_valuation = accounts.get('property_stock_valuation_account_id', False)
|
||||
journal_id = accounts['stock_journal']
|
||||
|
||||
if acc_dest == acc_variation:
|
||||
raise osv.except_osv(_('Error!'), _('Can not create Journal Entry, Output Account defined on this product and Variant account on category of this product are same.'))
|
||||
if acc_dest == acc_valuation:
|
||||
raise osv.except_osv(_('Error!'), _('Can not create Journal Entry, Output Account defined on this product and Valuation account on category of this product are same.'))
|
||||
|
||||
if acc_src == acc_variation:
|
||||
raise osv.except_osv(_('Error!'), _('Can not create Journal Entry, Input Account defined on this product and Variant account on category of this product are same.'))
|
||||
if acc_src == acc_valuation:
|
||||
raise osv.except_osv(_('Error!'), _('Can not create Journal Entry, Input Account defined on this product and Valuation account on category of this product are same.'))
|
||||
|
||||
if not acc_src:
|
||||
raise osv.except_osv(_('Error!'), _('There is no stock input account defined for this product or its category: "%s" (id: %d)') % \
|
||||
|
@ -2051,10 +2051,10 @@ class stock_move(osv.osv):
|
|||
if not journal_id:
|
||||
raise osv.except_osv(_('Error!'), _('There is no journal defined on the product category: "%s" (id: %d)') % \
|
||||
(move.product_id.categ_id.name, move.product_id.categ_id.id,))
|
||||
if not acc_variation:
|
||||
raise osv.except_osv(_('Error!'), _('There is no inventory variation account defined on the product category: "%s" (id: %d)') % \
|
||||
if not acc_valuation:
|
||||
raise osv.except_osv(_('Error!'), _('There is no inventory Valuation account defined on the product category: "%s" (id: %d)') % \
|
||||
(move.product_id.categ_id.name, move.product_id.categ_id.id,))
|
||||
return journal_id, acc_src, acc_dest, acc_variation
|
||||
return journal_id, acc_src, acc_dest, acc_valuation
|
||||
|
||||
def _get_reference_accounting_values_for_valuation(self, cr, uid, move, context=None):
|
||||
"""
|
||||
|
@ -2104,17 +2104,17 @@ class stock_move(osv.osv):
|
|||
if move.location_id.company_id \
|
||||
and (move.location_id.usage == 'internal' and move.location_dest_id.usage != 'internal'\
|
||||
or move.location_id.company_id != move.location_dest_id.company_id):
|
||||
journal_id, acc_src, acc_dest, acc_variation = 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)
|
||||
account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_variation, 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)
|
||||
if move.location_dest_id.company_id \
|
||||
and (move.location_id.usage != 'internal' and move.location_dest_id.usage == 'internal'\
|
||||
or move.location_id.company_id != move.location_dest_id.company_id):
|
||||
journal_id, acc_src, acc_dest, acc_variation = 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)
|
||||
account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_src, acc_variation, 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')
|
||||
for j_id, move_lines in account_moves:
|
||||
|
|
Loading…
Reference in New Issue