From 62406fa4bf9b3cd0edf4227c137ec6295b53669d Mon Sep 17 00:00:00 2001 From: Darshan Kalola Date: Thu, 31 Dec 2015 16:07:54 +0530 Subject: [PATCH] [REM] point of sale: removed useless wizard and code Never called or not used --- addons/point_of_sale/__openerp__.py | 1 - addons/point_of_sale/models/pos_order.py | 5 +-- .../test/01_order_to_payment.yml | 2 +- addons/point_of_sale/wizard/__init__.py | 1 - addons/point_of_sale/wizard/pos_confirm.py | 32 ------------------- addons/point_of_sale/wizard/pos_confirm.xml | 20 ------------ addons/point_of_sale/wizard/pos_payment.py | 10 +----- 7 files changed, 3 insertions(+), 68 deletions(-) delete mode 100644 addons/point_of_sale/wizard/pos_confirm.py delete mode 100644 addons/point_of_sale/wizard/pos_confirm.xml diff --git a/addons/point_of_sale/__openerp__.py b/addons/point_of_sale/__openerp__.py index d49ddac2cb9..13800334325 100644 --- a/addons/point_of_sale/__openerp__.py +++ b/addons/point_of_sale/__openerp__.py @@ -34,7 +34,6 @@ Main Features 'security/ir.model.access.csv', 'data/default_barcode_patterns.xml', 'wizard/pos_box.xml', - 'wizard/pos_confirm.xml', 'wizard/pos_details.xml', 'wizard/pos_discount.xml', 'wizard/pos_open_statement.xml', diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py index 65e4754908e..71fb19a47e0 100644 --- a/addons/point_of_sale/models/pos_order.py +++ b/addons/point_of_sale/models/pos_order.py @@ -566,9 +566,6 @@ class pos_order(osv.osv): 'res_id': inv_ids and inv_ids[0] or False, } - def create_account_move(self, cr, uid, ids, context=None): - return self._create_account_move_line(cr, uid, ids, None, None, context=context) - def _prepare_analytic_account(self, cr, uid, line, context=None): '''This method is designed to be inherited in a custom module''' return False @@ -756,7 +753,7 @@ class pos_order(osv.osv): return True def action_done(self, cr, uid, ids, context=None): - self.create_account_move(cr, uid, ids, context=context) + self._create_account_move_line(cr, uid, ids, context=context) return True class pos_order_line(osv.osv): diff --git a/addons/point_of_sale/test/01_order_to_payment.yml b/addons/point_of_sale/test/01_order_to_payment.yml index 46b7b2b1444..a5f41fec71b 100644 --- a/addons/point_of_sale/test/01_order_to_payment.yml +++ b/addons/point_of_sale/test/01_order_to_payment.yml @@ -124,7 +124,7 @@ I generate the journal entries - !python {model: pos.order}: | - self.create_account_move(cr, uid, [ref('pos_order_pos0')], {}) + self._create_account_move_lines(cr, uid, [ref('pos_order_pos0')], {}) - I test that the generated journal entry is attached to the PoS order - diff --git a/addons/point_of_sale/wizard/__init__.py b/addons/point_of_sale/wizard/__init__.py index 2cd077955ca..442fc2a4133 100644 --- a/addons/point_of_sale/wizard/__init__.py +++ b/addons/point_of_sale/wizard/__init__.py @@ -2,7 +2,6 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. import pos_box -import pos_confirm import pos_details import pos_discount import pos_open_statement diff --git a/addons/point_of_sale/wizard/pos_confirm.py b/addons/point_of_sale/wizard/pos_confirm.py deleted file mode 100644 index 78604811dad..00000000000 --- a/addons/point_of_sale/wizard/pos_confirm.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from openerp.osv import osv - - -class pos_confirm(osv.osv_memory): - _name = 'pos.confirm' - _description = 'Post POS Journal Entries' - - def action_confirm(self, cr, uid, ids, context=None): - order_obj = self.pool.get('pos.order') - ids = order_obj.search(cr, uid, [('state','=','paid')], context=context) - for order in order_obj.browse(cr, uid, ids, context=context): - todo = True - for line in order.statement_ids: - if line.statement_id.state != 'confirm': - todo = False - break - if todo: - order.signal_workflow('done') - - # Check if there is orders to reconcile their invoices - ids = order_obj.search(cr, uid, [('state','=','invoiced'),('invoice_id.state','=','open')], context=context) - for order in order_obj.browse(cr, uid, ids, context=context): - invoice = order.invoice_id - data_lines = [x.id for x in invoice.move_id.line_id if x.account_id.id == invoice.account_id.id] - for st in order.statement_ids: - for move in st.move_ids: - data_lines += [x.id for x in move.line_id if x.account_id.id == invoice.account_id.id] - self.pool.get('account.move.line').reconcile(cr, uid, data_lines, context=context) - return {} diff --git a/addons/point_of_sale/wizard/pos_confirm.xml b/addons/point_of_sale/wizard/pos_confirm.xml deleted file mode 100644 index d0a1653a348..00000000000 --- a/addons/point_of_sale/wizard/pos_confirm.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - Post Sale Journal Entries - pos.confirm - -
- -
-
-
-
diff --git a/addons/point_of_sale/wizard/pos_payment.py b/addons/point_of_sale/wizard/pos_payment.py index f609a5ffee5..ed53de42cdd 100644 --- a/addons/point_of_sale/wizard/pos_payment.py +++ b/addons/point_of_sale/wizard/pos_payment.py @@ -48,14 +48,6 @@ class pos_make_payment(osv.osv_memory): 'context': context, } - def print_report(self, cr, uid, ids, context=None): - active_id = context.get('active_id', []) - datas = {'ids' : [active_id]} - return { - 'type': 'ir.actions.report.xml', - 'report_name': 'pos.receipt', - 'datas': datas, - } def _default_journal(self, cr, uid, context=None): if not context: @@ -89,4 +81,4 @@ class pos_make_payment(osv.osv_memory): 'journal_id' : _default_journal, 'payment_date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), 'amount': _default_amount, - } + } \ No newline at end of file