Commit Graph

955 Commits

Author SHA1 Message Date
Danimar Ribeiro 1ac94db8e8 [FIX] context to map_tax
Missing context to map_tax calls
Fixes #9909
2015-12-15 16:10:16 +01:00
Goffin Simon eb993b7f3b [FIX] purchase: supplier taxes in onchange_product_id
When adding a line in a PO with the SUPERUSER_ID all the record rules
didn't apply on him. Then all the supplier taxes set on the  product
were written in the PO line even if some of its were not in the company
of the user. Then with the SUPERUSER_ID, just the company taxes of this
user must be applied. Inspired from product_id_change in model
'sale.order.line'.

opw:659236
2015-12-14 12:15:12 +01:00
Martin Trigaux 44eeb387d3 [FIX] purchase: updating existing PO should keep origin
When a make to order product is sold, a purchase order is created or added to an
existing one. In the second case, the origin of the sale order was lost.
It is now added to the existing source.

opw 656688
2015-12-01 15:23:46 +01:00
Nicolas Martinelli f18399f721 [FIX] purchase: invoice state of PO
If the invoicing policy of a PO is set to "Based on incoming shipments"
and the PO contains a product of type "service", it is never considered
as invoiced, and therefore reach the state "Done".

The reason is that no stock move is linked to this PO line, and
therefore it is never considered as invoiced since we check the invoice
state of the associated sotck moves.

This fix assumes that in this specific case, a PO line for a service is
always invoiced, since there is anyway no incoming shipment linked to
it.

opw-654317
2015-11-17 13:40:37 +01:00
Goffin Simon bdcae86d67 [FIX] purchase: invoiced purchase order line
When invoice_method == 'picking', a po line is invoiced if all the lines
linked to the po line are in invoices with state not in ['draft', 'cancel'].
To keep the same logic than before commit 9b1ab76.

opw:649746
2015-09-23 14:42:23 +02:00
Goffin Simon 14b060ed71 [FIX] purchase: journal_id in auto procurement
The journal_id used in a purchase.order created in auto procurement
(by the function make_po) must be the journal_id of the company_id
set on the procurement. The company_id set on the procurement is
the company_id set on the SO (function _prepare_order_line_procurement).

When creating the PO in function make_po, the company_id must be set in the
context to use the right journal_id with the function _get_journal in
"purchase.order" model.

opw:648600
2015-09-22 13:34:45 +02:00
Goffin Simon c092c40d14 [FIX] purchase: _calc_new_qty_price
The price must be compute with the purchase unit of measure set
on the product because qty is computed according to this unit of
measure.

opw:648513
2015-09-09 10:53:48 +02:00
Nicolas Lempereur a69af9c908 [FIX] addons: propagate context when get sequence
With 3e82c94d we use the timezone in the context to format date
sequences when formatting an ir.sequence.

This commit adds the other missing context when getting a sequence, so
these sequences are also dependant on the timezone.

closes #8351
opw-646487
2015-09-03 13:58:01 +02:00
Pedro M. Baeza 617ef49959 [IMP] purchase: Hook for the base price of a purchase line
To be able to change the logic without copying large chunk of code
Closes #1468
2015-08-27 17:42:20 +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
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