bzr revid: olt@tinyerp.com-20090602140917-hdmc91wf2ml59vid
This commit is contained in:
Olivier Laurent
2009-06-02 16:09:17 +02:00
parent 49908a6dd2
commit 19d09b4ec8
5 changed files with 78 additions and 88 deletions
+45 -45
View File
@@ -1,53 +1,53 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<openerp>
<data>
<report
id="pos_receipt"
string="Receipt"
model="pos.order"
name="pos.receipt"
rml="point_of_sale/report/pos_receipt.rml"
auto="False"
header="False"
/>
<data>
<report
id="pos_receipt"
string="Receipt"
model="pos.order"
name="pos.receipt"
rml="point_of_sale/report/pos_receipt.rml"
auto="False"
header="False"
/>
<report
id="pos_invoice_report"
string="Invoice"
model="pos.order"
name="pos.invoice"
auto="False"
rml="account/report/invoice.rml"
/>
<report
id="pos_invoice_report"
string="Invoice"
model="pos.order"
name="pos.invoice"
auto="False"
rml="point_of_sale/report/pos_invoice.rml"
/>
<report
id="pos_lines_detail"
string="Details of Sales"
model="pos.order"
name="pos.details"
auto="False"
multi="True"
rml="point_of_sale/report/pos_details.rml"
/>
<report
id="pos_lines_detail"
string="Details of Sales"
model="pos.order"
name="pos.details"
auto="False"
multi="True"
rml="point_of_sale/report/pos_details.rml"
/>
<report
id="pos_details_summary"
string="Sales (summary)"
model="pos.order"
name="pos.details_summary"
auto="False"
multi="True"
rml="point_of_sale/report/pos_details_summary.rml"
/>
<report
id="pos_details_summary"
string="Sales (summary)"
model="pos.order"
name="pos.details_summary"
auto="False"
multi="True"
rml="point_of_sale/report/pos_details_summary.rml"
/>
<report
id="pos_lines_report"
string="Pos Lines"
model="pos.order"
name="pos.lines"
auto="False"
rml="point_of_sale/report/pos_lines.rml"
/>
<report
id="pos_lines_report"
string="Pos Lines"
model="pos.order"
name="pos.lines"
auto="False"
rml="point_of_sale/report/pos_lines.rml"
/>
</data>
</data>
</openerp>
+20 -20
View File
@@ -1,33 +1,33 @@
<?xml version="1.0"?>
<openerp>
<data>
<data>
<wizard string="Refund Orders" model="pos.order"
name="pos.refund_order" id="pos_refund" menu="False"/>
<wizard string="Refund Orders" model="pos.order"
name="pos.refund_order" id="pos_refund" menu="True"/>
<wizard string="Payment" model="pos.order"
name="pos.payment" id="pos_payment" menu="False"/>
<wizard string="Payment" model="pos.order"
name="pos.payment" id="pos_payment" menu="False"/>
<!--<wizard string="Create Invoices" model="pos.order"
name="pos.create_invoice" id="pos_invoice" multi="True"/>-->
<!--<wizard string="Create Invoices" model="pos.order"
name="pos.create_invoice" id="pos_invoice" multi="True"/>-->
<wizard string="Add products" model="pos.order"
name="pos.add_product" id="pos_add_product" menu="False"/>
<wizard string="Add products" model="pos.order"
name="pos.add_product" id="pos_add_product" menu="False"/>
<!--<wizard string="Cancel" model="pos.order"
name="pos.cancel" id="pos_cancel" multi="True"/>-->
<!--<wizard string="Cancel" model="pos.order"
name="pos.cancel" id="pos_cancel" multi="True"/>-->
<wizard string="Confirm" model="pos.order"
name="pos.confirm" id="pos_confirm" multi="True"/>
<wizard string="Confirm" model="pos.order"
name="pos.confirm" id="pos_confirm" multi="True"/>
<wizard string="Discount" model="pos.order"
name="pos.discount" id="pos_discount" menu="False"/>
<wizard string="Discount" model="pos.order"
name="pos.discount" id="pos_discount" menu="False"/>
<wizard string="Get From Order" model="pos.order"
name="pos.sale.get" id="pos_sale_get"/>
<wizard string="Get From Order" model="pos.order"
name="pos.sale.get" id="pos_sale_get"/>
<wizard string="Scan Product" model="pos.order"
name="pos.scan_product" id="pos_scan_product"/>
<wizard string="Scan Product" model="pos.order"
name="pos.scan_product" id="pos_scan_product"/>
</data>
</data>
</openerp>
+11 -21
View File
@@ -22,12 +22,9 @@
import time
from report import report_sxw
from osv import osv
from tools.translate import _
class pos_invoice(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(pos_invoice, self).__init__(cr, uid, name, context)
self.localcontext.update({
@@ -36,26 +33,19 @@ class pos_invoice(report_sxw.rml_parse):
def preprocess(self, objects, data, ids):
super(pos_invoice, self).preprocess(objects, data, ids)
iids = []
nids = []
for order in objects:
order.write({'nb_print': order.nb_print + 1})
post_objects = []
for obj in objects:
if obj.invoice_id:
post_objects.append(obj.invoice_id)
if order.invoice_id and order.invoice_id not in iids:
if not order.invoice_id:
raise osv.except_osv(_('Error !'), _('Please create an invoice for this sale.'))
iids.append(order.invoice_id)
nids.append(order.invoice_id.id)
self.cr.commit()
data['ids'] = nids
self.datas = data
self.ids = nids
self.objects = iids
self.localcontext['data'] = data
self.localcontext['objects'] = iids
#self.localcontext['objects'] = objects
self.localcontext['objects'] = post_objects
report_sxw.report_sxw('report.pos.invoice', 'pos.order', 'addons/libeurop/report/invoice.rml', parser= pos_invoice)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
report_sxw.report_sxw(
'report.pos.invoice',
'pos.order',
'addons/point_of_sale/report/pos_invoice.rml',
parser=pos_invoice)
+2 -1
View File
@@ -28,5 +28,6 @@ import wizard_confirm
import wizard_discount
import wizard_get_sale
import wizard_scan_product
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
from wizard import except_wizard
@@ -91,5 +91,4 @@ class refund_order(wizard.interface):
}
refund_order('pos.refund_order')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: