~mga/openobject-addons/account_india

275 by nel
Add lunch module
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()