← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 712254] Re: [stable 6.0][trunk]property fields deleted for other companies if Admin user in multiple companies

 

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

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

Title:
  [stable 6.0][trunk]property fields deleted for other companies if
  Admin user in multiple companies

Status in OpenERP Server:
  Triaged

Bug description:
  This one is really hard to describe.  Basically I needed to override
  the supply_method selection field in product module to make it a char
  so products we produce in one company but buy in others can be kept
  together.

  I did this with this code.

  class product_template(osv.osv):
      _inherit = "product.template"
      _description = "Product Template"
      _columns={
          'supply_method': fields.property('product.template',
              type='char',
              string='Supply Method',
              method=True,
              view_load=True,
              required=True,
              help="Produce will generate production order or tasks, according to the product type. Purchase will trigger purchase orders when requested. This has been overridden values other than 'produce' or 'buy' will cause errors"),
          }
  product_template()

  If I modify products as a normal user of Company A -> expected results occur in db, product template form & in configuration -> parameters.
  However if i modify as Admin user (with full rights to all companies and groups) in HQ company, it modifies the HQ entry as expected, but deletes the Company A entry.
  If I remove admin user from Company A it still deletes company A entry.
  If I create a new HQ user (with full rights to HQ and all groups) it behaves as expected.
  If I add Company A to HQ user rights (full rights to companies and groups) it behaves as expected.

  Next I checked a many2one field not coded by me -> property_account_payable
  Selected a partner and gave them a creditor account in Company A and HQ using the users A and HQ
  Updating by any other user is fine, updating as Admin deletes the entries for other companies.

  So what is going on with Admin user in property fields?





References