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

[17.0][MIG] mass_mailing_list_dynamic #1368

Open
wants to merge 28 commits into
base: 17.0
Choose a base branch
from

Conversation

pedro-evaristo-pegon
Copy link

@pedro-evaristo-pegon pedro-evaristo-pegon commented May 15, 2024

Work done:

  • Code compatible with v17
  • Tests compatible with v17
  • Avoid ruff complain on pre-commit
    image

@pedrobaeza pedrobaeza changed the title [17.0][MIG] mass mailing list dynamic [17.0][MIG] mass_mailing_list_dynamic May 15, 2024
@Bart-dh
Copy link

Bart-dh commented Aug 2, 2024

@pedro-evaristo-pegon is this version functional, or still problems?

@pedro-evaristo-pegon
Copy link
Author

@pedro-evaristo-pegon is this version functional, or still problems?

Hi @Bart-dh , I did my own functional tests in local and all worked. You can also fork my PR and have a look at it.

@pedrobaeza do I need to do anything else to generate the build of the PR?

@pedrobaeza
Copy link
Member

Rebase + force push to get a fresh new build.

yajo and others added 25 commits August 6, 2024 17:09
* [FIX+IMP] mass_mailing_list_dynamic: tests, icons, filters...

* Brand new icon
* Added feature of loading an existing filter as criteria
* Tests as SavepointCase for optimizing times
* Tests in post-install for avoiding errors on res.partner not null constraints
  when several modules added them.
* Updated documentation.
* Fix mock in test for not commiting test data.

* [FIX] mass_mailing_list_dynamic: Wasn't able to create contacts in fully synced lists

Syncing context was being set in the wrong object. Added to test too.

* [FIX] mass_mailing_list_dynamic: Allow to write back vals from res.partner

Module mass_mailing_partner writes back certain values from partner to
mass_mailing_contact. Module should allow that write operation.
- Adds is_synced field to track whether a dynamic list has unsynced
changes or not so the user is aware that the definitive number of
contacts is yet to be determined.
- It fixes an issue that made impossible deleting a res.partner filter
when a list had use it to filter contacts.
- It also shows only the filters available for the user (shared and
belonging to self).
- We change the method to hook on (it wasn't correctly overriden anyway)
to ensure the list is resynced even if no recipients are left. For
example: we create a dynamic list with a domain expecting it to sync in
the first mass_mailing. It wouldn't sync as Odoo dismisses the mailing
considering no recipients are left thus it wouldn't get into the
`send_mail` method.
[UPD] Update mass_mailing_list_dynamic.pot

[UPD] README.rst

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: social-13.0/social-13.0-mass_mailing_list_dynamic
Translate-URL: https://translation.odoo-community.org/projects/social-13-0/social-13-0-mass_mailing_list_dynamic/

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: social-13.0/social-13.0-mass_mailing_list_dynamic
Translate-URL: https://translation.odoo-community.org/projects/social-13-0/social-13-0-mass_mailing_list_dynamic/
…ontacts wizard related to dynamic and full sync list

[UPD] Update mass_mailing_list_dynamic.pot

[UPD] README.rst

mass_mailing_list_dynamic 13.0.1.0.1

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: social-13.0/social-13.0-mass_mailing_list_dynamic
Translate-URL: https://translation.odoo-community.org/projects/social-13-0/social-13-0-mass_mailing_list_dynamic/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: social-16.0/social-16.0-mass_mailing_list_dynamic
Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mass_mailing_list_dynamic/
Currently translated at 25.8% (8 of 31 strings)

Translation: social-16.0/social-16.0-mass_mailing_list_dynamic
Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mass_mailing_list_dynamic/it/
Currently translated at 29.0% (9 of 31 strings)

Translation: social-16.0/social-16.0-mass_mailing_list_dynamic
Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mass_mailing_list_dynamic/sl/
Currently translated at 25.8% (8 of 31 strings)

Translation: social-16.0/social-16.0-mass_mailing_list_dynamic
Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mass_mailing_list_dynamic/it/
Currently translated at 100.0% (32 of 32 strings)

Translation: social-16.0/social-16.0-mass_mailing_list_dynamic
Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mass_mailing_list_dynamic/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: social-16.0/social-16.0-mass_mailing_list_dynamic
Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mass_mailing_list_dynamic/
Currently translated at 100.0% (31 of 31 strings)

Translation: social-16.0/social-16.0-mass_mailing_list_dynamic
Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-mass_mailing_list_dynamic/it/
Copy link

@FernandoRomera FernandoRomera left a comment

Choose a reason for hiding this comment

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

LGTM

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@FernandoRomera
Copy link

@OCA/social-maintainers Is it possible to take a look at this PR?

<field name="dynamic" />
<field name="is_synced" invisible="1" />
</group>
<group invisible="dynamic == False">
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<group invisible="dynamic == False">
<group invisible="not dynamic">

string="Sync now"
icon="fa-exclamation-triangle"
class="btn-danger"
invisible="is_synced == True"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
invisible="is_synced == True"
invisible="is_synced"

type="object"
string="Sync now"
icon="fa-refresh"
invisible="is_synced == False"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
invisible="is_synced == False"
invisible="not is_synced"

/>
</div>
</group>
<div invisible="dynamic == False">
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<div invisible="dynamic == False">
<div invisible="not dynamic">

/> You cannot make manual editions of contacts in fully synchronized lists.
</div>
</div>
<group colspan="4" invisible="dynamic == False">
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<group colspan="4" invisible="dynamic == False">
<group colspan="4" invisible="not dynamic">

</group>
</xpath>
<field name="contact_count" position="attributes">
<attribute name="invisible"> is_synced == False </attribute>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<attribute name="invisible"> is_synced == False </attribute>
<attribute name="invisible">not is_synced</attribute>

<attribute name="invisible"> is_synced == False </attribute>
</field>
<field name="contact_count" position="after">
<span invisible="is_synced == True">
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<span invisible="is_synced == True">
<span invisible="is_synced">

Comment on lines +8 to +12
from odoo.tests import common, tagged


@tagged("post_install", "-at_install")
class DynamicListCase(common.TransactionCase):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
from odoo.tests import common, tagged
@tagged("post_install", "-at_install")
class DynamicListCase(common.TransactionCase):
from odoo.tests import tagged
from odoo.addons.base.tests.common import BaseCommon
@tagged("post_install", "-at_install")
class DynamicListCase(BaseCommon):

Comment on lines +11 to +12
"""Allow to write values in mass mailing contact."""
return super(ResPartner, self.with_context(syncing=True)).write(vals)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"""Allow to write values in mass mailing contact."""
return super(ResPartner, self.with_context(syncing=True)).write(vals)
"""Allow to write values in mass mailing contact."""
self = self.with_context(syncing=True)
return super().write(vals)

Comment on lines +11 to +13
return super(
BasePartnerMergeAutomaticWizard, self.with_context(syncing=True)
)._merge(
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return super(
BasePartnerMergeAutomaticWizard, self.with_context(syncing=True)
)._merge(
self = self.with_context(syncing=True)
return super()._merge(

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.