Commit Graph

946 Commits

Author SHA1 Message Date
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
Goffin Simon 6947313cd0 [FIX] purchase: customer lang
Introduced by f7f18ba5b1
The lang of the customer must be used.
In the drop shipping use case (order.location_id.usage == 'customer'), the customer
is in the destination address of the order (order.dest_address_id).

opw:647628
2015-08-24 11:37:09 +02:00
Goffin Simon f7f18ba5b1 [FIX] purchase: description of a product
When a move is creating from a purchase order line and the destination
of the order("location_id") is "customer", the description of the created
move must be the name of the product. To avoid that the supplier description
of the product appears on the customer invoice because in "drop shipping",
the customer invoice line is created with this created move by the function
"_get_invoice_line_vals".

opw:647628
2015-08-20 11:24:53 +02:00
Goffin Simon ad253a3386 [FIX] purchase, stock_dropshipping: origin in PO
When a product is in "dropshipping" with one supplier and with a few SO
created for the same customer, the origin of the resulting PO must
include all the SO names.

opw:647409
2015-08-18 11:01:27 +02:00
Nicolas Martinelli 9b1ab76eb2 [IMP] purchase: invoice state of PO line calculated from invoice state of move
Before this fix, a PO line was set as invoiced if all associated invoices were
validated. This is an issue if the invoice_method of a PO is set on 'picking',
and that only a partial quantity is received and invoiced. Indeed, in this case
it was never possible to meet the condition, and the PO could not be set to
'done'.

After this fix, the PO line invoice state is calculated from the invoice state
of the related moves, if the invoice_method of a PO is set on 'picking'. This
is more logical, and moreover this makes possible to set a PO line as invoiced
as soon as all the related moves are done or cancelled.

opw-644399
2015-08-03 09:04:43 +02:00
Nicolas Lempereur c1cb489ebe [FIX] purchase: uom for PO without product_id
When a purchase order line doesn't have a product_id, the current onchange
method would return False as uom_id since b675ff1, thus introducing an issue
since uom_id is required and the field may be not shown (so not changeable).

closes #7770
opw-646088
2015-07-28 16:50:52 +02:00
Nicolas Martinelli 24556120e7 [FIX] purchase: apply appropriate fiscal position when PO created automatically
When a PO is created automatically from a procurement, the fiscal position is
not chosen correctly. We need to choose the fiscal position in the same way if
the PO is created manually or automatically.

Follows commit 1062905acb

Fixes #3863
opw-643916
2015-07-07 16:08:11 +02:00
Christophe Simonis 066e41b63d [MERGE] forward port of branch saas-3 up to 31f2a1b 2015-06-30 13:33:35 +02:00
Christophe Simonis 31f2a1bc38 [MERGE] forward port of branch 7.0 up to 1c0bc7c 2015-06-30 12:47:27 +02:00
Daniel Dico a0797d3b35 [IMP] purchase: method action_picking_create return picking_id
Returning `picking_id` can be useful for overrides.

In addition, when there is no return statement,
the method basically returns None.
As this is a public method (not beginning with '_'), it can
be called with an xmlrpc call, and `None` is not an
accepted return value for the xmlrpc protocol.

Closes #1714
2015-06-26 15:56:42 +02:00
czoellner d226771383 [FIX] purchase: ensures invoice lines are linked to PO line
Fixes the impossibility to invoice purchase order lines, which were never
invoiced but set to invoiced by validating a first invoice created by invoice
control "manual".
2015-06-24 14:24:48 +02:00
sve-openerp cd1366a720 [FIX] purchase: Missing log in procurement chatter when deleting a PO line.
When a PO line is deleted, it sets the related procurements in exception.
This fix logs this action in the procurement chatter, for WMS administration
and maintenance purposes.
2015-06-22 14:34:35 +02:00
Nicolas Martinelli c7fad1313a [FIX] purchase: a procurement is done if all moves related are done
In case of a partial delivery of the products to receive, the procurement is
not considered as done since procurement.purchase_line_id.order_id.shipped is
false.

opw-641503
2015-06-17 06:50:20 +02:00
Nicolas Martinelli 5ada7bb0d0 [FIX] purchase: does not use minimum seller qty if delivery address is customer
This prevents to use the minimum quantity of the seller in case of dropshipping
2015-06-12 14:05:03 +02:00
Guewen Baconnier c315377d00 [IMP] purchase: Ignore canceled purchase lines
Canceled lines must be excluded from most of the operations done on a purchases orders.
The check has been done in some places but some of the loops on the order lines do not do it.
This commit correct them.
2015-06-08 18:19:38 +02:00
Nicolas Martinelli 9ce57d55e7 [FIX] purchase: add a trigger to minimum_date_planned
This triggers allows the minimum_date_planned to be calculated when PO are
merged.

