Commit Graph
29 Commits
Author SHA1 Message Date
oco-odoo d9a3b938fe [IMP] account, sale, purchase, l10n_latam, l10n_ar: add the possibility to use subtotals above tax groups when displaying them
A new field on tax groups makes it now possible for this group to be displayed under a subtotal label. If not set, this defaults instead to "Untaxed Amount", keeping the traditional behavior. This is intended for withholding taxes, which can now be implemented with negative taxes and a tax group with this field set.

To do that, this commit entirely refactors the way amount_by_group worked, and replaces it with a more complete json field called tax_totals_json. It also streamlines the way taxe totals are displayed on invoices, PO and SO and makes it so that a common code is called instead of copy-pasting the same block 3 times as before.

[IMP] purchase: always display tax totals by groups on purchases orders

Before, tax totals on purchase.order's form were not shown by group, and were instead all aggregated in a single "Taxes" category. The same went for the pdf export. The portal view, though, did show the totals by group. We now display the tax groups in the same way all the time.

closes odoo/odoo#74138

Task: 2457374
Related: odoo/enterprise#19802
Related: odoo/upgrade#2670
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-09-02 14:15:13 +00:00
jbw 064edb2223 [IMP] account, sale, purchase: accrued entries from purchase & sales orders.
Accrued liabilities, or accrued expenses, occur when you incur an expense that you haven’t been billed for (aka a debt).
For example, you receive a good now and pay for it later (e.g., when you receive the invoice). The same opposite approach for sales.

Why do accountants need such entries ?
- Accounting must give a fair view of the financial situation of a company. The loss/profit must be booked regarding the effective deliveries of goods/services, not on the paperwork only.
- On a fiscal point of view, if you want to be allowed to deduct a loss from your taxable basis, it has to be in the right period. If you didn't announce it on time, the loss might be rejected by fiscal authorities. Same goes for the augmentation of the taxable basis, it has to reflect real deliveries and not only paperwork.

was Task: 2555642
was PR #73707

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-08-26 11:34:14 +00:00
yhu-odoo d0455ae64b [IMP] purchase: make billing consitent with sale invoicing
========
Purpose
========

Currently, purchase missing some billing functions that we have in sale
invoicing:
 - Create credit note when necessary
 - Create vendor bill in batch in list view

========
Spec
========

 - In case of retures, when create a bill for a purchase order, we check
the total amount we want to bill to decide whether it's a vendor bill or
a credit note.
 - In the list view, add a new action to create vendor bill/credit note
for all selected order.

========
Links
========

Task 2170715
PR #44210

Related: odoo/upgrade#919
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-03-27 09:33:21 +00:00
William Henrotin 235827d890 [FIX] purchase: purchase user should be able to create vendors bills
Before this patch, the purchase users get an access violation error
at the invoice creation from a purchase order. This was due to
some missing ACL between v12 and v13.

Task : 2206969

X-original-commit: 4c4fb33e4bbc78a85ad309baf5df906cf16566ea
2020-03-26 10:26:17 +00:00
Simon Lejeune 9197c0ad23 [ADD] purchase: test planned date
task-2032417

closes odoo/odoo#35148

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-08-01 08:11:59 +00:00
Hetashree Chauhan b5cea7e2b6 [IMP] purchase: purchase report improvement
Modify purchase report in order to make it consistent with
sales report.
For the RFQ it will show the Order Date and for the Purchase order
menu it will display the Confirmation Date.

Also rewrite a bit the SQL view in order to compute every purchase
order in the company currency.

Technicaly rewrite the SQL alias in order to have a report more
readable in the future.

Task ID : 1857130.

closes odoo/odoo#28248

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-05-31 09:06:30 +00:00
jem-odoo 8d4609a1db [MOV] purchase: move file in purchase_stock 2018-05-23 10:13:48 +02:00
Arnaud Baes 438006b56d [ADD] stock: replenish wizard
This wizard allows the stock users to replenish a product using the
routes applied to this product. A specific route can also be applied
to bypass the default route.

This replaces the "request procurement" wizard from v10, lost during the
stock refactoing.

Task ID: 47938
related to #22041
2018-04-04 16:06:19 +02:00
Olivier Colson 98ee15977a [IMP] stock_account, anglo-saxon accounting: help to clear out interim accounts
Accounting entries made for invoices and stock valuation on the interim accounts (stock input/output accounts) are now reconciled together for both sales and purchases. This will definitively help to have those accounts zero-outed when all operations are processed.

The reconciliation is made as long as the stock valuation is set in real-time, whatever the costing method.

Note that change change also allow a particular use case to be solved: when a purchase is made in a foreign currency whose rate change between the incoming shipment reception and the bill validation (there will be an automated exchange rate entry created).

Was task 32331. Was PR #22483
2018-03-28 13:45:47 +02:00
Pragnesh Mistry aa13ed876e [IMP] purchase: Convert yml files to python and xml 2017-11-16 14:49:05 +01:00
Simon Lejeune 7392e476b8 [FIX] stock_account: always call _get_price_unit in _action_done of a move
It is possible that the price unit the move was created with is no
longer valid (for instance, one could change the price unit on the
purchase before validating the receipt, or the currency rate has changed
in the meantime).

Fixes #20035
2017-10-13 17:56:50 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Mansi Trivedi 2860414de4 [ADD] purchase: Add python tests for default lead time
Case 1: To check order date of purchase order and schedule dates of shipment and purchse order,
	  - Configure lead times:
        	- At a product level set Delivery Lead Time
		- At a company level set Purchase Lead Time

Case 2: To check order date of purchase order and schedule dates of multiple purchase order line of the same purchase order,
        we create two procurements for the two different product with same vendor and different Delivery Lead Time

Case 3: To check order date of purchase order and schedule dates of shipments and purchase order,
 	 - Configure lead times:
		- At a product level set Delivery Lead Time
		- At a route level set delay of push rules

Detailed Use Cases
==================

Consider today's date = 2016-04-21 ( date_planned of procurement = today's date + 10 days)

CASE 01:
========

Create Product
--------------
Name : Product A
Product type : stockable
Buy : True
Make To Order : True
Delivery Lead Time :  5 days

Configure your company data
---------------------------
Purchase Lead Time : 3.00 days

Procurement Request
-------------------
Warehouse : YourCompany
Product : Product A
Quantity :  15.00
Planned Date: 2016-05-01 00:00:00

Confirm Purchase Order

Result
------
Purchase Order :-- Schedule date: 2016-04-28 00:00:00
    Order date: 2016-04-23 00:00:00
Incoming shipments schedule date :-- 2016-04-28 00:00:00

CASE 02:
========

Create Product
--------------
Name : Product A
Product type : stockable
Buy : True
Make To Order : True
Delivery Lead Time :  5 days

Create another Product
----------------------
Name : Product B
Product type : stockable
Buy : True
Make To Order : True
Delivery Lead Time :  2 days

Procurement Request
-------------------
Warehouse : YourCompany
Product : Product A
Quantity :  10.00
Planned Date: 2016-05-01 00:00:00

Procurement Request for second product
--------------------------------------
Warehouse : YourCompany
Product : Product B
Quantity :  5.00
Planned Date: 2016-05-01 00:00:00

Confirm Purchase Order

Result
------
Purchase Order :-- Schedule date: 2016-04-28 00:00:00
    Order date: 2016-04-26 00:00:00
    Schedule date of purchase order line for product A: 2016-05-01 00:00:00
    Schedule date of purchase order line for product B: 2016-04-28 00:00:00
Incoming shipments schedule date :-- 2016-04-28 00:00:00

CASE 03:
========

Create Product
--------------
Name : Product A
Product type : stockable
Buy : True
Make To Order : True
Delivery Lead Time :  5 days

Warehouse configuration (YourCompany)
-------------------------------------
Incoming shipments : three steps

