~vauxoo/addons-vauxoo/7.0-user_story-rev4-kty

« back to all changes in this revision

Viewing changes to m321_customization/product.py

  • Committer: Jose Antonio
  • Author(s): Vauxoo
  • Date: 2012-06-05 16:28:51 UTC
  • Revision ID: jose@vauxoo.com-20120605162851-5te59fe8bm4vird8

[IMP] Changes in the product mode to add a field that contain a string for available product 

Show diffs side-by-side

added added

removed removed

Lines of Context:
111
111
            return res
112
112
        for product in self.browse(cr,uid,ids,context=context):
113
113
            if product.virtual_available > 0:
 
114
                self.write(cr,uid,[product.id],{'available_boolean':'Available'})
114
115
                res[product.id] = 'Available'
115
116
            else:
116
117
                res[product.id] = ''
 
118
                self.write(cr,uid,[product.id],{'available_boolean':''})
117
119
                
118
120
        return res
119
121
 
120
122
    _columns = {
121
123
            'upc': fields.char("UPC", size=12, help="Universal Product Code (12 digits)"),
122
 
            'available_boolean':fields.function(_stock_available, method=True,type="text", store=True, string='Available Stock'),
 
124
            'available_boolean':fields.text('Available Stock'),
 
125
            'available_bool':fields.function(_stock_available, method=True,store=False,type="text",string='Available Stock'),
123
126
            'profit_code':fields.char("Code from profit", size=20, help="Code from profit database"),
124
127
        }
125
128