Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] stock_inventory_revaluation #118

Closed

Conversation

JordiBForgeFlow
Copy link
Member

Stock Account Inventory Revaluation

If your company runs a perpetual inventory system, you may need to perform
inventory revaluation.

You can re-valuate inventory values by:

  • Changing the price for a specific product. The inventory price is changed
    and inventory value is recalculated according to the new price. In case of
    real price, you can select which quants you want to change the price on.
  • Changing the value of the inventory. The quantity of inventory remains
    unchanged, resulting in a change in the price.

Configuration

  • Go to Inventory / Configuration / Products / Product Categories and
    define, for each category, a Valuation Increase Account and a Valuation
    Decrease Account. These accounts will be used as contra-accounts to the
    Stock Valuation Account during the inventory re-valuation.

Usage

  • Go to Inventory / Inventory Control / Inventory Revaluation / Products
    to create a new Inventory Revaluation.


* Go to *Inventory / Configuration / Products / Product Categories* and
define, for each category, a Valuation Increase Account and a Valuation
Decrease Account. These accounts will be used as contra-accounts to the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/contra/counterpart

@nhomar
Copy link
Member

nhomar commented Feb 11, 2016

@jbeficent

I am a little confused, this feature is already working on odoo (at least conceptually what you mentioned), can you share with us which is the difference between your approach and the one in odoo?

Thanks.

_name = 'stock.inventory.revaluation.line.get.quant'
_description = 'Inventory revaluation line get Quants'

date_from = fields.Date('Date From')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From?
Until?

@elicoidal
Copy link

Overall LGTM!

@JordiBForgeFlow
Copy link
Member Author

@nhomar, I can't really find now in Odoo the feature tha allows one to change the cost of a quant, with the subsequent accounting entries.

Support for change of standard and average is possible in odoo, but only through a wizard. If you want to apply a revaluation for many products it's not user friendly.

That's why I thought of integrating thw whole inventory revaluation in one place. This is really a mimick of SAP B1 inventory revaluation tool. Seehttps://m.youtube.com/watch?v=CWUizZ8Twpk

@JordiBForgeFlow
Copy link
Member Author

@nhom also the contra account of inventory revaluation in standard is wrong. It's not correct to use stock input and stock output! The user should be able to define, and the proposal should be different from stock in/out

@nhomar
Copy link
Member

nhomar commented Feb 11, 2016

@jbeficent

Well we just finished a huge reevaluation inventory process in a 10k SKU company with 4 subsidiaries.

I need to say "yes" to the fact that some stuff was done in order to achieve such process.

For example, in th SAP video you just show I have a quick question (which is the main concern of my question).

Where

The example number you are putting there is the one you set actually on the standard_cost field, and the wizard is necesary in order to achieve the account move topics. IF we are talking of 1 product IMHO If I reevaluate the inventory the stock in/out account is the one affected and teh ones of dofference account (all already in odoo).

You can see some little fixes we did here and we ran a cronjob in order to set the new standard for those which depends of a BoM price, but all using the original objects, no new fields, no new behaviors just "fixes".

That's my point here is that may be I am not seeing correctly the value of the new feature, and I want to be enlghted whether you are right or we forgot something huge on our side ;-)

As a side Note. With those approached I am showing you we achieve have consistent:

Accounting - Quants - Sotck Moves. All say the same in the moment th cronjob runs, and all account moves are generatd accordingly with correct NIIF approach (nothing special just to say a pretty name to what odoo is doing right now).

It should be GREAT if you share a little video of your approach, because I think that the account you are adding to the category is not necesary (but may be I am worng) and I think the actual Odoo'd algorithms only need little fixes (and not the creation of a new one).

But YES this is a hard topic our analysis, and deployed results took to us something like 4 months in order to follow all the auditory and so on (well we manage financially segmentation costs but that's another history).

If you want we can have a little meeeting in spanish to understand better and maybe we can help on this PR a little bit more.

Regard.s

@JordiBForgeFlow
Copy link
Member Author

@nhomar In your module product_extended_variants:

  • You are overriding the standard method do_change_standard_price to insert the price difference account.
  • The user is not given the option to change the GL contra-accounts accounts. An inventory revaluation should use separate GL accounts. Price Differences account is to be used when there are differences between invoice price and PO price under a standard price cost method. An accountant would be confused when seeing a "Price Differences" account mixing inventory revaluations with Invoice-PO adjustments. That's why it's important to PROPOSE to the user what account should be used. In some scenarios the GL account to use may be different (e.g. having a specific 'Inventory Obsolescence account' that is used in specific revaluations. I reported this issue to Odoo here, and they will be implementing the proposed changed in master here.

Odoo's module product_extended:

  • Provides support to change a product that is manufactured, and has BOM, only under the condition that the product is managed under standard price. Does not support revaluation under average cost method.

No tool in Odoo now supports inventory revaluation under the real cost method. That is, change the cost of the quants.

The module proposed here covers all possible scenarios of price revaluation, and ideally, once Odoo has proper support for price change with ability to define what GL account should be use, we could call the same wizard from this module, and thus this would really represent another way to achieve the same thing.

Another option is to fix / alter the standard methods offered by odoo for standard & average (possibly using a 'hooks' module that overrides the standard), and we build a separate tool for inventory revaluation specifically suited for the 'real' cost method. Perhaps it's better from a consistency perspective. Your feedback is welcome here.

I'm not sure that I see how your approach can achieve Accounting = Quants = Stock Moves. When you change a standard price of a product (standard or average price) the cost of quants is really not changing. And that's fine, because you're not operating under real cost method. Note that the field 'Inventory Value' of a quant is calculated field that gives you the product's standar price under standard / average and the true cost of the quant under real cost method.

From your statements I can see that your use case of inventory revaluation dealt with standard prices in raw materials and finished products. I have the same issue, where a company has screwed inventory valuation due to lack of proper maintenance of standard prices. That's why I'm going for a real costing approach, where you ensure that COGS will be recognized under FIFO costing method, which is the most accurate method of COGS recongition and inventory valuation as well.

@JordiBForgeFlow
Copy link
Member Author

@nhomar I'd be more than happy to discuss this with you in a meeting. You can reach me on skype or Hangouts.

@jgrandguillaume
Copy link
Member

Hi,

That's a very good work, again @jbeficent thank you for all your work. The only remark, such a module would deserve a little test IMO as it really have important impact.

Otherwise LGTM 👍

Regards,

Joël

@JordiBForgeFlow
Copy link
Member Author

For some reason Runbot is killed with the following error message:
2016-02-23 12:24:49,999 1505 ERROR ? openerp.sql_db: Connection to the database failed
Traceback (most recent call last):
File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3142379-118-a0b00e/openerp/sql_db.py", line 560, in borrow
result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
File "/srv/openerp/instances/openerp-oca-runbot/sandbox/local/lib/python2.7/site-packages/psycopg2/init.py", line 179, in connect
connection_factory=connection_factory, async=async)
OperationalError: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

@JordiBForgeFlow
Copy link
Member Author

Runbot is killed because I created a branch from 9.0, not from 8.0. I'm closing this PR and creating a separate one, #121, that uses the correct 8.0 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants