[REM] point of sale: removed useless wizard and code
Never called or not used
This commit is contained in:
committed by
Martin Trigaux
parent
7d93f9904e
commit
62406fa4bf
@@ -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',
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
-
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {}
|
||||
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!-- Point of Sale Confirm -->
|
||||
<record id="view_pos_confirm" model="ir.ui.view">
|
||||
<field name="name">Post Sale Journal Entries</field>
|
||||
<field name="model">pos.confirm</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Post All Orders">
|
||||
<separator string="Generate Journal Entries"/>
|
||||
<label string="Generate all sale journal entries for non invoiced orders linked to a closed cash register or statement."/>
|
||||
<footer>
|
||||
<button name="action_confirm" string="Generate Entries" type="object" class="btn-primary"/>
|
||||
<button string="Cancel" class="btn-default" special="cancel" />
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user