[IMP] point_of_sale: Fixed view errors. Improved reports.

bzr revid: uco@tinyerp.com-20100920071038-ga4s8dbt0obnaqja
This commit is contained in:
uco (Open ERP)
2010-09-20 12:40:38 +05:30
parent 404f74b0de
commit a30dcb3e1c
12 changed files with 47 additions and 35 deletions
-3
View File
@@ -2508,8 +2508,6 @@
<field domain="[('journal_id','=',parent.journal_id)]" name="account_id"/>
<field name="analytic_account_id" groups="base.group_extended" />
<field name="amount"/>
<field context="{'partner_id': partner_id, 'amount': amount, 'account_id': account_id, 'currency_id': parent.currency, 'journal_id': parent.journal_id, 'date':date}" name="reconcile_id"/>
<field invisible="1" name="reconcile_amount"/>
</tree>
<form string="Statement lines">
<field name="date"/>
@@ -2519,7 +2517,6 @@
<field domain="[('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]" name="account_id"/>
<field name="analytic_account_id" groups="base.group_extended" />
<field name="amount"/>
<field context="{'partner_id':partner_id,'amount':amount,'account_id':account_id,'currency_id': parent.currency,'journal_id':parent.journal_id, 'date':date}" name="reconcile_id"/>
<field name="ref"/>
<field name="sequence"/>
<separator colspan="4" string="Notes"/>
+4 -4
View File
@@ -50,10 +50,10 @@
<separator colspan="4"/>
<group colspan="4" col="6">
<field name="state" />
<button name="%(action_pos_payment)d" string="Ma_ke Payment" icon="terp-dolar" type="action" states="draft,advance" />
<button name="%(action_report_pos_receipt)d" string="_Reprint" icon="gtk-print" type="action" states="paid,done,invoiced"/>
<button name="set_to_draft" string="Set to _draft" states="paid" icon="gtk-execute" type="object" />
<button name="%(action_view_pos_return)d" string="Return P_icking" type="action" icon="gtk-ok" states="paid"
<button name="%(action_pos_payment)d" string="Make Payment" icon="terp-dolar" type="action" states="draft,advance" />
<button name="%(action_report_pos_receipt)d" string="Reprint" icon="gtk-print" type="action" states="paid,done,invoiced"/>
<button name="set_to_draft" string="Set to draft" states="paid" icon="gtk-execute" type="object" />
<button name="%(action_view_pos_return)d" string="Return Picking" type="action" icon="gtk-ok" states="paid"
attrs="{'invisible':[('state','!=','paid'),('state','!=','invoiced')]}" context="{'return':'return'}" />
</group>
</page>
@@ -37,12 +37,20 @@ class pos_payment_report_date(report_sxw.rml_parse):
dt1 = form['date_start'] + ' 00:00:00'
dt2 = form['date_end'] + ' 23:59:59'
data={}
self.cr.execute ("select pt.name,pol.qty,pol.discount,pol.price_unit, " \
"(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) as total " \
"from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \
"where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \
"and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s and po.user_id IN %s " \
,(dt1,dt2,tuple(form['user_id'])))
if form['user_id']:
self.cr.execute ("select pt.name,pol.qty,pol.discount,pol.price_unit, " \
"(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) as total " \
"from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \
"where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \
"and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s and po.user_id IN %s " \
,(dt1,dt2,tuple(form['user_id'])))
else:
self.cr.execute ("select pt.name,pol.qty,pol.discount,pol.price_unit, " \
"(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) as total " \
"from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \
"where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \
"and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s" \
,(dt1,dt2))
data=self.cr.dictfetchall()
return data
@@ -50,11 +58,18 @@ class pos_payment_report_date(report_sxw.rml_parse):
dt1 = form['date_start'] + ' 00:00:00'
dt2 = form['date_end'] + ' 23:59:59'
res=[]
self.cr.execute ("select sum(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) " \
"from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \
"where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \
"and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s and po.user_id IN %s " \
,(dt1,dt2,tuple(form['user_id'])))
if form['user_id']:
self.cr.execute ("select sum(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) " \
"from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \
"where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \
"and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s and po.user_id IN %s " \
,(dt1,dt2,tuple(form['user_id'])))
else:
self.cr.execute ("select sum(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) " \
"from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \
"where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \
"and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s" \
,(dt1,dt2))
res=self.cr.fetchone()[0] or 0.0
return res
@@ -27,10 +27,10 @@
<field name="arch" type="xml">
<search string="Point of Sale Cash Register Analysis">
<group>
<filter icon="terp-go-year" string=" This Year "
<filter icon="terp-go-year" string="Year"
domain="[('year','=',time.strftime('%%Y'))]"
help="Cash Analysis created during this year"/>
<filter icon="terp-go-month" string=" This Month "
<filter icon="terp-go-month" string="Month"
domain="[('month','=',time.strftime('%%m'))]"
help="Cash Analysis created in current month"/>
<filter icon="terp-go-month"
@@ -38,10 +38,10 @@
<field name="arch" type="xml">
<search string="Point of Sale Analysis">
<group>
<filter icon="terp-go-year" string="This Year"
<filter icon="terp-go-year" string="Year"
domain="[('year','=',time.strftime('%%Y'))]"
help="POS ordered created during current year"/>
<filter icon="terp-go-month" string="This Month"
<filter icon="terp-go-month" string="Month"
domain="[('month','=',time.strftime('%%m'))]"
help="POS ordered created during current month"/>
<filter icon="terp-go-month"
@@ -18,8 +18,8 @@
<group colspan="4" col="4">
<group col="2" colspan="2"/>
<button icon="gtk-stop" special="cancel"
string="_Cancel" />
<button name="get_in" string="_Put Money"
string="Cancel" />
<button name="get_in" string="Put Money"
colspan="1" type="object" icon="terp-dolar_ok!" />
</group>
</form>
+2 -2
View File
@@ -18,8 +18,8 @@
<group colspan="4" col="4">
<group col="2" colspan="2"/>
<button icon="gtk-stop" special="cancel"
string="_Cancel" />
<button name="get_out" string="_Take Money"
string="Cancel" />
<button name="get_out" string="Take Money"
colspan="1" type="object" icon="terp-dolar" />
</group>
</form>
@@ -14,8 +14,8 @@
<group col="4" colspan="4">
<group col="2" colspan="2"/>
<button icon='gtk-stop' special="cancel"
string="_No" />
<button name="close_statement" string="_Yes"
string="No" />
<button name="close_statement" string="Yes"
type="object" icon="gtk-ok"/>
</group>
</form>
@@ -14,8 +14,8 @@
<group col="4" colspan="4">
<group col="2" colspan="2"/>
<button icon='gtk-stop' special="cancel"
string="_No" />
<button name="open_statement" string="_Yes"
string="No" />
<button name="open_statement" string="Yes"
type="object" icon="gtk-ok"/>
</group>
</form>
+2 -2
View File
@@ -32,8 +32,8 @@
<separator colspan="4"/>
<group col="4" colspan="4">
<group col="2" colspan="2"/>
<button icon='gtk-stop' special="cancel" string="_Cancel" />
<button name="check" string="Ma_ke Payment" colspan="1" type="object" icon="terp-dolar"/>
<button icon='gtk-stop' special="cancel" string="Cancel" />
<button name="check" string="Make Payment" colspan="1" type="object" icon="terp-dolar"/>
</group>
</group>
</form>
@@ -51,7 +51,7 @@ class pos_payment_report_date(osv.osv_memory):
_columns = {
'date_start': fields.date('Start Date', required=True),
'date_end': fields.date('End Date', required=True),
'user_id': fields.many2many('res.users', 'res_user_sale', 'user_id', 'sale_id', 'Salesman', required=True)
'user_id': fields.many2many('res.users', 'res_user_sale', 'user_id', 'sale_id', 'Salesman')
}
_defaults = {
'date_start': lambda *a: time.strftime('%Y-%m-%d'),
@@ -12,8 +12,8 @@
<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"
string="Cancel" />
<button name="print_report" string="Print Receipt"
colspan="1" type="object" icon="gtk-print" />
</form>
</field>