|
@@ -1,4 +1,5 @@
|
|
|
# -*- coding: utf-8 -*-
|
|
|
+
|
|
|
from openerp import http
|
|
|
from openerp.http import request
|
|
|
from werkzeug.wrappers import Response
|
|
@@ -16,7 +17,19 @@ LOGGER = logging.getLogger(__name__)
|
|
|
DATE_FORMAT = '%Y-%m-%d'
|
|
|
GZIP_COMPRESSION_LEVEL = 9
|
|
|
|
|
|
-class Sales(http.Controller):
|
|
|
+'''
|
|
|
+ ___ ___ __ __ __ ___ __ __ ___ __ ___ __ __ __ __ __
|
|
|
+ |__| | | |__) / ` / \ |\ | | |__) / \ | | |__ |__) |__ / \ |__) |__) / \ /__`
|
|
|
+ | | | | | \__, \__/ | \| | | \ \__/ |___ |___ |___ | \ | \__/ | \ | \__/ .__/
|
|
|
+
|
|
|
+ # Resource paths
|
|
|
+ - /init: return json response gzip compressed contains values for sale operation
|
|
|
+ - /create_product: create product on the fly POS and return it
|
|
|
+ - /create_customer: create customer on the fly and return it
|
|
|
+ - /process_sale: processing sale and return true if completed
|
|
|
+
|
|
|
+'''
|
|
|
+class PosSales(http.Controller):
|
|
|
|
|
|
'''
|
|
|
Get server date
|
|
@@ -532,8 +545,8 @@ class Sales(http.Controller):
|
|
|
self.make_info_log('Processing sale...')
|
|
|
|
|
|
# Get date
|
|
|
- self.make_info_log('Getting date')
|
|
|
date_now = datetime.now().strftime(DATE_FORMAT)
|
|
|
+ self.make_info_log('[OK] Getting date')
|
|
|
|
|
|
# Get currency
|
|
|
currency_id = self.get_currency(kw.get('journalId'))
|