← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 776458] Re: missing default on m2o field, widget=selection

 

Hello Leonardo,

Would you please check this again with latest updated code.I have checked this issue and did not face any problem.
For your reference I am attaching one screen shot for demo user.

Thanks.

** Attachment added: "DEMO USER"
   https://bugs.launchpad.net/openobject-server/+bug/776458/+attachment/2144446/+files/demo_user.png

** Changed in: openobject-server
       Status: New => Incomplete

-- 
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/776458

Title:
  missing default on m2o field, widget=selection

Status in OpenERP Server:
  Incomplete

Bug description:
  Hi, I'm reporting this in openobject-server as I suspect it is a
  general framework issue. (v6)

  If we take a m2o field that has a 'selection' widget in the view, for
  example the shop in the sale order, then if there are i.e. two shops,
  but the first one can't be correctly visualized because of multi-
  company rules or other things, then by default we get an empty value,
  instead of the first usable one.

  In that case the first shop cannot be visualized because of i.e.
  multicompany rules, I expect to see the second one, not an empty
  string.

  In that specific case, a workaround is adding

  _defaults = {
          'shop_id': lambda self, cr, uid, context: self.pool.get('sale.shop').search(cr, uid, [])[0],
  }

  to the sale.order definition. However this seems to be a workaround
  for a bug that does exist somewhere in the framework.

  thanks!


References