[sale] inconsistent workflow status check for sale.order
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hello,
Under some circumstances (can't remember exactly the manipulation but is related to picking/invoice cancellation), the "sale.order" workflow can become stuck because of a wrong check.
Indeed, the sale.order can by definition have only the following states:
'state': fields.selection([
]
But in the sale.order#
states=
the "exception" state simply doesn't exist or doesn't exist anymore. I guess "invoice_except" should be used instead.
BTW, I'm not a pythonista, but I find it strange to test things against strings, I would have used constants in order to avoid using such strings mismatch, at least that's how Java, C++ guys would do and I'm pretty sure this would be a good practise in Python too.
I had to apply the following patch (also attached) to make it work:
=== modified file 'sale/sale.py'
--- sale/sale.py 2010-04-08 13:39:40 +0000
+++ sale/sale.py 2010-05-11 19:55:07 +0000
@@ -407,7 +407,7 @@
return inv_id
- def action_
+ def action_
res = False
invoices = {}
Hope this helps.
Hello Raphaël Valyi ,
The state check being made at action_ invioce_ create( ) is upto the mark and it should have the list of states of sale order line,not of Sale Order.
The aim of putting such a check is, if the sale order line is not among those listed states(a draft line), can be invoiced.
I wonder when could it have blocked you?
Hope this helps.
Thanks.