← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 811080] Re: sale margin breaks invoice type

 

Hello,

I want to clarify something.

I constated the same bug in 6.0.2. I think you didn't understand what
Selvam said:

If you see the method invoice_create in sale_margin.py:

    def action_invoice_create(self, cr, uid, ids, journal_id=False,
            group=False, type='out_invoice', context=None):
        # need to carify with new requirement
        invoice_ids = []
        picking_obj = self.pool.get('stock.picking')
        res = super(stock_picking, self).action_invoice_create(cr, uid, ids, journal_id=False,
            group=False, type='out_invoice', context=None)
        invoice_ids = res.values()
        picking_obj.write(cr, uid, ids, {'invoice_ids': [[6, 0, invoice_ids]]})
        return res

you see 2 things: 
In the method declaration (def action_invoice_create ...): type='out_invoice':
It's, like Amit said, a "default value when this argument contains false value"

In the super method call (res = super(stock_picking, self).action_invoice_create...): type='out_invoice':
Here, that's not a default value assignation. That override the type given to the method (in the method declaration) to out_invoice. This make that all the invoices created by this method are of type out_invoice.

** Changed in: openobject-addons
       Status: Invalid => Confirmed

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP Project Group.
https://bugs.launchpad.net/bugs/811080

Title:
  sale margin breaks invoice type

Status in OpenERP Addons (modules):
  Fix Released

Bug description:
  Sale margin has overwritten action_invoice_create of stock.picking and
  sends hard coded 'out_invoice' as invoice type.

  This breaks invoice creation from inward picking.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/811080/+subscriptions


References