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

« back to all changes in this revision

Viewing changes to ecommerce/catalog/catalog.py

  • Committer: Fabien Pinckaers
  • Date: 2008-11-12 06:43:12 UTC
  • Revision ID: fp@tinyerp.com-20081112064312-fp85io97i1e95tuz
moved

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- encoding: utf-8 -*-
 
2
##############################################################################
 
3
#
 
4
#    OpenERP, Open Source Management Solution   
 
5
#    Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
 
6
#    $Id$
 
7
#
 
8
#    This program is free software: you can redistribute it and/or modify
 
9
#    it under the terms of the GNU General Public License as published by
 
10
#    the Free Software Foundation, either version 3 of the License, or
 
11
#    (at your option) any later version.
 
12
#
 
13
#    This program is distributed in the hope that it will be useful,
 
14
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
#    GNU General Public License for more details.
 
17
#
 
18
#    You should have received a copy of the GNU General Public License
 
19
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
20
#
 
21
##############################################################################
 
22
import datetime
 
23
import time
 
24
import netsvc
 
25
from osv import fields,osv
 
26
import ir
 
27
import pooler
 
28
import tools
 
29
 
 
30
 
 
31
class product_product(osv.osv):
 
32
    _inherit = "product.product"
 
33
    _columns = {
 
34
                'product_logo': fields.binary('Product Logo'),
 
35
                'shop_ids': fields.many2many('ecommerce.shop','ecommerce_new_product_rel','ecommerce_product','product','Web shop'),
 
36
}
 
37
product_product()
 
38
 
 
39
class specail_offer(osv.osv):
 
40
    _inherit = "product.pricelist.version"
 
41
    _columns = {
 
42
                'offer_name': fields.char('OfferName',size=64,translate=True)
 
43
        }
 
44
 
 
45
specail_offer()
 
46
 
 
47
class reviews(osv.osv):
 
48
    _name="ecommerce.product.reviews"
 
49
    _rec_name="product"
 
50
    _description="Reviews about product"
 
51
    _columns={
 
52
              'product_id':fields.many2one('product.product','Product', required=True, ondelete='cascade'),
 
53
              'customer_id':fields.many2one('ecommerce.partner','Customer', required=True, ondelete='cascade'),
 
54
              'reviewdate':fields.date('Review Date'),
 
55
              'rating':fields.integer('Rating'),
 
56
              'review':fields.text('Review')
 
57
              }
 
58
    
 
59
    _defaults = {
 
60
        'reviewdate': lambda *a: time.strftime('%Y-%m-%d'),
 
61
    }
 
62
    
 
63
reviews()
 
64