~serpent-consulting-services/addons-vauxoo/7.0-fix-aging-due-mx-dependency

« back to all changes in this revision

Viewing changes to product_historical_price/product.py

  • Committer: Moises Lopez
  • Date: 2014-10-03 08:04:16 UTC
  • mfrom: (1144.1.3 70-addons-vauxoo)
  • Revision ID: moylop260@vauxoo.com-20141003080416-yquvsxfq5i4cy8ux
[MERGE] [FIX] trailing whitespace pylint error C0303 and
[FIX] autopep8 ignoring E501 & E128 and
[FIX] reimported

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
 
31
31
class product_historical(osv.Model):
 
32
 
32
33
    """
33
34
    product_historical
34
35
    """
 
36
 
35
37
    def _get_historical_price(self, cr, uid, ids, field_name, field_value,
36
38
                              arg, context={}):
37
39
        res = {}
39
41
        for id in ids:
40
42
            if self.browse(cr, uid, id).list_price != self.browse(cr, uid,
41
43
                                                                  id).\
42
 
                                                         list_price_historical:
 
44
                    list_price_historical:
43
45
                res[id] = self.browse(cr, uid, id).list_price
44
46
                product_hist.create(cr, uid, {
45
47
                    'product_id': id,
66
68
    _inherit = 'product.product'
67
69
    _columns = {
68
70
        'list_price_historical':
69
 
           fields.function(_get_historical_price,
70
 
                                         method=True, string='Latest Price',
71
 
                                         type='float',
72
 
                                         digits_compute=dp.get_precision(
73
 
                                             'List_Price_Historical'),
74
 
                                         store={'product.product': ( lambda
 
71
        fields.function(_get_historical_price,
 
72
                        method=True, string='Latest Price',
 
73
                        type='float',
 
74
                        digits_compute=dp.get_precision(
 
75
                            'List_Price_Historical'),
 
76
                        store={'product.product': (lambda
75
77
                                             self, cr, uid, ids, c={}: ids, [
76
78
                                                 'list_price'], 50), },
77
 
                                             help="""Latest Recorded Historical
 
79
                        help="""Latest Recorded Historical
78
80
                                             Value"""),
79
81
        'cost_historical': fields.function(_get_historical_cost, method=True,
80
82
                                           string=' Latest Cost', type='float',
81
83
                                           digits_compute=dp.get_precision(
82
84
                                               'Cost_Historical'),
83
 
                                           store={'product.product': ( lambda
 
85
                                           store={'product.product': (lambda
84
86
                                               self, cr, uid, ids, c={}: ids, [
85
87
                                                   'standard_price'], 50), },
86
 
                                               help="""Latest Recorded
 
88
                                           help="""Latest Recorded
87
89
                                               Historical Cost"""),
88
90
        'list_price_historical_ids': fields.one2many('product.historic.price',
89
91
                                                     'product_id',
104
106
        'product_id': fields.many2one('product.product',
105
107
                                      string='Product related to this Price',
106
108
                                      required=True),
107
 
        'name': fields.datetime(string='Date',  required=True),
 
109
        'name': fields.datetime(string='Date', required=True),
108
110
        'price': fields.float(string='Price',
109
111
                              digits_compute=dp.get_precision('Price')),
110
112
        'product_uom': fields.many2one('product.uom', string="Supplier UoM",