[IMP] stock_invoice_directly: Removed unnecessary import statement. Added docstring.
bzr revid: uco@tinyerp.com-20100803053830-jhemf2040p4km0e0
This commit is contained in:
@@ -20,17 +20,24 @@
|
||||
##############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
|
||||
class invoice_directly(osv.osv_memory):
|
||||
_inherit = 'stock.partial.picking'
|
||||
|
||||
def do_partial(self, cr, uid, ids, context):
|
||||
""" Makes partial moves and pickings done and
|
||||
launches Create invoice wizard if invoice state is To be Invoiced.
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param context: A standard dictionary
|
||||
@return:
|
||||
"""
|
||||
result = super(invoice_directly, self).do_partial(cr, uid, ids, context)
|
||||
pick_obj = self.pool.get('stock.picking')
|
||||
picking_ids = context.get('active_ids', False)
|
||||
pick = pick_obj.browse(cr, uid, picking_ids, context)[0]
|
||||
if pick.invoice_state=='2binvoiced':
|
||||
if pick.invoice_state == '2binvoiced':
|
||||
return {
|
||||
'name': 'Create Invoice',
|
||||
'view_type': 'form',
|
||||
@@ -38,7 +45,7 @@ class invoice_directly(osv.osv_memory):
|
||||
'res_model': 'stock.invoice.onshipping',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
}
|
||||
}
|
||||
return {}
|
||||
|
||||
invoice_directly()
|
||||
|
||||
Reference in New Issue
Block a user