c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #18227
[Bug 724253] Re: [6.0] An invoice created from Receptions is created with type "out_invoice"
Hi again.
I discover the problem, at module stock, at files stock.py and
wizard/stock_on_shipping.py. I try to explain.
The problem is argument values in call function "action_invoice_create"
from wizard/stock_on_shipping.py do not pass correct values or don't
capture:
1) At wizard/stock_on_shipping.py, is called the "_get_invoice_type"
funtion before call "action_invoice_create" function , and it returns
correctly the value "in_invoice". But after, when is called the
"action_invoice_create" function, the type argument do not capture
"in_invoice" value (I don't know the reason):
def create_invoice(self, cr, uid, ids, context=None):
if context is None:
context = {}
picking_pool = self.pool.get('stock.picking')
onshipdata_obj = self.read(cr, uid, ids, ['journal_id', 'group', 'invoice_date'])
if context.get('new_picking', False):
onshipdata_obj['id'] = onshipdata_obj.new_picking
onshipdata_obj[ids] = onshipdata_obj.new_picking
context['date_inv'] = onshipdata_obj[0]['invoice_date']
active_ids = context.get('active_ids', [])
active_picking = picking_pool.browse(cr, uid, context.get('active_id',False), context=context)
inv_type = picking_pool._get_invoice_type(active_picking)
context['inv_type'] = inv_type
res = picking_pool.action_invoice_create(cr, uid, active_ids,
journal_id = onshipdata_obj[0]['journal_id'],
group = onshipdata_obj[0]['group'],
type = inv_type,
context=context)
return res
2) I fix the problem at "action_invoice_create" function by equalizing
"inv_type" variable to "None" (instead of "type" argument), because
after call "_get_invoice_type" again, and invoice type is reecalculated,
and returns the "in_invoice" correctly.
#>>> Fix the bug 724253
#inv_type = type # Original line
inv_type = None # Bug fixed
#<<<
I wish you understand my explanation.
Thanks
--
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/724253
Title:
[6.0] An invoice created from Receptions is created with type
"out_invoice"
Status in OpenERP Modules (addons):
New
Bug description:
OpenERP stable 6.0 version.
An invoice created from Receptions is created with type "out_invoice".
After, when you access to invoice partners tree view, this invoices
are not displayed. If you change account_invoice type to 'in_invoice',
the tree view display the invoice correctly.
References