~openerp-commiter/openobject-addons/trunk-extra-addons

« back to all changes in this revision

Viewing changes to bookstore/account.py

  • Committer: Jay vora
  • Date: 2008-05-20 11:35:25 UTC
  • Revision ID: jvo@tinyerp.com-03a2449166812d882b00fbed4ab6e013486d0833

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from osv import fields,osv
 
2
 
 
3
class Invoice(osv.osv):
 
4
        _inherit = 'account.invoice'
 
5
 
 
6
        _columns = {
 
7
                'to_export': fields.boolean('To export'),
 
8
                'to_update': fields.boolean('To update'),
 
9
                }
 
10
 
 
11
        _defaults = {
 
12
                'to_export': lambda *a: True,
 
13
                'to_update': lambda *a: False,
 
14
                }
 
15
 
 
16
        def write(self, cr, uid, ids, values, context=None):
 
17
                if not values:
 
18
                        values = {}
 
19
                if "to_update" not in values:
 
20
                        values['to_update'] = True
 
21
                return super(Invoice,self).write(cr, uid, ids, values, context)
 
22
 
 
23
Invoice()