<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"/>
<field domain="[('journal_id', '=', parent.journal_id), ('type', '<>', '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"/>
<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>
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
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
<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"
<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"
<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>
<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>
<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>
<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>
<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>
_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'),
<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>