← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 821583] Re: function field type many2one and store=True doesn't work

 

Hello Sébastien,

Thanks for the report.

Investigating it more made us face that there is a contradiction over
the behavior of many2one with store=True and call of read().

We found that bug 594504 is a complete opposite to what has been said
here.

We prefer to have a discussion with framework experts about the intended
behavior in order to justify both the needs whether to call the method
or not.

You may share your views here.

Thanks.

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/821583

Title:
  function field type many2one and store=True doesn't work

Status in OpenERP Server:
  Triaged

Bug description:
  Hi
  I am migrating my customer from v5 to v6
  I make some imporvement for is V6 and I have a problem with the function field

  I try to create a function fields with the type many2one and the
  option store=True. The problem is that the field is still read from
  the function and never from the database. It look like the option
  store=True is never use in reading.

  exemple add this field to sale_shop

      def _get_test_id(self, cr, uid, ids, name, args, context=None):
          print 'get test'
          res={}
          for id in ids:
              res[id] = 1
          return res

          'test': fields.function(_get_test_id, type='many2one',
                  relation='product.product', string='Product', method=True,
                  store=True),

  And open the sale shop. You will see that each time the sale_shop is
  open the field test is read from the function "_get_test_id" and not
  directly from the database.

  I have this bug with the last version of openerp 6.0

  I also send a mail to the support team.
  Best Regard

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/821583/+subscriptions


References