Comment 26 for bug 388145

Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

Ok, is another summary:

* add two properties fields on the product form, on the accounting tab:
   - account_trade_id (many2one to account.account)
   - account_variance_id (many2one to account.account)
   - account_sale_cost_id (many2one to account.account)
These fields are not required and default values are set by chart of accounts.
* when creating a customer invoice, do a transaction with debit/credit equal to cost price of products
using accounts account_sale_cost_id (debit) and account_expense_id (credit)
* When confirming a purchase invoice (only on purchase invoices and purchase refund):
   - if product's "Costing Method" is "standard price":
        use account_variance_id
   - if product's "Costing Method" is "average price":
        use account_trade_id
   and generate accounting entries, using the cost price of the product for the
   expense account (the one already existing on the product form) and the other
   account for the difference between the cost price and real price on the invoice.
   If the account (variance or trade) field is empty, do like currently, assign the whole
   cost to the expense account. (which should be configured to "Accrued Purchases/Uninvoiced
   Purchases" in dhariwal's example)
* Change the stock valuation entries to select the counter-part account based on the location type (customer / supplier) instead of the Physical Stock position (source or destination). If the location type is not customer or supplier, do like currently and use the right account based on the physical stock position (the source or destination of the stock.move).

By doing these small changes, we manage all cases from dariwhal's example.

The only unsupported case is "purchase variants + trade discount at the same time". But, this can be implemented in a separate module.

Terms's discounts are already correct in Open ERP.