Skip to content

[16.0][FIX] mass_mailing_partner: control readonly field#1654

Closed
kobros-tech wants to merge 1 commit into
OCA:16.0from
kencove:16.0-mass_mailing_partner-fix-1
Closed

[16.0][FIX] mass_mailing_partner: control readonly field#1654
kobros-tech wants to merge 1 commit into
OCA:16.0from
kencove:16.0-mass_mailing_partner-fix-1

Conversation

@kobros-tech

Copy link
Copy Markdown

No description provided.

@kobros-tech kobros-tech force-pushed the 16.0-mass_mailing_partner-fix-1 branch 2 times, most recently from 1a9ad57 to 52b5070 Compare May 18, 2025 16:05
Comment thread mass_mailing_partner/models/mailing_contact.py Outdated
Comment thread mass_mailing_partner/models/mailing_contact.py Outdated
@kobros-tech kobros-tech force-pushed the 16.0-mass_mailing_partner-fix-1 branch from 52b5070 to 69d074a Compare May 21, 2025 13:59
@kobros-tech kobros-tech requested a review from pedrobaeza May 21, 2025 14:03
@pedrobaeza pedrobaeza added this to the 16.0 milestone May 21, 2025
@pedrobaeza pedrobaeza changed the title [FIX] mass_mailing_partner: control readonly field [16.0][FIX] mass_mailing_partner: control readonly field May 21, 2025
Comment on lines +46 to +54
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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To reduce one complexity level:

Suggested change
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):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why are you removing this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This question remains unanswered. And I don't get the goal of the overall patch.

@github-actions

Copy link
Copy Markdown

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.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions Bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Sep 28, 2025
@github-actions github-actions Bot closed this Nov 2, 2025
@kobros-tech

Copy link
Copy Markdown
Author

@pedrobaeza

hi, is it intended to be merged so I can re create the PR?

@pedrobaeza pedrobaeza reopened this Nov 16, 2025
@pedrobaeza

Copy link
Copy Markdown
Member

Ok, please attend comments.

@kobros-tech

Copy link
Copy Markdown
Author

sure

@kobros-tech kobros-tech force-pushed the 16.0-mass_mailing_partner-fix-1 branch from 69d074a to 7550722 Compare November 17, 2025 18:08
@kobros-tech

Copy link
Copy Markdown
Author

@pedrobaeza

please see if I am done with what you request?

@kobros-tech kobros-tech force-pushed the 16.0-mass_mailing_partner-fix-1 branch 2 times, most recently from 80d4dc8 to c410a00 Compare November 20, 2025 22:17
@kobros-tech

Copy link
Copy Markdown
Author

@pedrobaeza

I restored the write method.

@pedrobaeza

Copy link
Copy Markdown
Member

And can you explain the goal of this PR?

@kobros-tech

Copy link
Copy Markdown
Author

@pedrobaeza

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.

@kobros-tech

Copy link
Copy Markdown
Author

I should have added the error I propose here from the beginning, or maybe I raised an issue I don't remember.

@kobros-tech

Copy link
Copy Markdown
Author

Hi @pedrobaeza

I found the issue for this PR

#1652

</field>
<field name="email" position="attributes">
<attribute
name="attrs"
>{'readonly': [('partner_id', '!=', False)]}</attribute>
>{'readonly': [('partner_id', '!=', False), ('email', '!=', False)]}</attribute>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Then AFAIK, the changes of this file are the only one affected. The rest is non needed refactoring.

@github-actions github-actions Bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Nov 23, 2025
@kobros-tech kobros-tech force-pushed the 16.0-mass_mailing_partner-fix-1 branch from c410a00 to 8a8e91e Compare November 25, 2025 08:47
@kobros-tech

Copy link
Copy Markdown
Author

@pedrobaeza

I am going to PR what you ask for in a new PR, this one will be closed.

@github-actions

Copy link
Copy Markdown

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.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions Bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Mar 29, 2026
@pedrobaeza pedrobaeza closed this Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale PR/Issue without recent activity, it'll be soon closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants