Hi,
In the python the field is defined like this :
property_account_payable_id = fields.Many2one('account.account', company_dependent=True,
string="Account Payable", oldname="property_account_payable",
domain="[('internal_type', '=', 'payable'), ('deprecated', '=', False)]",
help="This account will be used instead of the default one as the payable account for the current partner",
required=True)
So when I log in with a user of company1 I see one value, if I log in with a user from company2 for this field I see other value.
I'm changing the workflow of sale order and I need to know how to read this value for each company that I've.
I manage to do this, like this:
user_company2 = self.env['res.users'].search( [('id','=',6)])
self.env['res.partner'].sudo(user_company2).search( [('id','=',6)]).property_account_receivable_id.id
But I wanted to read the information base on the changing of the company not the changing of the user !
Is there away to read this depending on the company
Now I know that this is a Property Field:
There is some use cases where value of the field must change depending of the current company.
To activate such behavior you can now use the company_dependent option.
A notable evolution in new API is that “property fields” are now searchable.
My question now, is how do I search this field in order to have all information mapped by company?
In database the information is like this:
"2";"";;"2016-02-08 17:43:44.125127";"property_account_receivable_id";1;"many2one";1;1;2552;"";"<binary data>";"2016-02-08 17:43:44.125127";"account.account,9";;""
"25";"";;"2016-02-26 16:35:43.02136";"property_account_receivable_id";1;"many2one";4;1;2552;"";"<binary data>";"2016-02-26 16:35:43.02136";"account.account,388";;""
"32";"";;"2016-02-26 16:36:04.669278";"property_account_receivable_id";1;"many2one";6;1;2552;"";"<binary data>";"2016-02-26 16:36:04.669278";"account.account,767";;""
Maybe there is a function already implemented that is possible to search all values possible to a field depending on the company?
Thanks