[16.0][FIX] mass_mailing_partner: control readonly field#1654
[16.0][FIX] mass_mailing_partner: control readonly field#1654kobros-tech wants to merge 1 commit into
Conversation
1a9ad57 to
52b5070
Compare
52b5070 to
69d074a
Compare
| for rec in self: | ||
| if rec.partner_id: | ||
| rec.name = rec.partner_id.name | ||
| rec.email = rec.partner_id.email | ||
| rec.title_id = rec.partner_id.title | ||
| rec.company_name = ( | ||
| rec.partner_id.company_id.name or rec.partner_id.company_name | ||
| ) | ||
| rec.country_id = rec.partner_id.country_id |
There was a problem hiding this comment.
To reduce one complexity level:
| for rec in self: | |
| if rec.partner_id: | |
| rec.name = rec.partner_id.name | |
| rec.email = rec.partner_id.email | |
| rec.title_id = rec.partner_id.title | |
| rec.company_name = ( | |
| rec.partner_id.company_id.name or rec.partner_id.company_name | |
| ) | |
| rec.country_id = rec.partner_id.country_id | |
| for rec in self.filtered("partner_id"): | |
| rec.name = rec.partner_id.name | |
| rec.email = rec.partner_id.email | |
| rec.title_id = rec.partner_id.title | |
| rec.company_name = ( | |
| rec.partner_id.company_id.name or rec.partner_id.company_name | |
| ) | |
| rec.country_id = rec.partner_id.country_id |
| contact._overwrite_partner(vals, True) | ||
| return result | ||
|
|
||
| def write(self, vals): |
There was a problem hiding this comment.
This question remains unanswered. And I don't get the goal of the overall patch.
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
|
hi, is it intended to be merged so I can re create the PR? |
|
Ok, please attend comments. |
|
sure |
69d074a to
7550722
Compare
|
please see if I am done with what you request? |
80d4dc8 to
c410a00
Compare
|
I restored the write method. |
|
And can you explain the goal of this PR? |
|
After reviewing the PR, I guess I was intending to use a specic method inside compute method and in other places because I saw errors are following compute method if it is called in other places. This is what I guess, because I don't remember exactly, forgive my brain. |
|
I should have added the error I propose here from the beginning, or maybe I raised an issue I don't remember. |
|
Hi @pedrobaeza I found the issue for this PR |
| </field> | ||
| <field name="email" position="attributes"> | ||
| <attribute | ||
| name="attrs" | ||
| >{'readonly': [('partner_id', '!=', False)]}</attribute> | ||
| >{'readonly': [('partner_id', '!=', False), ('email', '!=', False)]}</attribute> |
There was a problem hiding this comment.
Then AFAIK, the changes of this file are the only one affected. The rest is non needed refactoring.
c410a00 to
8a8e91e
Compare
|
I am going to PR what you ask for in a new PR, this one will be closed. |
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
No description provided.