Subflow signal not received when it ends in the activity's python action
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Triaged
|
Undecided
|
Unassigned |
Bug Description
Hello,
I will try to explain this issue which is a bit tricky.
It probably doesn't occurs in the OpenERP addons, but it implies limitations of the framework.
When a subflow ends within a python action of the activity, the transition to the next activity is not triggered.
Let say I have inherited the method action_
Something like that (simplified code of a real case in base_sale_
class sale_order(
_inherit = 'sale.order'
def action_
inv_obj = self.pool.
wf_service = netsvc.
res = super(sale_order, self).action_
for order in self.browse(cr, uid, ids, context=context):
if order.order_policy == 'postpaid':
return res
sale_order()
class account_
_inherit = 'account.invoice'
def auto_reconcile(
# code to automatically reconcile my invoice with an existing payment
account_invoice()
Here is a use case :
- I create a sale order in post-paid and confirm it -> delivery order is created
- I create a payment for the amount of the sale order
- I deliver the packing -> the invoice is created with action_
- Within action_
- Now, the sale order is :
* delivered
* paid
* BUT, it is still "in progress" instead of "done". The workflow state is still "invoice"
-> the transition invoice to invoice_end triggered by subflow.paid has not been triggered.
-> the workflow is stuck in an intermediate state
Here is a bug report on the module base_sale_
The only solution I've found yet is to deactivate the auto-reconciliation not to break the workflow.
I really tried to dive in the workflow code to find why this happens, but I had have no success, I missed some keys to understand this complex machinery.
If I can help to solve this problem, please ask.
Thanks
Guewen
Changed in openobject-server: | |
status: | New → Triaged |