diff --git a/addons/point_of_sale/wizard/pos_add_product.py b/addons/point_of_sale/wizard/pos_add_product.py index 5d88b75d7ff..5150e10f99f 100644 --- a/addons/point_of_sale/wizard/pos_add_product.py +++ b/addons/point_of_sale/wizard/pos_add_product.py @@ -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') diff --git a/addons/point_of_sale/wizard/pos_discount.py b/addons/point_of_sale/wizard/pos_discount.py index 8b0f4b45fa4..0e3fc88767c 100644 --- a/addons/point_of_sale/wizard/pos_discount.py +++ b/addons/point_of_sale/wizard/pos_discount.py @@ -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) diff --git a/addons/point_of_sale/wizard/pos_payment.py b/addons/point_of_sale/wizard/pos_payment.py index 565ae257180..aa4d200467a 100644 --- a/addons/point_of_sale/wizard/pos_payment.py +++ b/addons/point_of_sale/wizard/pos_payment.py @@ -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 = {} diff --git a/addons/point_of_sale/wizard/pos_payment_report_date.py b/addons/point_of_sale/wizard/pos_payment_report_date.py index c2e60a07045..d30ff412887 100644 --- a/addons/point_of_sale/wizard/pos_payment_report_date.py +++ b/addons/point_of_sale/wizard/pos_payment_report_date.py @@ -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): diff --git a/addons/point_of_sale/wizard/pos_payment_report_user.py b/addons/point_of_sale/wizard/pos_payment_report_user.py index c8f32ff8cb0..e58073bdcbd 100644 --- a/addons/point_of_sale/wizard/pos_payment_report_user.py +++ b/addons/point_of_sale/wizard/pos_payment_report_user.py @@ -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): diff --git a/addons/point_of_sale/wizard/pos_receipt.py b/addons/point_of_sale/wizard/pos_receipt.py index bf37288f55b..daf63fd6674 100644 --- a/addons/point_of_sale/wizard/pos_receipt.py +++ b/addons/point_of_sale/wizard/pos_receipt.py @@ -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'): diff --git a/addons/point_of_sale/wizard/pos_return.py b/addons/point_of_sale/wizard/pos_return.py index 91a063df9a9..13a31057d28 100644 --- a/addons/point_of_sale/wizard/pos_return.py +++ b/addons/point_of_sale/wizard/pos_return.py @@ -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',