~mga/openobject-addons/account_india

« back to all changes in this revision

Viewing changes to lunch/report_amount.py

  • Committer: nel
  • Date: 2007-07-16 05:55:26 UTC
  • Revision ID: nel-206acbf4defe2495320c9024df7d23203676e27c
Add lunch module

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from osv import fields,osv
 
2
 
 
3
class report_lunch_amount(osv.osv):
 
4
    
 
5
    _name='report.lunch.amount'
 
6
    _description = "Amount available by user and box"
 
7
    _auto = False
 
8
    _columns = {
 
9
        'name':fields.char('Name',size=30,required=True),
 
10
        'user_cashmove': fields.many2one('res.users','User Name', readonly=True,readonly=True),
 
11
        'amount': fields.function(amount_available, method=True, readonly=True, string='Remained Total'),
 
12
        'box':fields.many2one('lunch.cashbox','Box Name',size=30,readonly=True),
 
13
        }
 
14
 
 
15
 
 
16
    
 
17
    def init(self, cr):
 
18
                cr.execute("""
 
19
                        create or replace view report_lunch_amount_user as (
 
20
                                select user_cashmove as user, sum(amount) as sum,box from lunch_cashmove group by user_cashmove, box)""")
 
21
 
 
22
 
 
23
 
 
24
report_lunch_amount()