[ADD] mrp_repair: Added Docstrings for functions in wizard files.

bzr revid: uco@tinyerp.co.in-20100310071718-buqy83c4bh0wjc7p
This commit is contained in:
uco (OpenERP)
2010-03-10 12:47:18 +05:30
parent 13fd1480b4
commit 9ac93ecf4d
5 changed files with 39 additions and 2 deletions
+2 -2
View File
@@ -39,8 +39,8 @@
'security/ir.model.access.csv',
'mrp_repair_sequence.xml',
'mrp_repair_wizard.xml',
'mrp_repair_cancel_view.xml',
'mrp_repair_make_invoice_view.xml',
'wizard/mrp_repair_cancel_view.xml',
'wizard/mrp_repair_make_invoice_view.xml',
'mrp_repair_view.xml',
'mrp_repair_workflow.xml',
'mrp_repair_report.xml',
+25
View File
@@ -28,6 +28,18 @@ class repair_cancel(osv.osv_memory):
_description = 'Cancel Repair'
def cancel_repair(self, cr, uid, ids, context):
"""
@summary: Cancels the repair
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
@param ids: List of IDs selected
@param context: A standard dictionary
@return:
"""
record_id = context and context.get('record_id', False) or False
if record_id:
repair_obj = self.pool.get('mrp.repair').browse(cr, uid, [record_id])
@@ -43,6 +55,17 @@ class repair_cancel(osv.osv_memory):
return {}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
"""
@summary: Changes the view dynamically
@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: New arch of view.
"""
record_id = context and context.get('record_id', False) or False
res = super(repair_cancel, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
if record_id:
@@ -50,6 +73,8 @@ class repair_cancel(osv.osv_memory):
if not repair_obj.invoice_id:
res['arch'] = """ <form string="Cancel Repair" colspan="4">
<group col="2" colspan="2">
<label string="Do you want to continue?" colspan="4"/>
<separator colspan="4"/>
<button icon="gtk-cancel" special="cancel" string="No" readonly="0"/>
<button name="cancel_repair" string="Yes" type="object" icon="gtk-ok"/>
</group>
+12
View File
@@ -31,6 +31,18 @@ class make_invoice(osv.osv_memory):
}
def make_invoices(self, cr, uid, ids, context):
"""
@summary: Generates invoice(s) of selected records.
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
@param ids: List of IDs selected
@param context: A standard dictionary
@return: Loads the view of new invoice(s).
"""
inv = self.browse(cr, uid, ids[0])
order_obj = self.pool.get('mrp.repair')
newinv = order_obj.action_invoice_create(cr, uid, context['active_ids'], group=inv.group,context=context)