Routes
------
YourCompany : Receipt in 3 steps
Push Rules:
-----------------
WH: Input -> Quality Control :-- Delay : 2 days
WH: Quality Control -> Stock  :-- Delay : 2 days

Create Procurement:
-------------------
Product : Prosuct A
Quantity : 5.000
Warehouse : YourCompany
Procurement Location : WH/Input
Schedule date : 2016-05-01 10:30:43
Notes : 'Test scheduler for RFQ'

Confirm Purchase Order

Result
------
Purchase Order :-- Schedule date: 2016-05-01 10:30:43
    Order date: 2016-04-26 10:30:43
Incoming shipments schedule dates :--
In type :--  2016-05-01 10:30:43
Internal type 1 :--  2016-05-03 10:30:43
Internal type 2 :--  2016-05-05 10:30:43
2016-11-03 15:25:46 +01:00
Christophe Simonis 4a5d060123 Revert "[ADD] purchase: Add python tests for default lead time"
Broken test.

This reverts commit 83de09d895.
2016-11-02 10:21:35 +01:00
Mansi Trivedi 83de09d895 [ADD] purchase: Add python tests for default lead time
Case 1: To check order date of purchase order and schedule dates of shipment and purchse order,
	  - Configure lead times:
	        - At a product level set Delivery Lead Time
		- At a company level set Purchase Lead Time

Case 2: To check order date of purchase order and schedule dates of multiple purchase order line of the same purchase order,
        we create two procurements for the two different product with same vendor and different Delivery Lead Time

Case 3: To check order date of purchase order and schedule dates of shipments and purchase order,
	  - Configure lead times:
		- At a product level set Delivery Lead Time
		- At a route level set delay of push rules

Detailed Use Cases
==================

Consider today's date = 2016-04-21 ( date_planned of procurement = today's date + 10 days)

CASE 01:
========

Create Product
--------------
Name : Product A
Product type : stockable
Buy : True
Make To Order : True
Delivery Lead Time :  5 days

Configure your company data
---------------------------
Purchase Lead Time : 3.00 days

Procurement Request
-------------------
Warehouse : YourCompany
Product : Product A
Quantity :  15.00
Planned Date: 2016-05-01 00:00:00

Confirm Purchase Order

Result
------
Purchase Order :-- Schedule date: 2016-04-28 00:00:00
    Order date: 2016-04-23 00:00:00
Incoming shipments schedule date :-- 2016-04-28 00:00:00

CASE 02:
========

Create Product
--------------
Name : Product A
Product type : stockable
Buy : True
Make To Order : True
Delivery Lead Time :  5 days

Create another Product
----------------------
Name : Product B
Product type : stockable
Buy : True
Make To Order : True
Delivery Lead Time :  2 days

Procurement Request
-------------------
Warehouse : YourCompany
Product : Product A
Quantity :  10.00
Planned Date: 2016-05-01 00:00:00

Procurement Request for second product
--------------------------------------
Warehouse : YourCompany
Product : Product B
Quantity :  5.00
Planned Date: 2016-05-01 00:00:00

Confirm Purchase Order

Result
------
Purchase Order :-- Schedule date: 2016-04-28 00:00:00
    Order date: 2016-04-26 00:00:00
    Schedule date of purchase order line for product A: 2016-05-01 00:00:00
    Schedule date of purchase order line for product B: 2016-04-28 00:00:00
Incoming shipments schedule date :-- 2016-04-28 00:00:00

CASE 03:
========

Create Product
--------------
Name : Product A
Product type : stockable
Buy : True
Make To Order : True
Delivery Lead Time :  5 days

Warehouse configuration (YourCompany)
-------------------------------------
Incoming shipments : three steps

Routes
------
YourCompany : Receipt in 3 steps
Push Rules:
-----------------
WH: Input -> Quality Control :-- Delay : 2 days
WH: Quality Control -> Stock  :-- Delay : 2 days

Create Procurement:
-------------------
Product : Prosuct A
Quantity : 5.000
Warehouse : YourCompany
Procurement Location : WH/Input
Schedule date : 2016-05-01 10:30:43
Notes : 'Test scheduler for RFQ'

Confirm Purchase Order

Result
------
Purchase Order :-- Schedule date: 2016-05-01 10:30:43
    Order date: 2016-04-26 10:30:43
Incoming shipments schedule dates :--
In type :--  2016-05-01 10:30:43
Internal type 1 :--  2016-05-03 10:30:43
Internal type 2 :--  2016-05-05 10:30:43
2016-10-21 15:22:06 +02:00
Denis Vermylen (dve) ba3d3582bc [MIG] purchase: Migrate to new API 2016-08-05 14:04:37 +02:00
Fabien Pinckaers 9d4efc81a6 [IMP] purchase: Editable PO + minor fixes 2016-08-02 18:10:48 -07:00
Goffin Simon a9ce4ffb22 [FIX] account, purchase, sale: included taxes
Forward port of 503820acb6 from 8.0

opw:652310
2015-10-23 10:39:12 +02:00
Nicolas Martinelli 0a97702fea [ADD] purchase: add test to check new functionalities 2015-09-07 15:11:47 +02:00
Nicolas Martinelli cb01be235e [IMP] purchase: adaptation due to the new Purchase module
Major changes:
- No generation of invoice from PO
- Remove workflow

Reason: complete rewrite of the Purchase module.

Responsible: fp, nim
2015-09-02 08:19:56 +02:00
Christophe Simonis edeceba7df [MERGE] forward port of branch saas-6 up to 7a768a4
Due to `sale` rewrite (94716a3f14),
the commit 503820acb6 has been partially
ignored (in sale.order.line) and will be rewritten later using new-api.
2015-08-28 15:07:16 +02:00
Denis Ledoux af07b2a075 [MERGE] forward port of branch 8.0 up to 42ecf5e 2015-08-26 14:05:17 +02:00
Goffin Simon 503820acb6 [FIX] account, purchase, sale: included taxes
-account:_fix_tax_included_price
If a fiscal position mapped an included tax on a SO or on a PO line
then the price unit of the product must be recomputed.

-purchase: onchange_product_id test
Test that when an included tax is mapped by a fiscal position, the included tax must be
subtracted to the price of the product.

-sale:product_id_change test
Test that when an included tax is mapped by a fiscal position, the included tax must be
subtracted to the price of the product.

opw:647321
2015-08-26 09:02:39 +02:00
Olivier Dony 0bd4545348 [LEGAL] Use global LICENSE/COPYRIGHT files, remove boilerplate text
- Preserved explicit 3rd-party copyright notices
- Explicit boilerplate should not be necessary - copyright law applies
  automatically in all countries thanks to Berne Convention + WTO rules,
  and a reference to the applicable license is clear enough.
2015-06-02 03:16:04 +02:00
Christophe Simonis 902be20de0 [FIX] *: remove deprecated checks attribute of tests modules 2015-01-19 17:17:26 +01:00
Leonardo Donelli 4a0b13ed92 [REF] remove vim modelines and resulting trailing blank lines
Let 2015 be a year without modelines!
cf #4174
2014-12-31 15:52:13 +01:00
Denis Ledoux 04f3fffdb4 Revert "[ADD] purchase: average price computation test"
This reverts commit 5f9280e854.

These tests have been introduced in 7.0/saas-3, but can no longer be applied in 8.0, as they uses models that do not exist anymore in the new wms.

if such tests do not exist yet in Odoo 8.0, then these tests needs re-work, they cannot be applied like that

Conflicts:
	addons/purchase/tests/test_average_price.py
2014-12-04 10:20:55 +01:00
Julien Legros 5f9280e854 [ADD] purchase: average price computation test 2014-12-02 19:33:23 +01:00
cod-odoo 999300ce5d [IMP] sale,purchase: allow invoicing
(closes #500)

(cherry picked from commit 84c0595aef3a417702c81b5226ae1f61817a2bf8)
2014-09-25 11:18:44 +02:00