# Add wizard to account the stock valuation

**URL:** https://discuss.tryton.org/t/add-wizard-to-account-the-stock-valuation/3415
**Category:** Feature
**Created:** [October 30, 2020, 8:59am UTC](https://discuss.tryton.org/t/add-wizard-to-account-the-stock-valuation/3415 "2020-10-30T08:59:41Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [October 30, 2020, 8:59am UTC](https://discuss.tryton.org/t/add-wizard-to-account-the-stock-valuation/3415/1 "2020-10-30T08:59:41Z")

</div>

Continuing the discussion from [How to create account move for goods on the way](https://discuss.tryton.org/t/how-to-create-account-move-for-goods-on-the-way/3298/5):

## Rational

There are some companies that just create a move with all the inventory value moves at the end of the period/fiscalyear. Currently this should be done manually, but when managing a large amount of products this is quiet tedious.

## Proposal

Add a wizard that computes the valuation of goods at date selected by the user. With this valuation a new account move is created with the credit debit values needed to update the balance of each product account to the valuation at the given date.

This wizard should be only accessible for companies and dates which a fiscalyear that has the accounting method set as _manual_.

To execute the wizard the user should have closed an account period for the given date. This way we ensure that no changes are done after the balances are updated.

## Implementation

> **[Add wizard to balance stock (#9780) · Issues · Tryton / Tryton · GitLab](https://foss.heptapod.net/tryton/tryton/-/issues/9780)**
>
> Following: https://discuss.tryton.org/t/add-wizard-to-account-the-stock-valuation/3415

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [October 30, 2020, 9:04am UTC](https://discuss.tryton.org/t/add-wizard-to-account-the-stock-valuation/3415/2 "2020-10-30T09:04:08Z")

</div>

I’m not sure how to structure this as it requires to use some concepts already available on the account\_stock\_continental module:

1. The accounts (stock, stock\_in and stock\_out) used for each accounting category
2. The stock journal defined on the account configuration.

I see two options here:

1. Create a new account\_stock module which defines the common concepts of all of the account\_stock\_\* modules and create a new account\_stock\_wizard module which implements the required features.
2. Move everything to the new module where we should implement the wizard and add this module as dependency of the current account\_stock\_continental module.

---

<div class="post-metadata">

### Author: ![albert](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/albert/32/21_2.png) [@albert](https://discuss.tryton.org/u/albert)
#### Post date: [October 30, 2020, 9:29am UTC](https://discuss.tryton.org/t/add-wizard-to-account-the-stock-valuation/3415/3 "2020-10-30T09:29:30Z")

</div>

> [@pokoli](#):
>
> - Create a new account\_stock module which defines the common concepts of all of the account\_stock\_\* modules and create a new account\_stock\_wizard module which implements the required features.
> - Move everything to the new module where we should implement the wizard and add this module as dependency of the current account\_stock\_continental module.

I would add a third option, which is adding it to account\_product module.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [October 30, 2020, 11:06am UTC](https://discuss.tryton.org/t/add-wizard-to-account-the-stock-valuation/3415/4 "2020-10-30T11:06:09Z")

</div>

> [@pokoli](#):
>
> With this valuation a new account move is created with the credit debit values needed to update the balance of each product account to the valuation at the given date.

How will you compute the variation? Because you must only book the variation of value.  
I guess we could compute the target balance for each account and take the balance of each account at that date. So the move line will be the difference.

Also how will it work for accounting that are doing COGS?

> [@pokoli](#):
>
> This wizard should be only accessible for companies and dates which a fiscalyear that has the accounting method set as _manual_ .

Also I think it will require that the stock period is closed to ensure no more change will happen.

> [@pokoli](#):
>
> Create a new account\_stock module which defines the common concepts of all of the account\_stock\_\* modules and create a new account\_stock\_wizard module which implements the required features.

For me it increase the complexity to have a empty shell module. Also a module just for a wizard seems overkill.

> [@pokoli](#):
>
> Move everything to the new module where we should implement the wizard and add this module as dependency of the current account\_stock\_continental module.

This sounds like the right way.

> [@albert](#):
>
> I would add a third option, which is adding it to account\_product module.

I do not see why, this module does not depend on stock. It would be wrong to add such dependencies for setup that requires only accounting and invoicing.

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [October 30, 2020, 11:32am UTC](https://discuss.tryton.org/t/add-wizard-to-account-the-stock-valuation/3415/5 "2020-10-30T11:32:38Z")

</div>

> [@ced](#):
>
> I guess we could compute the target balance for each account and take the balance of each account at that date. So the move line will be the difference.

You guess is right. That was my idea.

> [@ced](#):
>
> Also how will it work for accounting that are doing COGS?

The idea is to not manage COGS on manual accounting. If there is the need of COGS you should switch to Anglo-Saxon accounting which is based on moves like continental.

> [@ced](#):
>
> Also I think it will require that the stock period is closed to ensure no more change will happen.

Makes sense. I add it to the proposal.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [October 30, 2020, 11:52am UTC](https://discuss.tryton.org/t/add-wizard-to-account-the-stock-valuation/3415/6 "2020-10-30T11:52:09Z")

</div>

> [@pokoli](#):
>
> The idea is to not manage COGS on manual accounting.

Indeed it could be done if on `account_stock_anglo_saxon` the COGS move was done on invoice also for a manual-anglo-saxon method but using the current cost price of the goods.  
I think it is something that should be handled if we add a manual method.

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [October 30, 2020, 2:11pm UTC](https://discuss.tryton.org/t/add-wizard-to-account-the-stock-valuation/3415/7 "2020-10-30T14:11:39Z")

</div>

So IIUC when using the manual-anglo-saxon method, the wizard should take care to correctly compute and update the COGS balance?

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [October 30, 2020, 2:18pm UTC](https://discuss.tryton.org/t/add-wizard-to-account-the-stock-valuation/3415/8 "2020-10-30T14:18:41Z")

</div>

I do not think you can valuate the COGS at the end of the period.  
I think it is better that the invoice keep filling COGS when posted. So the move posted by the wizard stays the same but the invoice must do the posting.

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [November 2, 2020, 12:54pm UTC](https://discuss.tryton.org/t/add-wizard-to-account-the-stock-valuation/3415/9 "2020-11-02T12:54:42Z")

</div>

I’ve filled [Add wizard to balance stock (#9780) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue9780) which implements the wizard.  
It will be great to have some feedback about it.