opw-640541
2015-06-01 11:22:23 +02:00
Christophe Simonis e20dcda50d [MERGE] forward port of branch 7.0 up to 99c87b6 2015-05-21 16:33:45 +02:00
Olivier Dony 53980b7c52 [FIX] account, mail, etc.: uniformize evaluated expressions
opw-626694
2015-05-21 16:07:21 +02:00
Denis Ledoux 75aa699f62 [MERGE] forward port of branch saas-3 up to 6026c2f 2015-05-20 13:41:03 +02:00
Denis Ledoux 6026c2f4d0 [MERGE] forward port of branch 7.0 up to cc61d46 2015-05-20 13:39:39 +02:00
Goffin Simon cc61d467fa [FIX] purchase: validate invoice
A user that has the rights in Accounting & Finance equal to Invoicing & Payments
must have the right to validate a supplier invoice.

opw:634601
2015-05-19 14:14:07 +02:00
Christophe Simonis f722254018 [MERGE] forward port of branch saas-3 up to 0f5b6cf 2015-05-18 17:13:50 +02:00
Christophe Simonis 0f5b6cf60b [MERGE] forward port of branch 7.0 up to c435b84 2015-05-18 17:13:18 +02:00
Denis Ledoux acd61f8f0e [FIX] purchase: deletion of PO lines in states other than approved/done
This is related to revision 65d7cc524d

The `order_line` field of `purchase.order` is readonly within states
aprroved, done. See the field definition. This means it should be
possible to remove lines of a `purchase.order` when the PO is in
any other state than approved or done.

Therefore, the deletion of lines shouldn't be prevented
when the PO is not in state approved or done

opw-634538
2015-05-13 11:42:09 +02:00
Nicolas Martinelli 610a461099 [FIX] purchase: update and cancel of purchase order line takes into account existing procurements
Update:
When an existing purchase order line is updated, for example if a new procurement was required,
we check if the sum of existing running linked procurements is larger than the quantity in the
purchase order. If it is the case, we update the quantity and the unit price accordingly.
Without this fix, we systematically add the procurement quantity (or the provider minimum quantity)
to the purchase order line, even if the sum of the procurements is smaller than the ordered
quantity.

Cancel:
When a procurement is cancelled, we recompute the unit price of the associated purchase order
according to the quantity and make sure the provider minimum quantity is met. If the required
quantity is zero, we cancel and unlink the purchase order line.

opw: 632175 and 632176
2015-05-07 11:19:28 +02:00
Goffin Simon 1062905acb [IMP] purchase: fiscal positions
Automatic detection of a fiscal position is now working for Purchase.

opw:631554
2015-04-28 11:05:03 +02:00
Denis Ledoux cf4d14ce39 [MERGE] forward port of branch saas-3 up to 09b277c 2015-04-27 14:02:52 +02:00
Denis Ledoux d6ae7fb7db [MERGE] forward port of branch 7.0 up to 3e7d3c7 2015-04-27 12:19:43 +02:00
Martin Trigaux 316be12a3c [FIX] purchase: mark order as invoiced when fully invoiced only
Make sure the purchase order is marked as invoiced only when fully invoiced.
If the invoices are generated on delivery order (invoice_method picking), make
sure all products are delivered before setting it as invoiced.
opw 614256
2015-04-24 10:46:42 +02:00
Nicolas Martinelli 4a7159ca78 [FIX] purchase: merge RFQ if same currency and merge order lines in appropriate RFQ
- RFQ of same currency are merged (fixes #5901 and opw: 632594)
- Merge order lines in the appropriate RFQ
2015-04-15 14:10:27 +02:00
Martin Trigaux cbd396d3da [FIX] purchase: use order date to set the picking date
When creating a pickign from a purchase order, do not use the schedule date
('date_planned') to specify the creation date ('date') of a picking.
There is already field called Scheduled Date ('min_date') and Max Expected Date
('max_date') that can display this information, this is redundand.

Fixes #4352
2015-04-02 17:48:35 +02:00
Josse Colpaert 20312e2880 [IMP] Deleting PO lines should work the same way as Cancelling PO
Also the test is adapted.  When a product as treated as MTO, it should not
without notice change to an MTS.
2015-03-13 13:58:19 +01:00
Christophe Simonis c0496ed03a [MERGE] forward port of branch saas-3 up to f8a9405 2015-03-10 18:00:43 +01:00
Christophe Simonis f8a94057e5 [MERGE] forward port of branch 7.0 up to a5e3269 2015-03-10 17:51:16 +01:00
David Monjoie 6758b4cfc5 [FIX][REF] purchase: prevent confirming order if no stockable item
After discussing with jco, we decided to keep it simple and have a coherent behavior between different versions, we then changed the behavior from the one of jbefficient PR at 92adf673f7.
2015-03-10 14:22:32 +01:00
Christophe Simonis 416f0246ac [MERGE] forward port of branch saas-3 up to 4a3c471 2015-03-09 12:03:22 +01:00
Christophe Simonis 4a3c4713e9 [MERGE] forward port of branch 7.0 up to 209ce6f 2015-03-09 11:24:32 +01:00
jbeficent a81a7513b2 [FIX] purchase: prevent user to confirm a purchase order when there is a service product in it and invoicing is based on incoming shipments
Fix for issue 3492 and opw 628377
2015-03-04 11:37:54 +01:00
Goffin Simon 631d2f7146 [FIX] purchase: pricelist and related currency mismatch on purchase order (Bid received).
pricelist must be readonly when currency is readonly because there 's an onchange on currency which depends
on the pricelist.

opw:627009
Fixed #4598
2015-03-02 08:44:45 +01:00
Denis Ledoux 31527c9a36 [MERGE] forward port of branch saas-3 up to 4c7e078 2015-02-17 11:10:10 +01:00
Denis Ledoux 550910a8f6 [MERGE] forward port of branch 7.0 up to a87d60f 2015-02-16 18:26:45 +01:00
Denis Ledoux 11bd7a6774 [FIX] purchase: order line description being reset on qty change
The name must be changed when changing of product,
but not for other changes, quantity for instance.
The 'or not uom_id' is just for retro-compatibility concerns
uom_id being False actually means we just changed of product,
and the name must therefore be changed
name as been set as False in the onchange call in the view
for the product_id field, in this rev.,
so the name being False now means th change of product
Nevertheless, existing databases for which the view
is not up to date won't have this change
and we therefore have to rely on something else to know
when the product has been changed or not.

fixes #5295
opw-628138
2015-02-16 14:22:15 +01:00
Martin Trigaux 20e3f33ebd [FIX] purchase: get supplier from the procurement company
The seller_id field is a related that is read administrator so it would fetch
the first line, whatever the company specified.
Setting related_sudo=False would not be enough as creating purchase orders
through the scheduler makes the computation done as administrator.
Use the company of the procurement (required) to search for a supplier.
If no result, fallback on the first one as before.

Fixes #3833, opw 618809
2015-02-13 15:07:45 +05:30
Denis Ledoux 0b18a5afec [FIX] purchase: purchases button on product variants
This rev. is related to 8381d47543

The action action_purchase_line_product_tree is used in both
product templates and product variants forms.
Therefore, the default_product_id: active_id in the context
cannot be used,
As sometimes it will active_id will be a product template,
sometimes it will be a product variant.

I believe two different window actions should be used,
instead of sharing a common one and making hacks.
Nevertheless, as we avoid taking risks in stable releases
This should be done in master.
2015-01-27 10:37:49 +01:00
Martin Trigaux 8598231763 [FIX] purchase: maximum recursion when write on minimum_planned_date
Do not write on the function field when you are writing on the function field.

- Now you do know what orders is right?
- I think I know...
- Orders is orders.
- I guess no one ever taught you not to use the word you're defining in the definition.
   ~~Lucky Number Slevin
2015-01-22 14:37:53 +01:00
Jeremy Kersten 38f0e59d37 [FIX] Purchase: replace SQL by ORM because ORM replace date=False by date is null automatically. Fix #4691 2015-01-16 12:53:07 +01:00
Josse Colpaert 6ea0cc41b9 [FIX] Drop shipping invoice correction
When invoicing from dropshipping picking, choose the correct partner.
Also, change the partner on the picking to be the partner of the purchase.
Change the picking report to include the destination partner or the warehouse address on the right.

[IMP] Only put partner_id on move from purchase when really necessary

[FIX] Default value of partner on stock move should be False
2015-01-06 15:21:35 +01:00
Josse Colpaert 6f8546dfb5 [FIX] Make sure we can select dropship on purchase order and see the related customer and invoicing based on shipments works for sale only
[FIX] Sale should lead to invoicing
[IMP] Journal should not depend on picking type code when in dropship

Make sure drop shipment with invoicing on sale orders only, works.
Also the picking type of dropshipping should be incoming.  This
makes it possible to select it on the purchase order.  This also fixes #3421.
And we can create a dropship from a purchase only. (not the good way)
For this, we make the invoicing based on the shipment look at the
purchase related and not on its picking type code as the picking type
of dropshipping is changed back to incoming.
The purchase order will also show the customer address when in
a dropship case.

Closes #3421
2014-12-17 17:10:40 +01:00
Denis Ledoux 162eb84438 [MERGE] forward port of branch 7.0 up to f46fa1d 2014-12-12 15:44:44 +01:00
Martin Trigaux 940b5beb26 [FIX] purchase: cancel PO lines and set related procurements in exception on cancelation of a PO 2014-12-11 14:15:56 +01:00