Skip to content

Commit

Permalink
Merge f17d721 into c3972d2
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrixcosta committed Jun 12, 2018
2 parents c3972d2 + f17d721 commit 69db868
Show file tree
Hide file tree
Showing 9 changed files with 120 additions and 94 deletions.
105 changes: 105 additions & 0 deletions purchase_landed_costs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@

.. image:: https://img.shields.io/badge/license-LGPL--3-blue.png
:target: https://www.gnu.org/licenses/lgpl
:alt: License: LGPL-3

======================
Purchase Landed Costs
======================

This module adds the possibility to include estimated landed costs to the
average price computation. To define those landed costs, create products
for every landed costs and affect them a distribution type. Don't forget to
as well assign them a specific financial account (the one which will record
the real cost) in order to compare at the end of the year the estimation
with real accounting entries (see stock valuation). The landed costs is
defined in purchase orders. These costs will be distributed according to
the distribution type defined in landed cost:

* value - example custom fees
* quantity - example freight

Note : Products used to define landed cost must have a default "Distribution
Type" set (Value/Quantity).

For each landed cost position (=line) define in a PO, a draft invoice can be
pre-created at PO validation (an option need to be checked). Doing so will
allow you to see those invoices using the view invoice button directly from
the PO. You can define landed cost relative to a whole PO or by PO line (or
both) and the system will distribute them to each line according to the
chosen distribution type.

Note that the landed cost is always expressed in company currency.

Find all landed cost here : Reporting -> Purchase -> Landed costs

Stock valuation:
----------------
As the average price is also used for the stock valuation and because the
computation is based on estimation of landed cost in the PO (done at
incoming shipment reception), you will have a difference with the actual
accounting bookings of landed cost. Stock valuation will have to be
adjusted with a manual journal entry. In order to correct that amount, make
a sum of estimated landed cost (landed cost position) by account and
compare with the real account chart value. You can access those
informations through this menu: Reporting -> Purchase -> Landed costs

Warning:
--------

* Average price will be computed based on the estimation made on the PO - not
from real cost. This is due to the way OpenERP compute average stock: it
stores the updated value at every input, no history, so no way to redefine
the value afterwards.

i.e.
- incomming 01: 100 product A at 50.- AVG = 50.-, stock = 100
- incomming 02: 100 product A at 60.- AVG = 55.-, stock = 200
- delivery 01: 50 product A AVG = 55.-, stock = 150
- Receive the real landed cost of 10.- for incomming 01
=> cannot compute back because no historical price was store for every
transaction. Moreover, in OpenERP I can even
set another average price for a product using the update wizard.


* As the price type of OpenERP is not really well handled, we need to be sure
that price type of cost price in product form is the same as the company
one. Otherwise, when computing the AVG price, it make the convertion in
company currency from the price type currency. This is not related to this
module, but from the core of OpenERP. If you use this module in
multi-company and different currency between company, you'll have to not
share the product between them, even if product are the same (bug:
https://bugs.launchpad.net/ocb-addons/+bug/1238525).

TODO/Ideas:
-----------
* Manage multi-currencies landed costs in PO
* Have the shipped date in landed cost instead of PO date for a better
analysis
* Compute a average purchase price per products while keep cost price as it is
now


Credits
=======

Contributors
------------

* Joël Grand-Guillaume <joel.grand-guillaume@camptocamp.com>
* Ferdinand Gasauer <ferdinand.gasauer@camptocamp.com>

Maintainer
----------

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

To contribute to this module, please visit http://odoo-community.org.
6 changes: 1 addition & 5 deletions purchase_landed_costs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
#
##############################################################################


from . import product
from . import purchase
from . import stock

from . import models

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
96 changes: 7 additions & 89 deletions purchase_landed_costs/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,100 +23,18 @@

{
'name': 'Purchase Landed Costs',
'version': '1.0.1',
'category': 'Warehouse Management',
'description': """
Purchase Landed Costs
=====================
This module adds the possibility to include estimated landed costs to the
average price computation. To define those landed costs, create products
for every landed costs and affect them a distribution type. Don't forget to
as well assign them a specific financial account (the one which will record
the real cost) in order to compare at the end of the year the estimation
with real accounting entries (see stock valuation). The landed costs is
defined in purchase orders. These costs will be distributed according to
the distribution type defined in landed cost:
* value - example custom fees
* quantity - example freight
Note : Products used to define landed cost must have a default "Distribution
Type" set (Value/Quantity).
For each landed cost position (=line) define in a PO, a draft invoice can be
pre-created at PO validation (an option need to be checked). Doing so will
allow you to see those invoices using the view invoice button directly from
the PO. You can define landed cost relative to a whole PO or by PO line (or
both) and the system will distribute them to each line according to the
chosen distribution type.
Note that the landed cost is always expressed in company currency.
Find all landed cost here : Reporting -> Purchase -> Landed costs
Stock valuation:
----------------
As the average price is also used for the stock valuation and because the
computation is based on estimation of landed cost in the PO (done at
incoming shipment reception), you will have a difference with the actual
accounting bookings of landed cost. Stock valuation will have to be
adjusted with a manual journal entry. In order to correct that amount, make
a sum of estimated landed cost (landed cost position) by account and
compare with the real account chart value. You can access those
informations through this menu: Reporting -> Purchase -> Landed costs
Warning:
--------
* Average price will be computed based on the estimation made on the PO - not
from real cost. This is due to the way OpenERP compute average stock: it
stores the updated value at every input, no history, so no way to redefine
the value afterwards.
i.e.
- incomming 01: 100 product A at 50.- AVG = 50.-, stock = 100
- incomming 02: 100 product A at 60.- AVG = 55.-, stock = 200
- delivery 01: 50 product A AVG = 55.-, stock = 150
- Receive the real landed cost of 10.- for incomming 01
=> cannot compute back because no historical price was store for every
transaction. Moreover, in OpenERP I can even
set another average price for a product using the update wizard.
* As the price type of OpenERP is not really well handled, we need to be sure
that price type of cost price in product form is the same as the company
one. Otherwise, when computing the AVG price, it make the convertion in
company currency from the price type currency. This is not related to this
module, but from the core of OpenERP. If you use this module in
multi-company and different currency between company, you'll have to not
share the product between them, even if product are the same (bug:
https://bugs.launchpad.net/ocb-addons/+bug/1238525).
TODO/Ideas:
-----------
* Manage multi-currencies landed costs in PO
* Have the shipped date in landed cost instead of PO date for a better
analysis
* Compute a average purchase price per products while keep cost price as it is
now
Contributors:
-------------
* Joël Grand-Guillaume <joel.grand-guillaume@camptocamp.com>
* Ferdinand Gasauer <ferdinand.gasauer@camptocamp.com>
""",
'version': '8.0.1.0.1',
'author': "Camptocamp,Odoo Community Association (OCA)",
'depends': ['purchase'],
'website': 'http://www.camptocamp.com',
'license': 'AGPL-3',
'data': ['security/ir.model.access.csv',
'security/landed_cost_security.xml',
'purchase_view.xml',
'purchase_landed_costs_data.yml',
],
'data': [
'security/ir.model.access.csv',
'security/landed_cost_security.xml',
'views/purchase_view.xml',
'data/purchase_landed_costs_data.yml',
],
'test': [
'test/landed_costs_based_on_quantity.yml',
'test/landed_costs_based_on_value.yml',
Expand Down
7 changes: 7 additions & 0 deletions purchase_landed_costs/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2018 ABGF (http://www.abgf.gov.br)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from . import product
from . import purchase
from . import stock
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 69db868

Please sign in to comment.