diff --git a/account_payment_order_notification/README.rst b/account_payment_order_notification/README.rst index 3332ed415..766fc6395 100644 --- a/account_payment_order_notification/README.rst +++ b/account_payment_order_notification/README.rst @@ -102,6 +102,10 @@ Contributors - Víctor Martínez - Pedro M. Baeza +- `APSL-Nagarro `__: + + - Antoni Marroig + Maintainers ----------- diff --git a/account_payment_order_notification/__manifest__.py b/account_payment_order_notification/__manifest__.py index 46b7dd6ab..0dea85d05 100644 --- a/account_payment_order_notification/__manifest__.py +++ b/account_payment_order_notification/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "Account Payment Order Notification", - "version": "16.0.1.0.1", + "version": "17.0.1.0.0", "category": "Banking addons", "website": "https://github.com/OCA/bank-payment", "author": "Tecnativa, Odoo Community Association (OCA)", diff --git a/account_payment_order_notification/models/account_payment_order.py b/account_payment_order_notification/models/account_payment_order.py index 12596db56..24ff9c86d 100644 --- a/account_payment_order_notification/models/account_payment_order.py +++ b/account_payment_order_notification/models/account_payment_order.py @@ -36,7 +36,7 @@ class AccountPaymentOrder(models.Model): def _action_send_mail_notifications(self, template): for notification in self.notification_ids: - notification.message_post_with_template(template.id) + notification.message_post_with_source(template) def _action_create_note_from_notifications(self): body = _("Email has been sent to the following partners: %s") % ( diff --git a/account_payment_order_notification/models/account_payment_order_notification.py b/account_payment_order_notification/models/account_payment_order_notification.py index b8121a907..fc339997d 100644 --- a/account_payment_order_notification/models/account_payment_order_notification.py +++ b/account_payment_order_notification/models/account_payment_order_notification.py @@ -13,17 +13,13 @@ class AccountPaymentOrderNotification(models.Model): order_id = fields.Many2one( comodel_name="account.payment.order", required=True, - readonly=True, ) company_id = fields.Many2one(related="order_id.company_id") partner_id = fields.Many2one( comodel_name="res.partner", required=True, - readonly=True, - ) - payment_line_ids = fields.Many2many( - comodel_name="account.payment.line", readonly=True ) + payment_line_ids = fields.Many2many(comodel_name="account.payment.line") display_name = fields.Char(compute="_compute_display_name") @api.depends("order_id", "partner_id") diff --git a/account_payment_order_notification/readme/CONTRIBUTORS.md b/account_payment_order_notification/readme/CONTRIBUTORS.md index 5fee39042..f22571ba3 100644 --- a/account_payment_order_notification/readme/CONTRIBUTORS.md +++ b/account_payment_order_notification/readme/CONTRIBUTORS.md @@ -1,3 +1,5 @@ - [Tecnativa](https://www.tecnativa.com): - Víctor Martínez - Pedro M. Baeza +- [APSL-Nagarro](https://apsl.tech): + - Antoni Marroig \<\> \ No newline at end of file diff --git a/account_payment_order_notification/static/description/index.html b/account_payment_order_notification/static/description/index.html index c8cdc7302..20d4de935 100644 --- a/account_payment_order_notification/static/description/index.html +++ b/account_payment_order_notification/static/description/index.html @@ -451,6 +451,10 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
  • Pedro M. Baeza
  • +
  • APSL-Nagarro: +
  • diff --git a/account_payment_order_notification/tests/test_account_payment_order_notification.py b/account_payment_order_notification/tests/test_account_payment_order_notification.py index 5a8e82bdd..11fa7e46c 100644 --- a/account_payment_order_notification/tests/test_account_payment_order_notification.py +++ b/account_payment_order_notification/tests/test_account_payment_order_notification.py @@ -24,7 +24,7 @@ class TestAccountPaymentOrderNotification(TransactionCase): cls.product = cls.env["product.product"].create( {"name": "Test product", "list_price": 100} ) - cls.mt_comment = cls.env.ref("mail.mt_comment") + cls.mt_note = cls.env.ref("mail.mt_note") def _create_invoice(self, partner, move_type="out_invoice"): invoice_form = Form( @@ -40,7 +40,7 @@ class TestAccountPaymentOrderNotification(TransactionCase): notification = po.notification_ids.filtered(lambda x: x.partner_id == partner) self.assertEqual(len(notification.payment_line_ids), total) self.assertIn(partner, notification.mapped("message_follower_ids.partner_id")) - self.assertIn(self.mt_comment, notification.mapped("message_ids.subtype_id")) + self.assertIn(self.mt_note, notification.mapped("message_ids.subtype_id")) def test_wizard_account_payment_order_notification(self): self._create_invoice(self.partner_a_child) diff --git a/account_payment_order_notification/views/account_payment_order_notification_view.xml b/account_payment_order_notification/views/account_payment_order_notification_view.xml index 5475053ac..26f87c2d3 100644 --- a/account_payment_order_notification/views/account_payment_order_notification_view.xml +++ b/account_payment_order_notification/views/account_payment_order_notification_view.xml @@ -8,18 +8,18 @@

    - +

    - + - +
    diff --git a/account_payment_order_notification/views/account_payment_order_view.xml b/account_payment_order_notification/views/account_payment_order_view.xml index 6bfcc74ca..d437de525 100644 --- a/account_payment_order_notification/views/account_payment_order_view.xml +++ b/account_payment_order_notification/views/account_payment_order_view.xml @@ -14,7 +14,7 @@ type="object" class="oe_stat_button" icon="fa-envelope" - attrs="{'invisible': [('notification_count', '=', 0)]}" + invisible="notification_count == 0" > diff --git a/account_payment_order_notification/wizard/wizard_account_payment_order_notification.py b/account_payment_order_notification/wizard/wizard_account_payment_order_notification.py index 9ba7d62e9..ca0e8b59c 100644 --- a/account_payment_order_notification/wizard/wizard_account_payment_order_notification.py +++ b/account_payment_order_notification/wizard/wizard_account_payment_order_notification.py @@ -11,7 +11,6 @@ class WizardAccountPaymentOrderNotification(models.TransientModel): order_id = fields.Many2one( comodel_name="account.payment.order", required=True, - readonly=True, ) mail_template_id = fields.Many2one( comodel_name="mail.template", @@ -88,7 +87,7 @@ class WizardAccountPaymentOrderNotificationLine(models.TransientModel): index=True, ) partner_id = fields.Many2one( - comodel_name="res.partner", required=True, string="Partner", readonly=True + comodel_name="res.partner", required=True, string="Partner" ) email = fields.Char() to_send = fields.Boolean(string="To send") diff --git a/account_payment_order_notification/wizard/wizard_account_payment_order_notification_views.xml b/account_payment_order_notification/wizard/wizard_account_payment_order_notification_views.xml index 6598ebc4d..cccc0c5d0 100644 --- a/account_payment_order_notification/wizard/wizard_account_payment_order_notification_views.xml +++ b/account_payment_order_notification/wizard/wizard_account_payment_order_notification_views.xml @@ -7,19 +7,16 @@
    - + - + - +