Task-ID:814: To add doc string to POS and related modules with wizards
bzr revid: sbh@tinyerp.com-20100527080106-1qpw6wrxu8veenxg
This commit is contained in:
@@ -62,6 +62,14 @@ class add_product(osv.osv_memory):
|
||||
'type': 'ir.actions.act_window',
|
||||
}
|
||||
def close_action(self, cr, uid, ids, context):
|
||||
"""
|
||||
To get the product and Make the payment .
|
||||
@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 : Return the Make Payment
|
||||
"""
|
||||
|
||||
record_id = context and context.get('active_id', False)
|
||||
order_obj= self.pool.get('pos.order')
|
||||
|
||||
@@ -37,6 +37,14 @@ class pos_discount(osv.osv_memory):
|
||||
|
||||
|
||||
def view_init(self, cr, uid, fields_list, context=None):
|
||||
"""
|
||||
Creates view dynamically and adding fields at runtime.
|
||||
@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 with new columns.
|
||||
"""
|
||||
res = super(pos_discount, self).view_init(cr, uid, fields_list, context=context)
|
||||
record_id = context and context.get('active_id', False) or False
|
||||
order = self.pool.get('pos.order').browse(cr, uid, record_id)
|
||||
|
||||
@@ -124,6 +124,7 @@ class pos_make_payment(osv.osv_memory):
|
||||
return result
|
||||
|
||||
def check(self, cr, uid, ids, context):
|
||||
|
||||
"""Check the order:
|
||||
if the order is not paid: continue payment,
|
||||
if the order is paid print invoice (if wanted) or ticket.
|
||||
@@ -168,6 +169,10 @@ class pos_make_payment(osv.osv_memory):
|
||||
|
||||
|
||||
def create_invoice(self, cr, uid, ids, context):
|
||||
|
||||
"""
|
||||
Create a invoice
|
||||
"""
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
active_ids = [context and context.get('active_id',False)]
|
||||
for i in active_ids:
|
||||
@@ -180,8 +185,6 @@ class pos_make_payment(osv.osv_memory):
|
||||
}
|
||||
|
||||
def print_report(self, cr, uid, ids, context=None):
|
||||
if not context:
|
||||
context={}
|
||||
"""
|
||||
@summary: To get the date and print the report
|
||||
@param self: The object pointer.
|
||||
@@ -189,7 +192,9 @@ class pos_make_payment(osv.osv_memory):
|
||||
@param uid: ID of the user currently logged in
|
||||
@param context: A standard dictionary
|
||||
@return : retrun report
|
||||
"""
|
||||
"""
|
||||
if not context:
|
||||
context={}
|
||||
active_id=context.get('active_id',[])
|
||||
datas = {'ids' : [active_id]}
|
||||
res = {}
|
||||
|
||||
@@ -26,9 +26,6 @@ import time
|
||||
|
||||
|
||||
class pos_payment_report_date(osv.osv_memory):
|
||||
'''
|
||||
Open ERP Model
|
||||
'''
|
||||
_name = 'pos.payment.report.date'
|
||||
_description = 'POS Payment Report according to date'
|
||||
def print_report(self, cr, uid, ids, context=None):
|
||||
|
||||
@@ -25,9 +25,6 @@ from osv import fields
|
||||
|
||||
|
||||
class pos_payment_report_user(osv.osv_memory):
|
||||
'''
|
||||
Open ERP Model
|
||||
'''
|
||||
_name = 'pos.payment.report.user'
|
||||
_description = 'Sales lines by Users'
|
||||
def print_report(self, cr, uid, ids, context=None):
|
||||
|
||||
@@ -32,6 +32,14 @@ class pos_receipt(osv.osv_memory):
|
||||
}
|
||||
|
||||
def view_init(self, cr, uid, fields_list, context=None):
|
||||
"""
|
||||
Creates view dynamically and adding fields at runtime.
|
||||
@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 with new columns.
|
||||
"""
|
||||
order_lst = self. pool.get('pos.order').browse(cr, uid, context['active_id'])
|
||||
for order in order_lst:
|
||||
if order.state_2 in ('to_verify'):
|
||||
|
||||
@@ -63,6 +63,14 @@ class pos_return(osv.osv_memory):
|
||||
return res
|
||||
|
||||
def view_init(self, cr, uid, fields_list, context=None):
|
||||
"""
|
||||
Creates view dynamically and adding fields at runtime.
|
||||
@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 with new columns.
|
||||
"""
|
||||
res = super(pos_return, self).view_init(cr, uid, fields_list, context=context)
|
||||
order_obj=self.pool.get('pos.order')
|
||||
if not context:
|
||||
@@ -77,6 +85,18 @@ class pos_return(osv.osv_memory):
|
||||
return res
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False,submenu=False):
|
||||
|
||||
"""
|
||||
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.
|
||||
|
||||
"""
|
||||
result = super(pos_return, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar,submenu)
|
||||
if not context:
|
||||
context={}
|
||||
@@ -123,6 +143,15 @@ class pos_return(osv.osv_memory):
|
||||
|
||||
|
||||
def create_returns(self, cr, uid, data, context):
|
||||
"""
|
||||
@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: Return the add product form again for adding more product
|
||||
|
||||
"""
|
||||
return {
|
||||
'name': _('Add Product'),
|
||||
'view_type': 'form',
|
||||
|
||||
Reference in New Issue
Block a user