Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sale_commission: propagate agents from company to contacts #197

Merged

Conversation

ernestotejeda
Copy link
Member

@pedrobaeza pedrobaeza added this to the 11.0 milestone Jan 20, 2019
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can assign also agents on create when 'parent_id' in vals and agents not in vals`

@ernestotejeda ernestotejeda force-pushed the 11.0-imp-info_propagation-sale_commission branch from 890ae57 to 06493c9 Compare January 21, 2019 14:55
Copy link
Sponsor Member

@cubells cubells left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should increase the module version too.

sale_commission/models/res_partner.py Outdated Show resolved Hide resolved
@ernestotejeda ernestotejeda force-pushed the 11.0-imp-info_propagation-sale_commission branch from 06493c9 to 74bd9e7 Compare February 1, 2019 13:59
@ernestotejeda
Copy link
Member Author

No problem when you create a contact from * Sales -> Orders -> Customers * and you select the parent company to which it belongs, but, when the contacts are created as part of the insertion of data for the creation of the parent company; From the contact's create method, the agents of the parent company (self.browse (vals ['parent_id']). agents) returns an empty record set, so I can not pass the company's agents to those contacts.
I do not know why self.browse(vals['parent_id']).agents returns an empty record set, apparently this happens because it's a many2many field.
I can't pass this field as default by context apparently because it's a many2many field

@pedrobaeza pedrobaeza force-pushed the 11.0-imp-info_propagation-sale_commission branch from 74bd9e7 to 56f7a44 Compare February 4, 2019 19:52
@pedrobaeza
Copy link
Member

@ernestotejeda check last commit. With this, it's working without problems.

@ernestotejeda ernestotejeda force-pushed the 11.0-imp-info_propagation-sale_commission branch from 56f7a44 to 4d76205 Compare February 5, 2019 14:56
@ernestotejeda
Copy link
Member Author

I added a known issue and squash

@ernestotejeda ernestotejeda force-pushed the 11.0-imp-info_propagation-sale_commission branch from 4d76205 to ff40bf7 Compare March 7, 2019 16:50
@pedrobaeza pedrobaeza merged commit 9352519 into OCA:11.0 Apr 3, 2019
@pedrobaeza pedrobaeza deleted the 11.0-imp-info_propagation-sale_commission branch April 3, 2019 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants