odoo-addon-account-credit-control 17.0.1.0.1__py3-none-any.whl → 17.0.2.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@ Account Credit Control
7
7
  !! This file is generated by oca-gen-addon-readme !!
8
8
  !! changes will be overwritten. !!
9
9
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10
- !! source digest: sha256:ec98afee1edce9ad092e8790bb697ccff785aaad74d895c0ed10d06fbad8aaf0
10
+ !! source digest: sha256:6696777c2a3f7249460ff40a0fd6b74bc7cae7607b9d5eb9995884424e926025
11
11
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
12
 
13
13
  .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -5,7 +5,7 @@
5
5
  # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
6
6
  {
7
7
  "name": "Account Credit Control",
8
- "version": "17.0.1.0.1",
8
+ "version": "17.0.2.0.0",
9
9
  "author": "Camptocamp,"
10
10
  "Odoo Community Association (OCA),"
11
11
  "Okia,"
@@ -1194,6 +1194,13 @@ msgstr ""
1194
1194
  msgid "No lines will be changed. All the selected lines are already done."
1195
1195
  msgstr ""
1196
1196
 
1197
+ #. module: account_credit_control
1198
+ #. odoo-python
1199
+ #: code:addons/account_credit_control/models/credit_control_run.py:0
1200
+ #, python-format
1201
+ msgid "Notifications"
1202
+ msgstr ""
1203
+
1197
1204
  #. module: account_credit_control
1198
1205
  #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication__message_needaction_counter
1199
1206
  #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line__message_needaction_counter
@@ -1652,6 +1659,13 @@ msgid ""
1652
1659
  "overridden on partners or invoices."
1653
1660
  msgstr ""
1654
1661
 
1662
+ #. module: account_credit_control
1663
+ #. odoo-python
1664
+ #: code:addons/account_credit_control/models/credit_control_run.py:0
1665
+ #, python-format
1666
+ msgid "The emails will be sent in the background"
1667
+ msgstr ""
1668
+
1655
1669
  #. module: account_credit_control
1656
1670
  #: model_terms:ir.ui.view,arch_db:account_credit_control.credit_control_line_search
1657
1671
  msgid "The line was deprecated by a manual change of policy on invoice."
@@ -4,7 +4,9 @@
4
4
  # Copyright 2020 Manuel Calero - Tecnativa
5
5
  # Copyright 2023 Tecnativa - Víctor Martínez
6
6
  # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
7
- from odoo import _, api, fields, models
7
+ import threading
8
+
9
+ from odoo import _, api, fields, models, modules, registry, tools
8
10
  from odoo.tools.misc import format_amount, format_date
9
11
 
10
12
 
@@ -225,12 +227,39 @@ class CreditControlCommunication(models.Model):
225
227
  comm.credit_control_line_ids.filtered(
226
228
  lambda line: line.state == "to_be_sent"
227
229
  ).write({"state": "queued"})
230
+ comm._send_mails()
231
+
232
+ def _send_mails(self):
233
+ # Launch process in new thread to improve the user speedup
234
+ if not tools.config["test_enable"] and not modules.module.current_test:
235
+
236
+ @self.env.cr.postcommit.add
237
+ def _launch_print_thread():
238
+ threaded_calculation = threading.Thread(
239
+ target=self.send_mails_threaded,
240
+ args=self.ids,
241
+ )
242
+ threaded_calculation.start()
243
+ else:
244
+ self._send_communications_by_email()
245
+
246
+ def send_mails_threaded(self, record_ids):
247
+ with registry(self._cr.dbname).cursor() as cr:
248
+ self = self.with_env(self.env(cr=cr))
249
+ communications = self.browse(record_ids)
250
+ communications._send_communications_by_email()
251
+
252
+ def _send_communications_by_email(self):
253
+ for comm in self:
228
254
  comm.message_mail_with_source(
229
255
  comm.policy_level_id.email_template_id,
230
256
  subtype_id=self.env["ir.model.data"]._xmlid_to_res_id(
231
257
  "account_credit_control.mt_request"
232
258
  ),
233
259
  )
260
+ comm.credit_control_line_ids.filtered(
261
+ lambda line: line.state == "queued"
262
+ ).state = "sent"
234
263
 
235
264
  def _mark_credit_line_as_sent(self):
236
265
  lines = self.mapped("credit_control_line_ids")
@@ -273,7 +273,7 @@ class CreditControlPolicyLevel(models.Model):
273
273
  delay_days = fields.Integer(string="Delay (in days)", required=True)
274
274
  email_template_id = fields.Many2one(
275
275
  comodel_name="mail.template",
276
- domain=[("model_id.model", "=", "credit.control.communication")],
276
+ domain=[("model", "=", "credit.control.communication")],
277
277
  required=True,
278
278
  )
279
279
  channel = fields.Selection(selection=CHANNEL_LIST, required=True)
@@ -208,6 +208,16 @@ class CreditControlRun(models.Model):
208
208
  comm_obj = self.env["credit.control.communication"]
209
209
  comms = comm_obj._generate_comm_from_credit_lines(email_lines)
210
210
  comms._generate_emails()
211
+ # Notify user that the emails will be sent in background
212
+ self.env["bus.bus"]._sendone(
213
+ self.env.user.partner_id,
214
+ "simple_notification",
215
+ {
216
+ "type": "info",
217
+ "title": _("Notifications"),
218
+ "message": _("The emails will be sent in the background"),
219
+ },
220
+ )
211
221
  if letter_lines:
212
222
  wiz = self.env["credit.control.printer"].create(
213
223
  {"line_ids": letter_lines.ids}
@@ -367,7 +367,7 @@ ul.auto-toc {
367
367
  !! This file is generated by oca-gen-addon-readme !!
368
368
  !! changes will be overwritten. !!
369
369
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370
- !! source digest: sha256:ec98afee1edce9ad092e8790bb697ccff785aaad74d895c0ed10d06fbad8aaf0
370
+ !! source digest: sha256:6696777c2a3f7249460ff40a0fd6b74bc7cae7607b9d5eb9995884424e926025
371
371
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372
372
  <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/credit-control/tree/17.0/account_credit_control"><img alt="OCA/credit-control" src="https://img.shields.io/badge/github-OCA%2Fcredit--control-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/credit-control-17-0/credit-control-17-0-account_credit_control"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/credit-control&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373
373
  <p>Account Credit Control module is a part of Financial Tools used in
@@ -249,6 +249,7 @@ class TestCreditControlRun(AccountTestInvoicingCommon):
249
249
  self.assertIn(self.invoice.name, new_communication.message_ids.body)
250
250
  # CASE 2: set the policy level to show invoice details = False
251
251
  control_lines.policy_level_id.mail_show_invoice_detail = False
252
+ control_lines.state = "to_be_sent"
252
253
  marker = self.env["credit.control.marker"].create(
253
254
  {"name": "to_be_sent", "line_ids": [(6, 0, control_lines.ids)]}
254
255
  )
@@ -45,6 +45,7 @@
45
45
  <group colspan="2">
46
46
  <field
47
47
  name="email_template_id"
48
+ context="{'default_model': 'credit.control.communication'}"
48
49
  colspan="2"
49
50
  />
50
51
  <field name="custom_text" colspan="2" />
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: odoo-addon-account_credit_control
3
- Version: 17.0.1.0.1
3
+ Version: 17.0.2.0.0
4
4
  Requires-Python: >=3.10
5
5
  Requires-Dist: odoo>=17.0a,<17.1dev
6
6
  Summary: Account Credit Control
@@ -22,7 +22,7 @@ Account Credit Control
22
22
  !! This file is generated by oca-gen-addon-readme !!
23
23
  !! changes will be overwritten. !!
24
24
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
25
- !! source digest: sha256:ec98afee1edce9ad092e8790bb697ccff785aaad74d895c0ed10d06fbad8aaf0
25
+ !! source digest: sha256:6696777c2a3f7249460ff40a0fd6b74bc7cae7607b9d5eb9995884424e926025
26
26
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
27
27
 
28
28
  .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -1,9 +1,9 @@
1
- odoo/addons/account_credit_control/README.rst,sha256=nV7zNhYtd_QCpCryYAkRFyfwt1gqkhkHwkLkNAwJ5u0,5273
1
+ odoo/addons/account_credit_control/README.rst,sha256=Ku7vB7FGyvI4vGo-AueDfHN1uFc_6UArv4-jZqgwE0Q,5273
2
2
  odoo/addons/account_credit_control/__init__.py,sha256=8MjrwJNjAjKy6j77I1529EUbQMh7TZ867lnz-KzifyI,127
3
- odoo/addons/account_credit_control/__manifest__.py,sha256=vXrUA8sRIEHEQqHsX8uew7bCnov2ilSfVUgzsHMQf90,1598
3
+ odoo/addons/account_credit_control/__manifest__.py,sha256=-aBizMCdz-ioJ1SwaY8LzMOSoYtyqjPFNs8i8KGqJuI,1598
4
4
  odoo/addons/account_credit_control/data/data.xml,sha256=_0InXFCkHK5nkZbacV-qXpg4LqMGIpk3A7pWFhAyw08,10648
5
5
  odoo/addons/account_credit_control/demo/res_users.xml,sha256=KWDhrbbE4VTCHpkvFMu49yeLkGdwIson7hOkboR-0dE,372
6
- odoo/addons/account_credit_control/i18n/account_credit_control.pot,sha256=49h0-kRMIgrbZwR7tfMijZ1rYjGGfq7G2xyjI-z_Hbk,75866
6
+ odoo/addons/account_credit_control/i18n/account_credit_control.pot,sha256=gSEyAJ4LIU9t2AnkZ8G5ipOrmN6GYYsS4T-lYj2fCzM,76230
7
7
  odoo/addons/account_credit_control/i18n/am.po,sha256=AtlH3Iv1JPoKhF34fI8JXk4UGUtHuox62dAzOgjpRXc,76313
8
8
  odoo/addons/account_credit_control/i18n/ar.po,sha256=aLRIZPBFmpIFIyO1_b4v3zgwnAyuRwnN3qn2TA0Vhok,76608
9
9
  odoo/addons/account_credit_control/i18n/bg.po,sha256=YRskx37s40Auw1Vcxd3azKxV_a6PCPnln-T79dwPRmc,76506
@@ -83,10 +83,10 @@ odoo/addons/account_credit_control/i18n/zh_TW.po,sha256=ePDAMPDhkdbiV_envAj2fmgn
83
83
  odoo/addons/account_credit_control/models/__init__.py,sha256=sb3eOYTLCrhAigyAPEqvfhhTc5oSQoUOqCju7LhgeNI,404
84
84
  odoo/addons/account_credit_control/models/account_account.py,sha256=k7A1hrH2xi-em9uvuBsYuAj-UviL1s_X7wK0GprbZI4,503
85
85
  odoo/addons/account_credit_control/models/account_move.py,sha256=MzN_JSc7GcuDq3YsXOWs7pgk3e8Wt2QtFRlxifoUe24,2128
86
- odoo/addons/account_credit_control/models/credit_control_communication.py,sha256=jL2NPGwyh_ZuR_x2Pg6Iu748xuURrvUyRspYUaK7fbM,9400
86
+ odoo/addons/account_credit_control/models/credit_control_communication.py,sha256=4KmSC-5U_edJh9gtvOjphqLowr6oDp91DmAeKC48fDM,10471
87
87
  odoo/addons/account_credit_control/models/credit_control_line.py,sha256=2IewoX1ZIXHNpXZT0lwICheWJSf0aSC5LYumMz_n_Pg,10381
88
- odoo/addons/account_credit_control/models/credit_control_policy.py,sha256=W74qKxwxTCGRMQIOCCpN_MCuTsTiYS7k7H29Iw0XnOk,16461
89
- odoo/addons/account_credit_control/models/credit_control_run.py,sha256=6kCfWhfD3PiXjRIVmEko_wpArisbTFPTABhfCtdxb3s,7433
88
+ odoo/addons/account_credit_control/models/credit_control_policy.py,sha256=0EuDk4sq0aFdSWgOL-5aLuS-D1NM-FiHjLke2m0LXJk,16452
89
+ odoo/addons/account_credit_control/models/credit_control_run.py,sha256=TcVXDibr1_rIqYWLZIg_X9hrUYCtlkRmoL9fZ9OX9R0,7840
90
90
  odoo/addons/account_credit_control/models/mail_mail.py,sha256=Dj9BtaMn-Bda7LJ75CWbtO2nmq4qBcWyB8NBeH7Kkfg,1173
91
91
  odoo/addons/account_credit_control/models/mail_message.py,sha256=ZogeU-PTBLTNaW19w49cEYzKgEDcTO9FvCJTQ2Mwm7Q,818
92
92
  odoo/addons/account_credit_control/models/res_company.py,sha256=vmoBLc6EmvuwRgUeISjkrDKjwcxv_y94ejVDOA5FDmE,793
@@ -104,16 +104,16 @@ odoo/addons/account_credit_control/report/report_credit_control_summary.xml,sha2
104
104
  odoo/addons/account_credit_control/security/account_security.xml,sha256=72GmbiYqrJBdjAap88o3k-g8Y76jM5CCIZbZc6_TGuY,4071
105
105
  odoo/addons/account_credit_control/security/ir.model.access.csv,sha256=FgKzKdftXknPsreudq4NdvaGqxuUaVWWxGgmrfjHqRA,5531
106
106
  odoo/addons/account_credit_control/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
107
- odoo/addons/account_credit_control/static/description/index.html,sha256=KIkNDRJvXiAVw6fD0NPx3OEHTKxVveBLpXprE5F_w1w,15881
107
+ odoo/addons/account_credit_control/static/description/index.html,sha256=4ZZrmG_9be2fZWgAqx6BpPbhazupHeMJI6K0ULtWoow,15881
108
108
  odoo/addons/account_credit_control/tests/__init__.py,sha256=ytdwXdWp6qfFDhN08R3rfI-w_AriEuONj3VSBV3Ztb0,206
109
109
  odoo/addons/account_credit_control/tests/test_account_move.py,sha256=H62QDrGocrqHKK1ayf5DaUnerCo0_MHrFjgo__fdK68,11178
110
110
  odoo/addons/account_credit_control/tests/test_credit_control_policy.py,sha256=IzBsyIf7iJXUP3jG3_T2yW6bKLJ4HbcvAuyfmC2Wui8,3210
111
- odoo/addons/account_credit_control/tests/test_credit_control_run.py,sha256=CNYR9NVbIuqHJJcrdH0e_6oc94N8MfMuOkKalJtPAzE,13718
111
+ odoo/addons/account_credit_control/tests/test_credit_control_run.py,sha256=HhOQ4GX506xv-9VQK6WpZiLTM9pswUucsoV6tGHMxao,13761
112
112
  odoo/addons/account_credit_control/tests/test_res_partner.py,sha256=GnQsu6T2suBp_44nJlUjTIYs3UNhrNpQWvuYgnWSz1U,1696
113
113
  odoo/addons/account_credit_control/views/account_move.xml,sha256=gSoz9Zd0YAEQdfkIh8g1yqqw0XQWXy5kxa6tMVbj7G0,2145
114
114
  odoo/addons/account_credit_control/views/credit_control_communication.xml,sha256=r9NzBXkV7qQia3698EjDc--F7Ay3LFY3nEmFwiFliGM,6821
115
115
  odoo/addons/account_credit_control/views/credit_control_line.xml,sha256=_u_aG3D3odFrnX3YNvyWu7jUc6G0oWTh9NWGXmthrXQ,12142
116
- odoo/addons/account_credit_control/views/credit_control_policy.xml,sha256=3UBeeqS_25jFcU6_eqPEl8yWwxBrT8W_ArpJ0O1HnXk,6834
116
+ odoo/addons/account_credit_control/views/credit_control_policy.xml,sha256=hYBr4RcjGiPmc3jYwNWroYoKJzJVoWX9lrFf6EnJGwY,6942
117
117
  odoo/addons/account_credit_control/views/credit_control_run.xml,sha256=95xgtEzNqR06jOOfyR8Rw3mkqvtxNiynTnt6L3znlJ8,5637
118
118
  odoo/addons/account_credit_control/views/res_company.xml,sha256=aTBE7IoPHIRjPKG3A-CYaTcq-1x5BHPw3Lcotepnso8,954
119
119
  odoo/addons/account_credit_control/views/res_config_settings_view.xml,sha256=iypH5uqdrPIRxxeFW35qY33uvetBW6LMUeMu0tWGYM0,2237
@@ -128,7 +128,7 @@ odoo/addons/account_credit_control/wizard/credit_control_policy_changer_view.xml
128
128
  odoo/addons/account_credit_control/wizard/credit_control_printer.py,sha256=1UhTbmiZW6Do2x-2D-K-Lrv003P3P9VlhstVjfJBzZo,1816
129
129
  odoo/addons/account_credit_control/wizard/credit_control_printer_view.xml,sha256=PbziKrepf9o5ocwZlWdhPwWCkaa2_6AhuoKMp6rEzWI,2101
130
130
  odoo/addons/account_credit_control/wizard/mail_compose_message.py,sha256=JCnfhE338Z9ebZliiGKlJaCpZOjit5AQwRPKqwUAB_8,1063
131
- odoo_addon_account_credit_control-17.0.1.0.1.dist-info/METADATA,sha256=gFHFVSXPPx811R3d4V9myk9FQrqNvXPPuZyN4bPp1zE,5837
132
- odoo_addon_account_credit_control-17.0.1.0.1.dist-info/WHEEL,sha256=9fEMia4zL7ZuZbnCOrcYogUhmn4XFIVaJ8G4YGI31xc,81
133
- odoo_addon_account_credit_control-17.0.1.0.1.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
134
- odoo_addon_account_credit_control-17.0.1.0.1.dist-info/RECORD,,
131
+ odoo_addon_account_credit_control-17.0.2.0.0.dist-info/METADATA,sha256=XrJK7fUZuv10BE4CiVj6SoYqyVp5u41SVNFNtbT4tds,5837
132
+ odoo_addon_account_credit_control-17.0.2.0.0.dist-info/WHEEL,sha256=9fEMia4zL7ZuZbnCOrcYogUhmn4XFIVaJ8G4YGI31xc,81
133
+ odoo_addon_account_credit_control-17.0.2.0.0.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
134
+ odoo_addon_account_credit_control-17.0.2.0.0.dist-info/RECORD,,