base_sale_multichannels : auto-reconcile stucks the workflow

Bug #957136 reported by Guewen Baconnier @ Camptocamp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magento OpenERP Connector
Fix Released
Undecided
Guewen Baconnier @ Camptocamp

Bug Description

Hi,

This bug report is for record and if in case of someone has already fixed such issue or had a great idea.
I put my bug report in the magentoerpconnect project because I think it'll have more visibility than in extra-trunk.

I already lost my day on this bug so I'm crazy and depressed about it.

As you can see, I had to comment a feature while we do not have any solution :
http://bazaar.launchpad.net/~openerp-commiter/openobject-addons/trunk-extra-addons/revision/5660

The issue appears when we use the auto-reconcile and post-paid on a base sale payment type.

A scenario :
 - Import an order from magento, it has one product to deliver, it is already paid on magento
 - The delivery order is created
 - A customer payment (voucher) is created
 - I deliver all the delivery order
***
 - According to my base sale payment type configuration, the created invoice is automatically opened
 - The previously created payment is automatically reconciled with the invoice
***
The steps between the stars are done in an inherit of action_invoice_create()

When I check my sale order, I see it is :
 - Paid
 - Delivered
But the workflow of my sale order stay in "progress".

Now a second scenario, also post-paid but I do not check the auto-reconcile :
A scenario :
 - Import an order from magento, it has one product to deliver, it is already paid on magento
 - The delivery order is created
 - A customer payment (voucher) is created
 - I deliver all the delivery order
***
 - According to my base sale payment type configuration, the created invoice is automatically opened
***
 - I reconcile the previously created payment with the invoice (I call the method auto_reconcile() to be sure that the problem don't come from this method)

The steps between the stars are done in an inherit of action_invoice_create()

When I check my sale order, I see it is :
 - Paid
 - Delivered
But the workflow of my sale order is well "done".

The problem comes from the fact that action_invoice_create is an action on the workflow activity "invoice" of the workflow "sale.order.basic".

It think that it does not accept that the sub-workflow (so the invoice one) changes its state directly from the action of the activity "invoice". It should be done afterwards only.

The activity "invoice_end" of the sale order workflow is never called, it stays in "invoice" even if the "invoice" workflow is complete.

I don't know if it is something that can be changed (corrected? bug or feature? ;-)) in the workflow engine, or if we can find a way to reconcile the payment with the invoice later.

If someone find a solution, even if it is just a beginning, I will be so grateful!

Guewen

Changed in magentoerpconnect:
assignee: nobody → Guewen Baconnier @ Camptocamp (gbaconnier-c2c)
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Posted a bug report on openobject-server: https://bugs.launchpad.net/openobject-server/+bug/961919

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :
Revision history for this message
Kyle Waid (midwest) wrote :

Can we close this bug?

Changed in magentoerpconnect:
status: New → Fix Released
Revision history for this message
sagar pise (sagar-pise) wrote :

I face same problem
I want to auto create invoice on confirmation of sale order, so I just override "action_wait" method and write code like

def action_wait(self, cr, uid, ids, *args):
    result = super(sale_order, self).action_wait(cr, uid, ids, *args)
        invoice_id = self.action_invoice_create(cr, uid, [o.id])
    return result

Now if I deliver order completely and complete payment, still sale order is not Done

** problem is before invoice creation sale order must be confirmed because when we create invoice one signal "manual_invoice" is passed and this call activity "act_invoice" but precondition "act_wait_invoice" is not satisfy because sale order is not confirmed and if "act_invoice" is not call then your sale order never goes to done state I hope this will help you and some other one

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.