Odoo Help

0

Exclude canceled Sale order line from sale order amount

By
Mind And Go
on 3/14/14, 1:36 PM 1,504 views

Hy,

I'm wondering if it could be a great function to allow user to cancel (not delete) a sale order line in an order once it has been validated. I explain a little bit. Once a sale.order has been confirmed, it's almost impossible to get back. From times to times, in some business, the orders are related to work that can last a long time and sometimes, some order lines won't be charged to the customer because the "project/affair" has changed.

Thus, I propose some improvements :

  • Allow the sale.order.line to be canceled
  • Change the total amount computation so that canceled order lines won't be used for computation
  • Consequently change the invoiced_ratio of the sale.order
1

Ray Carnes

--Ray Carnes--
17496
| 9 7 9
Atlanta, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0; Odoo 8.0, 9.0, 10.0.

Completed Odoo Functional and Technical Training.

Major Skills:

  • User Needs and GAP Analysis;

  • Functional and Technical Design;

  • Prototyping and Proof of Concepts;

  • Requirements Specifications;

  • Agile Implementation;

  • Data Migration;

  • Configuration & Customization (UI and code);

  • Integration - Odoo and non Odoo Applications and Services;

  • Training and Knowledge Transfer;

  • Go Live Support;

  • Helpdesk;

  • Version Upgrades and Migration.

  • Accounting Expert.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

I am a skilled Communicator and I only take the serious things seriously!

Ray Carnes
On 3/14/14, 4:37 PM

This is already possible.

1) Create a menu for Sales Order Lines so you can access individual lines and cancel them after the order has been confirmed.

2) Add the state field to the tree view on the Sales Order form view so the status is shown:

image description

3) The TOTAL on the Sales Order won't be updated, but the Invoice WILL show the correct amount (you can't cancel a Sales Order line if it has been invoiced unless you first cancel that same line on the Invoice).

4) You probably want to update the Sales Order report to show state as well.

invoiced_rate already behaves as expected.

Reposted from an answer to a comment (from Mind And Go): Hy Ray,

Thanks for this proposal. I'm not sure to understand your point when you say that the invoice rate will work as expected. Do you mean that the invoice_rate don't consider the canceled lines? I was expecting to override the amount total of the order but if the invoice rate is Ok so no problem.

Bista Solutions US, Ray Carnes
on 3/15/14, 2:28 PM

I meant that invoice_rate works just fine in this scenario. Even with the 'old' total of $150, the sale order is 100% invoiced as soon as the $75 is paid. It needs no adjustments as it already supports your suggestion.

Bista Solutions US, Ray Carnes
on 3/15/14, 2:29 PM

Ray, thanks for you support. I tried what you proposed without success. I've done it this way : 1 - Create a sale order with many lines 2 - Invoice some of those lines 3 - Cancel those which haven't been invoiced Result : state is correctly shown in the order, the total_amount of the order hasn't changed, the invoice_ratio is not 100%, the order still in the state "manual" instead of order

Mind & Go, Mind And Go
on 3/15/14, 7:26 PM

Did you confirm the order?

Bista Solutions US, Ray Carnes
on 3/15/14, 7:46 PM

Sure, I can't make an invoice if the sale.order is not confirmed

Mind & Go, Mind And Go
on 3/15/14, 7:48 PM

This is what I did today on runbot. 1) Created the Menu 2) Created and confirmed a Sales Order (set to create invoice before delivery) for 3 products at 180€ 3) Cancelled one item (after removing that line from the invoice) reducing the total to 115€ 4) Paid the Invoice

The invoiced rate showed as 100, the invoice showed a total payment of 115€

Bista Solutions US, Ray Carnes
on 3/15/14, 10:44 PM

Ray, Ok I understand what you meant and I reproduce your workflow. Actually it is not what I'm expecting because of many points. I could need to cancel a line even if it hasn't been invoiced. I need to see the effective ratio before the invoice is paid, The sale margin must be update if I cancel a line in an order. If the canceled line is the latest of the order (and everything has been invoiced), I would like to change the state of the order. So in the end, I must override the method of sale object so that amount will be updated as well as margin and change the state of the object. Thx

Mind & Go, Mind And Go
on 3/16/14, 6:17 AM
0
Mind And Go
On 3/15/14, 4:38 AM

Hy Ray,

Thanks for this proposal. I'm not sure to understand your point when you say that the invoice rate will work as expected. Do you mean that the invoice_rate don't consider the canceled lines? I was expecting to override the amount total of the order but if the invoice rate is Ok so no problem

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

Asked: 3/14/14, 1:36 PM
Seen: 1504 times
Last updated: 3/16/15, 8:10 AM