This question has been flagged

I'm having an issue with the store option under fields.function with 3 fields on multi.  If I have the same trigger on three fields.function it will only update 2 of those fields.  In the below example only two of the fields will be updated if I change 'company_setting.'  I have verified that if I comment out one of the triggers on the 'working fields' the non-working field will start working.  That is, if field1 and field2 are updating and field3 isnt, I can comment out field2 and then field1 and field3 will work.  (please ignore any stupid typos/indention errors, quick pseudo-code)


class res_partner(osv.osv):

    _inherit = 'res.partner'

    def _return_values(self, cr, uid, ids, name, args, context=None):

        res={}     

        for partner in self.browse(cr, uid, ids, context=None):

            field1 = #Math

            field2 = #Math

            field3 = #Math

            res[partner.id] = {'field1': field1, 'field2': field2, 'field3: field3}

        return res

    

    def get_partner_ids(self, cr, uid, ids, context=None):

        #Gets ids I care about and is working

        return ids

    _columns = {

        'field1': fields.function(_return_values, type='float', multi='total',

                   store = {'res.company': get_partner_ids, ['company_setting'], 10}

        'field2': fields.function(_return_values, type='float', multi='total',

                    store = {'res.company': get_partner_ids, ['company_setting'], 10}

        'field3': fields.function(_return_values, type='float', multi='total',

                    store = {'res.company': get_partner_ids, ['company_setting'], 10}

        }




    

Avatar
Discard