~gdgellatly/openerp-product-attributes/product-pricelist-1296605

« back to all changes in this revision

Viewing changes to product_images_olbs/company.py

  • Committer: Sébastien Beau
  • Date: 2012-12-07 13:26:46 UTC
  • mfrom: (69.2.22 product-extra-addons)
  • Revision ID: sebastien.beau@akretion.com-20121207132646-t7kwe5r3zejy3j2p
[MERGE] merge from cleanning branch, please update the moduel installed

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#
19
19
##############################################################################
20
20
 
21
 
from osv import fields, osv
22
 
from tools.translate import _
 
21
from openerp.osv.orm import Model
 
22
from openerp.osv import fields
23
23
 
24
 
class ResCompany(osv.osv):
 
24
class ResCompany(Model):
25
25
    """Override company to add images configuration"""
26
26
    _inherit = "res.company"
27
 
    _columns = {        
 
27
    _columns = {
28
28
        'local_media_repository':fields.char(
29
 
                        'Images Repository Path', 
 
29
                        'Images Repository Path',
30
30
                        size=256,
31
31
                        help='Local mounted path on OpenERP server where all your images are stored.'
32
 
                    ),
33
 
    }    
34
 
    
 
32
            ),
 
33
        }
 
34
 
35
35
    def get_local_media_repository(self, cr, uid, id=None, context=None):
36
36
        if id:
37
37
            return self.browse(cr, uid, id, context=context).local_media_repository
38
38
        user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
39
39
        return user.company_id.local_media_repository
40
 
 
41
 
ResCompany()