[IMP] point_of_sale: add a guardian for the account.bank.statement
bzr revid: stw@openerp.com-20120605122314-byw2uq6hjlas0052
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from tools.translate import _
|
||||
from osv import osv, fields
|
||||
from account.wizard.pos_box import CashBox
|
||||
|
||||
@@ -14,7 +16,14 @@ class PosBox(CashBox):
|
||||
|
||||
if active_model == 'pos.session':
|
||||
records = self.pool.get(active_model).browse(cr, uid, context.get('active_ids', []) or [], context=context)
|
||||
return self._run(cr, uid, ids, [record.cash_register_id for record in records], context=context)
|
||||
|
||||
bank_statements = [record.cash_register_id for record in records if record.cash_register_id]
|
||||
|
||||
if not bank_statements:
|
||||
raise osv.except_osv(_('Error !'),
|
||||
_("There is no cash register for this PoS Session"))
|
||||
|
||||
return self._run(cr, uid, ids, bank_statements, context=context)
|
||||
else:
|
||||
return super(PosBox, self).run(cr, uid, ids, context=context)
|
||||
|
||||
|
||||
@@ -1,32 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<data>
|
||||
<!-- Pos Receipt -->
|
||||
<record id="view_pos_receipt" model="ir.ui.view">
|
||||
<field name="name">Receipt</field>
|
||||
<field name="model">pos.receipt</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Receipt :">
|
||||
<separator string="Print the Receipt of the Sale" colspan="4"/>
|
||||
<button icon='gtk-cancel' special="cancel"
|
||||
string="Cancel" />
|
||||
<button name="print_report" string="Print Receipt"
|
||||
colspan="1" type="object" icon="gtk-print" />
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Pos Receipt -->
|
||||
|
||||
<record id="view_pos_receipt" model="ir.ui.view">
|
||||
<field name="name">Receipt</field>
|
||||
<field name="model">pos.receipt</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Receipt :">
|
||||
<separator string="Print the Receipt of the Sale" colspan="4"/>
|
||||
<button icon='gtk-cancel' special="cancel"
|
||||
string="Cancel" />
|
||||
<button name="print_report" string="Print Receipt"
|
||||
colspan="1" type="object" icon="gtk-print" />
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_report_pos_receipt" model="ir.actions.act_window">
|
||||
<record id="action_report_pos_receipt" model="ir.actions.act_window">
|
||||
<field name="name">Receipt</field>
|
||||
<field name="res_model">pos.receipt</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
Reference in New Issue
Block a user