Stock Internal Moves

Asked by Mohammed

I am asking from is journal entries while doing internal move between internal stock locations, where I see openerp is not satisfying and it is missing and I can assure that from this part of code where entries got generated :

""" # Outgoing moves (or cross-company output part)
            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)
                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))]

            # 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)
                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))]"""

Having said that, I see openerp just generate entries from incoming and outgoing moves and don't for internal moves where

move.location_id.usage == 'internal' and move.location_dest_id.usage == 'internal'

For example when doing internal move from stock_a to stock_b (both are internal locations), it should generate a journal entry stock_a credit and stock_b debit with the amount of product moved

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was originally filed as bug #871675.

Revision history for this message
Amit Parik (amit-parik) said :
#1

Hello Mohammad,

I have checked your issue but I am not agree with you.

The stock accounting entires are created only when we are insert or send a stock to our stock location. It means that when we have purchase or sale a product then and only then stock account 's journal entires will be created.

In simple word when your source location is "Supplier" or destination location is "Customer" then it will be generated.

From your issue you have described a "Internal move" means you have internally transfer a stock form one location to another.
When these stock comes in your stock_a location from source location to "supplier" then it's journal entries was created.
Now you have transfer the stock from stock_a to stock_b is at these time if again journal entries will generated then two times same entires will created which is not correct.

So this is the functional behaviour not a bug, that's why I am closing this issue.

Correct me If I am wrong.

Thanks.

Revision history for this message
Amit Parik (amit-parik) said :
#2

Hello Mohammad,

I am not agree with you, because you have described that you have set a individual account for each stock location in comment#2.
And in your bug description you have specified that your stock location are internal location.

So there creating some confusion here, because we can give a stock input A/c and stock o/p A/c for individual stock location when either our location type is "Production" or "Inventory".

We can not give a individual stock account for each stock location if our location type is "Internal".

So would you please change your location type and then try again.

Thanks your your reply!

Revision history for this message
adamcaleb (alexlanister) said :
#3

It appears that the provided code snippet from OpenERP is focused on generating accounting entries for outgoing and incoming moves but lacks specific handling for internal moves where both the source and destination locations have the usage set to 'internal'. To address this issue, you may need to extend the code to include the necessary logic for accounting entries in the case of internal moves.

Here's a brief suggestion on how you might modify the code to account for internal moves:

# Internal moves
if move.location_id.usage == 'internal' and move.location_dest_id.usage == 'internal':
    # Assuming there are separate accounts for internal moves (e.g., stock_a and stock_b)
    journal_id, acc_src, acc_dest, acc_variation = self._get_accounting_data_for_internal_move(cr, uid, move, context)
    reference_amount, reference_currency_id = self._get_reference_accounting_values_for_internal_move(cr, uid, move, context)
    account_moves += [
        (journal_id, self._create_account_move_line(cr, uid, move, acc_src, acc_dest, reference_amount, reference_currency_id, context)),
        (journal_id, self._create_account_move_line(cr, uid, move, acc_dest, acc_src, reference_amount, reference_currency_id, context))
    ]

Make sure to implement _get_accounting_data_for_internal_move and _get_reference_accounting_values_for_internal_move methods to retrieve the necessary accounting data specific to internal moves. Additionally, customize the accounts (acc_src and acc_dest) based on your accounting requirements for internal transfers.

This modification aims to create journal entries for both the source of https://threemovers.com/ and destination locations of internal moves, ensuring proper accounting treatment for stock movements within the internal stock locations.

Can you help with this problem?

Provide an answer of your own, or ask Mohammed for more information if necessary.

To post a message you must log in.