Commit Graph

1121 Commits

Author SHA1 Message Date
Luis Felipe Mileo 16dbef4a13 [FIX] sale: missing digits precision on sale/th_weight
Make sense as the weight field has the 'Stock Weight' precision in product and
delivery.
Closes #9932
2015-12-11 10:14:23 +01:00
Goffin Simon 2749f73f9b [FIX] sale: update_tax in product_id_change
Thanks to the fix 503820a, when a fiscal position mapped an included
tax on a SO line, the price unit of the product is recomputed.
This fix has been applied in the function product_id_change in
the model "sale.order.line"

Before the fix, when changing the product uom on a SO line, the price
unit of the SO line was reset with the pricelist price without taking
into account the fact that a included tax could be removed on the SO line.

To avoid this kind of problem, the price unit must be recomputed in any
case according to the taxes.
2015-12-03 09:21:03 +01:00
Denis Ledoux 4c901f8ac6 [FIX] sale: use default_get to define the invoice journal
When creating the invoice of a sales order, from the sales order
(`Create invoice` button on the sale order),
the journal used for the invoice was forced
with a specific domain. Besides, the only reason the journal
is forced is to check there is a sale journal for the
quotation company, and raise a warning if not.
This check was added in 1578c2858d.

This prevented to use the user defined defaults,
(`Set defaults` in the `debug` menu)
to set a different default journal per user.

Using the `default_get` instead solves this issue,
as it uses first the user defined defaults. Besides,
if no user defined defaults are set, it then uses
the default value set in the field definition, which
in this case returns the same journal then the forced
domain mentioned above, the domain used being the same.

There is therefore no change of behavior, while giving
the possibility to use the user defined defaults.

Fixes #8786
2015-09-30 15:59:54 +02:00
Jos De Graeve c88f0d926c [FIX] sale: company filtered taxes for fix_tax_included_price
This revision is related to:
 - 503820acb6
 - 3b02e3d63d

The taxes used to define the price must be the product taxes
of the company of the order.

Closes #8759
2015-09-29 10:40:33 +02:00
Martin Trigaux a3a2f374ff [FIX] sale: onchange always triggered
The product_id_change was always triggered at the creation of a sale order line.
This is due to the 'type' field that is no longer present in 8.0 and makes the
condition to be always verified.
2015-09-07 11:29:59 +02:00
Pedro M. Baeza cbe85f42d0 [IMP] sale: hooks for the base price and the quantity
To make it easier to override without rewritting the full method
Closes #1470
2015-08-27 17:42:20 +02:00
Denis Ledoux 42ecf5e346 [FIX] sale: remove useless print
Introduced with rev. 3b02e3d63d
2015-08-26 13:38:38 +02:00
Denis Ledoux dedc40ba1d [FIX] sale: context can be done
This rev. is related to 3b02e3d63d
2015-08-26 13:37:31 +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
Denis Ledoux 3b02e3d63d [FIX] sale*: company tax filtering
f26b94f had as goal to filter the taxes of the product
according to the company when the sale.order
was created/edited as SUPERUSER_ID
(Who ignores the record rules).

Unfortunetaly, to filter the taxes,
it used the company of the customer,
while it's actually the company of the order which
should be used.

Indeed, for instance,
partners can be shared among all companies.

It was way less simple to access the company
of the sale.order, this parameter being
not available in the on_change method signature.

This is the easiest way to solve this issue
without breaking the API / retro-compatibility.

opw-647819
2015-08-25 14:52:20 +02:00
Denis Ledoux 9a9720ac14 [FIX] sale: in a SO line, changing uom qty must change uos qty
This is a regression from rev.
1cedcf6abb

Not updating the product uos qty on updating the uom qty
is wrong, and it has multiple side-effect.

The SO line margin not being correctly recomputed
when changing the quantity is one of them.

opw-647902
2015-08-24 18:07:24 +02:00
Nicolas Martinelli f26b94fd7d [FIX] sale: filter taxes to keep the ones applying to the partner company
The problem originally arises in the frontend (eCommerce). In this case, it is
necessary to switch the user id to the SUPERUSER_ID in order to be allowed to
create a SO. This is done in the method sale_get_order in the module
website_sale. The consequence is that in a multicompany configuration, all taxes
of the product will be retrieved and applied in the frontend.

This fix filters the taxes retrieved to keep only the ones which apply to the
company of the partner, when the user id is SUPERUSER_ID.

opw-645258
opw-645915
2015-08-05 10:39:56 +02:00
Goffin Simon 7f5f945dcf [FIX] sale: _sales_count
The field "state" in "sale.report" model must consider the state used
by "sale.order.line" to be consistent with the view created in this model.

The function _sale_count in 'product.product' model must return
the number of product included in a "confirmed" or "done" sale order line.

opw:644200
2015-07-23 15:28:36 +02:00
Valentin Chemiere 3033790ef1 [FIX] sale: use updated context instead of new one
Keep the existing information in the context for the price_get call instead of
creating a new one.
Closes #7646
2015-07-17 16:40:35 +02:00
Goffin Simon 1cedcf6abb [FIX] sale: Sale Order Line Onchange
Changing the product quantity must not change Product UOM.

opw:644542
2015-07-17 09:48:42 +02:00
Denis Ledoux 809e1a6081 [FIX] sale, website_sale: quotation email.
4adb4b8d15
corrected the fact the quotation email
wasn't sent if you did not come back
from the payment provider
(when you closed your browser after
the payment but before coming back
to Odoo).

Before the above revision, the quotation
email was sent for payment methods
not redirecting to payment providers,
like transfers. It was no longer the case
with the above revision.

This revision re-introduces this behavior:
If there is a feedback from a transaction,
but the transaction isn't confirmed,
we send the quotation email without confirming
the sale order, like it was the case before

opw-644670
2015-07-14 11:11:55 +02:00
Denis Ledoux 4adb4b8d15 [FIX] sale, website_sale: Send email on sale order confirmation
Not just when coming back from the payment provider to the
payment validation route `/shop/payment/validate`.

Otherwise, if you do not come back from the payment provider
page, that you quit just after having paid but just before
being redirected to Odoo, you do not receive the email.

The change within the `sale` module, while this issue concerns
`website_sale` only, has been accepted because this is a mechanism
that could be used by other modules.

opw-644348
2015-07-09 15:51:50 +02:00
Jos De Graeve 7771c45ed9 [FIX] sale: product_id_change ignores context
The product_id_change method of sale.order.line
ignored the passed context.

The context was simply overwritten,
which is no a good practice.

Besides, it prevents customizations.

Closes #7447
opw-643983
2015-07-03 16:38:12 +02:00
Denis Ledoux 5387676399 [FIX] sale: "Quotation confirmed" for sales order invoiced on delivery order
When confirming a sales order with invoicing control
based on "Delivery order", confirming the quotation
didn't post the "Quotation Confirmed" message
subtype in the sales order thread.

opw-642744
2015-06-26 15:07:45 +02:00
Peter Alabaster e17166183d [FIX] sale: pass context when creating Sale Order name
Without passing the context, this is not possible
to force the company (`force_company`)

Closes #7242
2015-06-24 11:38:41 +02:00
Goffin Simon 403ce405ff [FIX] sale: Update fiscal position
The fiscal position must be updated according to the delivery address.

opw:641883
2015-06-17 13:51:54 +02:00
Guewen Baconnier 3a314780c0 [FIX] sale_*, delivery: more consistent ignore of cancelled SO lines
Sales Order lines have a cancelled state, but this state is not
always considered when looping over lines. This check is
done in some places already and this patch's aim is to do it in the
remaining places.

- Cancel the procurement of a sale line in sale.order.line
instead of sale.order, so a line canceled individually with
sale_order_line.button_cancel will properly cancel it
procurement.
- Sale report: uses the state of lines instead of Sales order,
so canceled lines of not-canceled orders are correctly represented
in the analysis.
- test: do not create invoices lines for canceled sale lines
- test: creation of moves with canceled lines
- test: check if lines are still canceled when sale order is done

Closes #6036
2015-04-24 17:29:51 +02:00
Nicolas Lempereur 86116fd082 [FIX] sale: set company sales team for quotation
If there is not a dedicated salesteam for the current user, this fix sets the
sales team to the one dedicated to a customer if there is one.

opw-633134
2015-04-21 15:06:03 +02:00
Goffin Simon 57c1b07ebf [FIX] sale: Wrong invoice settings
On a sale order for a customer A where the invoice address is the address of the customer B,
the payment term, the receivable account and the fiscal position must be set from customer B
which is the partner invoice.

opw:630962
2015-04-16 08:50:07 +02:00
Martin Trigaux d0493ee847 [FIX] sale: recompute tax amount after fiscal position change
When changing the fiscal position of a sale.order, the taxes are recomputed
which means that total amounts may no longer be correct (need to press 'update'
button).
Reset the amount_* fields to force the recomputation at write.
Fixes lp:712772, opw 618419
2015-04-10 11:56:25 +02:00
Nicolas Martinelli 3d05ddab50 [FIX] sale_stock: Cancel all procurements linked to a sale order
During the creation of a Sale Order containing a product for which 'Make To Order' is activated
in the Procurements, two procurements are created:
- one for 'Partner Locations/Customers' location
- one for 'WH/Stock' location

If the Sale Order if cancelled, the user must first cancel the picking (delivery order).
This will trigger the cancellation of the procurement with the 'Partner Locations/Customers'
location.

The new behavior is to cancel the procurements linked to the Sale Order, which will trigger
the cancellation of the picking.

opw: 630170
issue: https://github.com/odoo/odoo/issues/3805
2015-03-17 16:37:24 +01:00
jesusVMayor 591d207ff9 [FIX] sale: reset state of exception procurements only
During the delivery of a picking the procurents in exception or canceled are
reset to confirm state.
As the list of picking was a list shared in the loop, other procurements may be
reset to confirm as well.
2015-03-06 16:00:54 +01:00
Josse Colpaert 50fc06e275 [IMP] Fasten up procurement JIT in v8 already 2015-03-02 09:41:19 +01:00
Denis Michiels 8be57ccf0d [FIX] sale: Chatter entries translated in user language
When a delivery order is confirmed, pass the user language to the
procurement creation so the messages in the chatter are now translated
in his language.

opw 627002
2015-02-23 11:17:05 +01:00
Denis Ledoux 4b3522936f [FIX] sale: missing default keys in result dict for sales count button 2015-02-02 12:43:18 +01:00
Denis Ledoux 68b8286d5f [FIX] sale: sales button on product variants
This rev. is comparable to 0b18a5afec

The action action_order_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 the 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 probably be performed in master.
2015-02-02 10:34:27 +01:00
Antony Lesuisse a8edd217a0 [FIX] sale: product sold stat button 2015-01-28 01:57:53 +01:00
Josse Colpaert 2f5ca4380a Revert "[IMP] Remove unnecessary refresh statements because of new api"
This reverts commit b213438176.
2014-11-17 09:44:10 +01:00
Josse Colpaert b213438176 [IMP] Remove unnecessary refresh statements because of new api 2014-11-17 09:24:06 +01:00
Raphael Collet b8071bbaca [FIX] addons: incorrect new-api invocation of method write() with context
This fixes #3411.
2014-11-13 13:34:55 +01:00
Josse Colpaert 86f785ae1b [FIX] #3153 Digits in wizard should be those of moves,... / Recreate delivery order from sale / Delivery method on delivery order
[IMP] Provide better purchase order picking type

[IMP] Possibly a better product uos handling in the sale order line

[FIX] Recreate of delivery order when sales order in shipping exception

[FIX] Delivery method should be passed to delivery order
2014-11-13 11:50:01 +01:00
Christophe Matthieu 23f9736372 [FIX] website_event_sale: display the discounted price in website.
Add price_reduce compute method on ticket and sale order line
2014-10-24 14:16:16 +02:00
Josse Colpaert 066af964bf [IMP] Purchase on incoming shipments with services added 2014-09-17 21:41:42 +02:00
Christophe Simonis 41afeec7f1 [MERGE] forward port of branch saas-5 up to 9363bc9 2014-09-04 18:03:24 +02:00
Christophe Simonis 9363bc9182 [MERGE] forward port of branch saas-3 up to 3d80dc2 2014-09-04 17:51:42 +02:00
Christophe Simonis 3d80dc2bbf [MERGE] forward port of branch 7.0 up to 59b76ee 2014-09-04 17:46:51 +02:00
Your Name 59b76ee927 [FIX] sale: keep page when confirming a sale order
To keep the pager and view changer after confirmation of a sale order, do not reload the view (quotation and sale order view are the same anyway)
Fixes #250
2014-09-04 17:34:46 +02:00
Josse Colpaert 12d9333f48 [IMP] Clean 2014-09-03 19:18:17 +02:00
Josse Colpaert bd5550e832 [FIX] Services type procurements are also important to trigger sale wkf 2014-09-03 19:18:16 +02:00
Josse Colpaert 86b8e73482 [IMP] Clean need_procurement and add partner on procurement for Phantom with service 2014-09-03 19:18:16 +02:00
Christophe Simonis 8046b7367d [MERGE] forward port of branch saas-5 up to 7e117b1 2014-08-28 16:51:11 +02:00
Christophe Simonis 7e117b18a0 [MERGE] forward port of branch saas-3 up to ada9724 2014-08-28 16:21:27 +02:00
Nicolas Seinlet 23df2ec28a [FIX] sale: on create, set taxes if product_id_change called 2014-08-27 11:48:40 +02:00
Christophe Simonis 5dff035878 [MERGE] forward port of branch saas-5 up to 39bee35 2014-08-20 20:33:17 +02:00
Christophe Simonis c3131317d7 [MERGE] forward port of branch saas-4 up to ddef2dd 2014-08-20 17:57:22 +02:00