~akretion-team/+junk/pricelist_advanced

« back to all changes in this revision

Viewing changes to pricelist_builder_customer_attribute/pricelist.py

  • Committer: David Béal
  • Date: 2013-12-02 08:30:33 UTC
  • Revision ID: david.beal@akretion.com-20131202083033-kafunslvy5947hwh
[IMP] PEP8

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
        'country_id': fields.many2one(
32
32
            'res.country',
33
33
            'Country',
34
 
            help="NOT USED by OpenERP to modify pricelist computation (only " \
35
 
                "with external connected applications)"
36
 
        ),
 
34
            help="NOT USED by OpenERP to modify pricelist computation (only "
 
35
                 "with external connected applications)"),
37
36
        'partner_cat_id': fields.many2one(
38
37
            'res.partner.category',
39
38
            'Partner Categ.',
40
 
            help="NOT USED by OpenERP to modify pricelist computation (only " \
41
 
                "with external connected applications)"
42
 
        ),
 
39
            help="NOT USED by OpenERP to modify pricelist computation (only "
 
40
                 "with external connected applications)"),
43
41
    }
44
42
 
45
43
    def write(self, cr, uid, ids, vals, context=None):
46
44
        if 'country_id' in vals or 'partner_cat_id' in vals:
47
45
            vals['to_update'] = True
48
 
        return super(PricelistBuilder, self).write(cr, uid, ids,
49
 
                                                        vals, context=context)
 
46
        return super(PricelistBuilder, self).write(
 
47
            cr, uid, ids, vals, context=context)
50
48
 
51
49
    def _get_hashkey(self, cr, uid, item_tpl, builder, context=None):
52
 
        keys = super(PricelistBuilder, self)._get_hashkey(cr, uid, item_tpl,
53
 
                                                    builder, context=context)
 
50
        keys = super(PricelistBuilder, self)._get_hashkey(
 
51
            cr, uid, item_tpl, builder, context=context)
54
52
        # key generation for start_date and end_date fields
55
53
        # are managed by _get_hashkey parent method
56
54
        # because there are in the same level than
63
61
        return keys
64
62
 
65
63
    def _prepare_item_vals(self, cr, uid, item_tpl, builder, context=None):
66
 
        vals = super(PricelistBuilder, self)._prepare_item_vals(cr, uid,
67
 
                                        item_tpl, builder, context=context)
 
64
        vals = super(PricelistBuilder, self)._prepare_item_vals(
 
65
            cr, uid, item_tpl, builder, context=context)
68
66
        if item_tpl.start_date:
69
67
            vals['start_date'] = item_tpl.start_date
70
68
        if item_tpl.end_date:
80
78
    _inherit = "abstract.pricelist.item"
81
79
 
82
80
    _columns = {
83
 
        'start_date': fields.date('Start date',
84
 
            help="NOT USED by OpenERP to modify pricelist computation (only " \
85
 
                 "with external connected applications)"
86
 
            ),
87
 
        'end_date': fields.date('End date',
88
 
            help="NOT USED by OpenERP to modify pricelist computation (only " \
89
 
                 "with external connected applications)"
90
 
            ),
 
81
        'start_date': fields.date(
 
82
            'Start date',
 
83
            help="NOT USED by OpenERP to modify pricelist computation (only "
 
84
                 "with external connected applications)"),
 
85
        'end_date': fields.date(
 
86
            'End date',
 
87
            help="NOT USED by OpenERP to modify pricelist computation (only "
 
88
                 "with external connected applications)"),
91
89
    }
92
90
 
93
91
 
99
97
        'country_id': fields.many2one(
100
98
            'res.country',
101
99
            'Country',
102
 
            help="NOT USED by OpenERP to modify pricelist computation"
103
 
            ),
 
100
            help="NOT USED by OpenERP to modify pricelist computation"),
104
101
        'partner_cat_id': fields.many2one(
105
102
            'res.partner.category',
106
103
            'Partner Categ.',
107
 
            help="NOT USED by OpenERP to modify pricelist computation"
108
 
            ),
 
104
            help="NOT USED by OpenERP to modify pricelist computation"),
109
105
    }
110
106
 
111
107
 
112
108
class PricelistItemTemplate(orm.Model):
113
109
    _inherit = ['abstract.pricelist.item', 'pricelist.item.template']
114
 
    _name = 'pricelist.item.template'
 
 
b'\\ No newline at end of file'
 
110
    _name = 'pricelist.item.template'