Author: |
Vauxoo |
License: |
LGPL-3 |
Branch: |
8.0 |
Repository: |
111sree/addons-vauxoo |
Dependencies: |
purchase,
and
stock_account |
Languages: |
Markdown (155, 25.0%),
PO File (30, 4.8%),
Python (287, 46.2%),
and
XML (149, 24.0%) |
Other repositories: |
Abdullah-Alghoul/addons-vauxoo,
ClearCorp/vauxoo-addons-vauxoo,
CrazyIFriT/addons-vauxoo,
DITIntl/addons-vauxoo,
DudhatShivam/addons-vauxoo,
ERPLibre/addons-vauxoo,
FAY8PTELTD/addons-vauxoo,
FernandoCarlosGarcia/addons-vauxoo,
FullBringEc/addons-vauxoo,
GabbasovDinar/addons-vauxoo,
GrupoAlvamex/addons-vauxoo,
Guobower/addons-vauxoo,
HarshalBhoir/addons-vauxoo,
Ingeos/addons-vauxoo,
InstaERP/addons-vauxoo,
JibenCL/addons-vauxoo,
JorgeJuarezM/addons-vauxoo,
Maanumx/addons-vauxoo,
Mahmoud-Alaa-Eldeen/addons-vauxoo,
MandaTokiniaina/addons-vauxoo,
NothingCtrl/addons-vauxoo,
OutillageStEtienne/addons-vauxoo,
QSoftCorporationEC/addons-vauxoo,
RL-OtherApps/addons-vauxoo,
TheCloneMaster/addons-vauxoo,
Vauxoo/addons-vauxoo,
VitalPet/addons-vauxoo-1,
YevhenPechurin/addons-vauxoo,
aaltinisik/addons-vauxoo,
abdelmaaboud/addons-vauxoo,
adeel982010/addons-vauxoo,
alonejustinone/addons-vauxoo,
amendoncabh/addons-vauxoo,
andreaarce/addons-vauxoo,
anodino-dev/addons-vauxoo,
arasty/addons-vauxoo,
atonaltzin/addons-vauxoo,
aurestic/addons-vauxoo,
bachmanna/addons-vauxoo,
bgavarini/addons-vauxoo,
bimajatiwijaya/addons-vauxoo,
bluelinemx/addons-vauxoo,
bmspy/addons-vauxoo,
bopo/addons-vauxoo,
brain-tec/addons-vauxoo,
caber/addons-vauxoo,
cameroun/addons-vauxoo,
cbaltodano90/addons-vauxoo,
cedvict/addons-vauxoo,
chenjingxiong/addons-vauxoo,
ckardaras/addons-vauxoo,
conectel-dev/addons-vauxoo,
contactek/addons-vauxoo,
corsisa/addons-vauxoo,
daramousk/addons-vauxoo,
diagramsoftware/addons-vauxoo,
dipendra-karki/addons-vauxoo,
dochse/addons-vauxoo,
echeverrifm/addons-vauxoo,
eddybc/addons-vauxoo,
eksotama/addons-vauxoo,
fanzalika/addons-vauxoo,
fauzi-tsani/addons-vauxoo,
frahikLV/addons-vauxoo,
friedi1/addons-vauxoo,
funkring/addons-vauxoo,
gameboy199/addons-vauxoo,
gastonfeng/addons-vauxoo,
gbertolani/addons-vauxoo,
gfcapalbo/addons-vauxoo,
giacomomagini/addons-vauxoo,
gilbert-yuan/addons-vauxoo,
gitmehedi/addons-vauxoo,
gobozgz/addons-vauxoo,
guillermm/addons-vauxoo,
gustavovalverde/addons-vauxoo,
haryoran04/addons-vauxoo,
intellego-bi/addons-vauxoo,
ivanporras/addons-vauxoo,
izzihector/addons-vauxoo,
jason156/addons-vauxoo,
jjsamayoa/addons-vauxoo,
jlaloux/addons-vauxoo,
jsabastizagal/addons-vauxoo,
kingsleyuk2003/addons-vauxoo,
leodoooca/addons-vauxoo,
loctv/addons-vauxoo,
marcelomora/addons-vauxoo,
marcelsavegnago/addons-vauxoo,
marionumza/Vauxoo-addons-vauxoo,
mbenyoub/addons-vauxoo,
mcmx/addons-vauxoo,
mhdsyarif/addons-vauxoo,
miguelparaiso/addons-vauxoo,
muk-projects/addons-vauxoo,
n30chido/addons-vauxoo,
nabiforks/addons-vauxoo,
nikols/addons-vauxoo,
nteej/addons-vauxoo,
odic30/addons-vauxoo,
odoocn/addons-vauxoo,
odoofans/addons-vauxoo,
one2pret/addons-vauxoo,
onurugur/addons-vauxoo,
opensert/addons-vauxoo,
oreju/addons-vauxoo,
osiell/addons-vauxoo,
oxidos/addons-vauxoo,
pedroporras/addons-vauxoo,
petypi/addons-vauxoo,
qsoftcorporation/addons-vauxoo,
rafnixg/addons-vauxoo,
rossasa/vauxoo-addons,
rralaiarimanga/addons-vauxoo,
rsosa423/addons-vauxoo,
sadeqamin/addons-vauxoo,
samirthebti/addons-vauxoo,
sc4you/addons-vauxoo,
sdwhwfw/addons-vauxoo,
shouyejing/addons-vauxoo,
skmezanul/addons-vauxoo,
sm2x/addons-vauxoo,
sunny-odoo/addons-vauxoo,
syci/addons-vauxoo,
thopy/addons-vauxoo,
tonihr/addons-vauxoo,
umair-gujjar/addons-vauxoo,
valenciaricardos/addons-vauxoo,
wahhid/addons-vauxoo,
westlyou/addons-vauxoo,
xcorail/addons-vauxoo,
xirobs/addons-vauxoo,
xubiuit/addons-vauxoo,
yasmanycastillo/addons-vauxoo,
and
zlf4535/addons-vauxoo |
<h1>Stock Account Unfuck</h1>
<p>Currently, Odoo considers that all inventory leaves for products with Costing
Method equal to <code>average</code> must be booked at current Price Cost.</p>
<p>Chances that the Costing Price (average) changes are when products are incoming
from Suppliers.</p>
<p>According to Official Documentation the reason this is done is explained <a href="https://www.odoo.com/documentation/user/9.0/accounting/others/inventory/avg_price_valuation.html#purchase-return-use-cas://www.odoo.com/documentation/user/9.0/accounting/others/inventory/avg_price_valuation.html#purchase-return-use-case">here</a></p>
<h2>Odoo's Approach on Purchase Returns - Case Remaining Qty equals zero</h2>
<p>| Date | Transaction | Unit Cost | Average | Move Qty | Inv. Qty | Move Val. | Inv. Val. |
| :--------: | :---------: | --------: | ------: | -------: | -------: | --------: | --------: |
| 12/15/2016 | Purchase 01 | 32.00 | 32.00 | 10 | 10 | 320.00 | 320.00 |
| 12/17/2016 | Purchase 02 | 48.00 | 40.00 | 10 | 20 | 480.00 | 800.00 |
| 12/19/2016 | Sale 01 | 40.00 | 40.00 | -16 | 4 | -640.00 | 160.00 |
| 12/21/2016 | Sale 02 | 40.00 | 40.00 | -2 | 2 | -80.00 | 80.00 |
| <strong>12/23/2016</strong> | <strong>Pur. 01 Ret</strong> | <strong>40.00</strong> | <strong>40.00</strong> | <strong>-2</strong> | <strong>0</strong> | <strong>-80.00</strong> | <strong>0.00</strong> |</p>
<p>Looking at that rationale it is a feasible and acceptable solution that proves
a point.</p>
<p>If this is not done this way and returns are done at cost price of transaction we could end up
with either of two cases:</p>
<h3>Overvalued Inventory with no merchandise</h3>
<p>| Date | Transaction | Unit Cost | Average | Move Qty | Inv. Qty | Move Val. | Inv. Val. |
| :--------: | :---------: | --------: | ------: | -------: | -------: | --------: | --------: |
| 12/15/2016 | Purchase 01 | 32.00 | 32.00 | 10 | 10 | 320.00 | 320.00 |
| 12/17/2016 | Purchase 02 | 48.00 | 40.00 | 10 | 20 | 480.00 | 800.00 |
| 12/19/2016 | Sale 01 | 40.00 | 40.00 | -16 | 4 | -640.00 | 160.00 |
| 12/21/2016 | Sale 02 | 40.00 | 40.00 | -2 | 2 | -80.00 | 80.00 |
| <strong>12/23/2016</strong> | <strong>Pur. 01 Ret</strong> | <strong>32.00</strong> | <strong>-</strong> | <strong>-2</strong> | <strong>0</strong> | <strong>-64.00</strong> | <strong>16.00</strong> |</p>
<blockquote>
<p>It is to be noticed that under normal circumstances <code>Purchase 01 Return</code> can
only be performed if the merchandise sold to the customer is first returned
and then the supplier return can be fulfill as usual. Odoo will complain
because there is no Quant available to be returned.</p>
</blockquote>
<h3>Undervalued Inventory with no merchandise</h3>
<p>| Date | Transaction | Unit Cost | Average | Move Qty | Inv. Qty | Move Val. | Inv. Val. |
| :--------: | :---------: | --------: | ------: | -------: | -------: | --------: | --------: |
| 12/15/2016 | Purchase 01 | 32.00 | 32.00 | 10 | 10 | 320.00 | 320.00 |
| 12/17/2016 | Purchase 02 | 48.00 | 40.00 | 10 | 20 | 480.00 | 800.00 |
| 12/19/2016 | Sale 01 | 40.00 | 40.00 | -16 | 4 | -640.00 | 160.00 |
| 12/21/2016 | Sale 02 | 40.00 | 40.00 | -2 | 2 | -80.00 | 80.00 |
| <strong>12/23/2016</strong> | <strong>Pur. 02 Ret</strong> | <strong>48.00</strong> | <strong>-</strong> | <strong>-2</strong> | <strong>0</strong> | <strong>-96.00</strong> | <strong>-16.00</strong> |</p>
<h2>New Approach on Purchase Returns - Case Remaining Qty greater than zero</h2>
<p>However, for the following case the inventory that leaves cannot be booked at
average cost because that implies an increase/decrease of inventory valuation
without support as shown below.</p>
<p>| Date | Transaction | Unit Cost | Average | Move Qty | Inv. Qty | Move Val. | Inv. Val. |
| :--------: | :---------: | --------: | ------: | -------: | -------: | --------: | --------: |
| 12/15/2016 | Purchase 01 | 32.00 | 32.00 | 10 | 10 | 320.00 | 320.00 |
| 12/17/2016 | Purchase 02 | 48.00 | 40.00 | 10 | 20 | 480.00 | 800.00 |
| 12/19/2016 | Sale 01 | 40.00 | 40.00 | -16 | 4 | -640.00 | 160.00 |
| 12/21/2016 | Purchase 03 | 400.00 | 256.00 | 6 | 10 | 2400.00 | 2560.00 |
| <strong>12/22/2016</strong> | <strong>Pur. 03 Ret</strong> | <strong>256.00</strong> | <strong>256.00</strong> | <strong>-6</strong> | <strong>4</strong> |<strong>-1536.00</strong> | <strong>1024.00</strong> |
| 12/23/2016 | Sale 02 | 256.00 | 256.00 | -2 | 2 | -512.00 | 512.00 |</p>
<blockquote>
<p>This is a real case scenario. Purchase Analyst wrongly set currency on
<code>Purchase 03</code> which increases the cost of merchandise in local currency,
without being noticed it goes freely to Goods Receipt and Warehouse Analyst
receives the merchandise. Average is hugely increased and that action goes
unnoticed. Accounting People realizes about the mistake - wrong currency -
and triggers the process for merchandise returns. Meanwhile, Salesmen prepare
and successfully sales merchandise to one of his customers. Accounting
Analyst realizes that CoGS on <code>Sale 02</code> was wrongly booked and Inventory
Valuation is overvalued and ultimately average is wrongly computed.</p>
</blockquote>
<p>Because the process previously exposed, it is proposed that Purchase Returns to
be performed at Cost of Transaction when remaining inventory is greater than
zero which will result in a Stock Card like the following:</p>
<p>| Date | Transaction | Unit Cost | Average | Move Qty | Inv. Qty | Move Val. | Inv. Val. |
| :--------: | :---------: | --------: | ------: | -------: | -------: | --------: | --------: |
| 12/15/2016 | Purchase 01 | 32.00 | 32.00 | 10 | 10 | 320.00 | 320.00 |
| 12/17/2016 | Purchase 02 | 48.00 | 40.00 | 10 | 20 | 480.00 | 800.00 |
| 12/19/2016 | Sale 01 | 40.00 | 40.00 | -16 | 4 | -640.00 | 160.00 |
| 12/21/2016 | Purchase 03 | 400.00 | 256.00 | 6 | 10 | 2400.00 | 2560.00 |
| <strong>12/22/2016</strong> | <strong>Pur. 03 Ret</strong> | <strong>400.00</strong> | <strong>40.00</strong> | <strong>-6</strong> | <strong>4</strong> |<strong>-2400.00</strong> | <strong>160.00</strong> |
| 12/23/2016 | Sale 02 | 40.00 | 40.00 | -2 | 2 | -80.00 | 80.00 |</p>
<h2>New Approach on Sales Returns</h2>
<p>Besides, incoming merchandise not coming from suppliers does not alter the
average cost price, i.e., sales returns.</p>
<p>For example, if merchandise is sold to a customer and after some time and some
purchase transactions, merchandise from the previous Sales Order is returned.
According to Odoo Sales are return at current average price and not at Sales
average price. In doing so, means that inventories will end building up
creating profits or losses because the original value was less or greater.</p>
<p>| Date | Transaction | Unit Cost | Average | Move Qty | Inv. Qty | Move Val. | Inv. Val. |
| :--------: | :---------: | --------: | ------: | -------: | -------: | --------: | --------: |
| 12/15/2016 | Purchase 01 | 32.00 | 32.00 | 10 | 10 | 320.00 | 320.00 |
| 12/17/2016 | Sale 01 | 32.00 | 32.00 | -6 | 4 | -192.00 | 128.00 |
| 12/19/2016 | Purchase 02 | 48.00 | 40.00 | 4 | 8 | 192.00 | 320.00 |
| <strong>12/22/2016</strong> | <strong>Sale 01 Ret</strong> | <strong>40.00</strong> | <strong>40.00</strong> | <strong>6</strong> | <strong>14</strong> | <strong>240.00</strong> | <strong>560.00</strong> |</p>
<p>As we can see Sale 01 Delivery was booked as follows:</p>
<p>| Account | Debit | Credit |
| :---------------- | -----: | -----: |
|Stock Out | 192.00| |
|Inventory Valuation| | 192.00|</p>
<p>Sale 01 Invoice was booked as followed:</p>
<p>| Account | Debit | Credit |
| :---------------- | -----: | -----: |
|Receivable | 250.00| |
|Income | | 250.00|
|CoGS | 192.00| |
|Stock Out | | 192.00|</p>
<p>Returns - Delivery & Invoice - were booked as follows:</p>
<p>| Account | Debit | Credit |
| :---------------- | -----: | -----: |
|Inventory Valuation| 240.00| |
|Stock Out | | 240.00|</p>
<p>Sale 01 Invoice was booked as followed:</p>
<p>| Account | Debit | Credit |
| :---------------- | -----: | -----: |
|Income | 250.00| |
|Receivable | | 250.00|
|Stock Out | 240.00| |
|CoGS | | 240.00|</p>
<p>As we can see, there is a net increase on Inventory Valuation and the CoGS is
greater than that expected to be refunded by the Return</p>
<p>What is expected is a Stock Card like this:</p>
<p>| Date | Transaction | Unit Cost | Average | Move Qty | Inv. Qty | Move Val. | Inv. Val. |
| :--------: | :---------: | --------: | ------: | -------: | -------: | --------: | --------: |
| 12/15/2016 | Purchase 01 | 32.00 | 32.00 | 10 | 10 | 320.00 | 320.00 |
| 12/17/2016 | Sale 01 | 32.00 | 32.00 | -6 | 4 | -192.00 | 128.00 |
| 12/19/2016 | Purchase 02 | 48.00 | 40.00 | 4 | 8 | 192.00 | 320.00 |
| <strong>12/22/2016</strong> | <strong>Sale 01 Ret</strong> | <strong>32.00</strong> | <strong><em>36.57</em></strong> | <strong>6</strong> | <strong>14</strong> | <strong>192.00</strong> | <strong>512.00</strong> |</p>
<p>Which results on a change on average cost when merchandise is returned and
keeps both the Inventory Valuation and CoGS in harmony</p>
<h1>Conclusions:</h1>
<pre><code>- When returns are made to suppliers and remaining quantity is zero Odoo's
approach will be used leading to avoid over/under-valuation of inventory,
i.e., average cost price will be used.
- When returns are made to suppliers and remaining quantity is different
than zero then the transaction cost at which the merchaside was let in
will be used.
- When returns are made to stock from other locations these are done a
transaction cost.
</code></pre>
<h1>The Overall Expected Result:</h1>
<p>In the image below is shown a <strong>Stock Card</strong> for Product <code>VX Victrola</code> with
transactions as follows:</p>
<ol>
<li>Purchase Order for 10 items @ $100 Cost Price - Long Blue Arrow Tail.</li>
<li>Sale Order for 4 items @ $100 (CoGS).</li>
<li>Sale Order for 5 items @ $100 (CoGS) - Black Arrow Tail.</li>
<li>Purchase Order for 3 items @ $300 Cost Price - Red Arrow Tail.</li>
<li>Sale Order for 3 items @ $250 (CoGS).</li>
<li>Customer Returns 1 items @ $100.00 - Cost of Good when it was sold - Black
Arrow Head - <strong>Average changes</strong>.</li>
<li>Purchase Order for 5 items @ $220 Cost Price - Short Blue Arrow Tail.</li>
<li>Purchase Order for 3 items @ $400 Cost Price - Orange Arrow Tail.</li>
<li>Return to Supplier 5 items from transaction <code>7</code> @ $220 - Short Blue Arrow
Head - <strong>Average changes</strong>.</li>
<li>Return to Supplier 1 items from transaction <code>4</code> @ $300 - Red Arrow Head -
<strong>Average changes</strong>.</li>
<li>Return to Supplier 1 items from transaction <code>1</code> @ $100 - Long Blue Arrow
Head - <strong>Average changes</strong>.</li>
<li>Return to Supplier 3 items from transaction <code>8</code> @ <code>average</code> - Orange Arrow
Head - <strong>Average is kept the same</strong>.</li>
</ol>
<p><img src="/stock_account_unfuck/images/stock_card.png" alt="Stock Card"></p>
<p>As you can see we are trying to comply with the three cases in the scenario.</p>
<p>Now in the next image we are showing you that Accounting can be hand-in-hand
with logistics.</p>
<p>All the Journal Items are the ones for the Stock Valuation Account for the
product being presented previously.</p>
<p><img src="/stock_account_unfuck/images/journal_items.png" alt="Journal Items"></p>