odoo-addon-hr-payroll-document 16.0.1.0.0.2__py3-none-any.whl → 17.0.1.0.0.2__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.

Potentially problematic release.


This version of odoo-addon-hr-payroll-document might be problematic. Click here for more details.

Files changed (25) hide show
  1. odoo/addons/hr_payroll_document/README.rst +20 -13
  2. odoo/addons/hr_payroll_document/__manifest__.py +2 -1
  3. odoo/addons/hr_payroll_document/i18n/es.po +46 -69
  4. odoo/addons/hr_payroll_document/i18n/hr_payroll_document.pot +37 -11
  5. odoo/addons/hr_payroll_document/i18n/it.po +260 -0
  6. odoo/addons/hr_payroll_document/models/__init__.py +1 -0
  7. odoo/addons/hr_payroll_document/models/hr_employee.py +31 -1
  8. odoo/addons/hr_payroll_document/models/ir_attachment.py +1 -1
  9. odoo/addons/hr_payroll_document/models/ir_attachment_payroll_custom.py +6 -1
  10. odoo/addons/hr_payroll_document/models/res_users.py +20 -0
  11. odoo/addons/hr_payroll_document/readme/CONTRIBUTORS.md +3 -0
  12. odoo/addons/hr_payroll_document/static/description/index.html +32 -20
  13. odoo/addons/hr_payroll_document/tests/test_hr_payroll_document.py +55 -53
  14. odoo/addons/hr_payroll_document/views/hr_employee_views.xml +107 -0
  15. odoo/addons/hr_payroll_document/wizard/payroll_management_wizard.py +14 -27
  16. odoo/addons/hr_payroll_document/wizard/payroll_management_wizard.xml +2 -1
  17. {odoo_addon_hr_payroll_document-16.0.1.0.0.2.dist-info → odoo_addon_hr_payroll_document-17.0.1.0.0.2.dist-info}/METADATA +28 -23
  18. odoo_addon_hr_payroll_document-17.0.1.0.0.2.dist-info/RECORD +30 -0
  19. {odoo_addon_hr_payroll_document-16.0.1.0.0.2.dist-info → odoo_addon_hr_payroll_document-17.0.1.0.0.2.dist-info}/WHEEL +1 -1
  20. odoo_addon_hr_payroll_document-17.0.1.0.0.2.dist-info/top_level.txt +1 -0
  21. odoo/addons/hr_payroll_document/readme/CONTRIBUTORS.rst +0 -2
  22. odoo/addons/hr_payroll_document/tests/common.py +0 -51
  23. odoo_addon_hr_payroll_document-16.0.1.0.0.2.dist-info/RECORD +0 -28
  24. odoo_addon_hr_payroll_document-16.0.1.0.0.2.dist-info/top_level.txt +0 -1
  25. /odoo/addons/hr_payroll_document/readme/{DESCRIPTION.rst → DESCRIPTION.md} +0 -0
@@ -0,0 +1,260 @@
1
+ # Translation of Odoo Server.
2
+ # This file contains the translation of the following modules:
3
+ # * hr_payroll_document
4
+ #
5
+ msgid ""
6
+ msgstr ""
7
+ "Project-Id-Version: Odoo Server 16.0\n"
8
+ "Report-Msgid-Bugs-To: \n"
9
+ "PO-Revision-Date: 2024-03-04 15:34+0000\n"
10
+ "Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
11
+ "Language-Team: none\n"
12
+ "Language: it\n"
13
+ "MIME-Version: 1.0\n"
14
+ "Content-Type: text/plain; charset=UTF-8\n"
15
+ "Content-Transfer-Encoding: \n"
16
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
17
+ "X-Generator: Weblate 4.17\n"
18
+
19
+ #. module: hr_payroll_document
20
+ #: model:mail.template,body_html:hr_payroll_document.payroll_employee_email_template
21
+ msgid ""
22
+ "\n"
23
+ " <html>\n"
24
+ " <head></head>\n"
25
+ " <body style=\"margin: 0; padding: 0;\">\n"
26
+ " <table style=\"padding:20px;background-color:#ededed; border-collapse:separate\" width=\"100%\" cellpadding=\"0\" border=\"0\"><tbody><!-- HEADER --><tr><td style=\"min-width:590px\" align=\"center\"><table style=\"min-width:590px;background-color:#fff; padding:20px; border-collapse:separate\" width=\"590\" cellpadding=\"0\" border=\"0\"><tbody><tr><td style=\"text-align:right\" valign=\"middle\"><img src=\"/logo.png\" style=\"padding:0px;margin:0px; height:auto; width:80px\" alt=\"{{object.company_id.name}}\"></td></tr><tr><td style=\"text-align:left\" valign=\"middle\"><h2 style=\"color:rgb(28, 130, 156)\"><font style=\"color:rgb(107, 175, 103);\">Payroll <t t-out=\"ctx.get('subject')\" contenteditable=\"false\" data-oe-t-inline=\"true\"/></font></h2></td></tr></tbody></table></td></tr><!-- CONTENT --><tr><td style=\"min-width:590px\" align=\"center\"><table style=\"min-width:590px;background-color:rgb(255, 255, 255); padding:20px; border-collapse:separate\" width=\"590\" cellpadding=\"0\" border=\"0\"><tbody><tr><td style=\"font-family:Arial,Helvetica,sans-serif;color:#555; font-size:14px\" valign=\"top\"><p> </p><p>Hello <t t-out=\"object.name\" contenteditable=\"false\" data-oe-t-inline=\"true\"/>,</p><br><p>We send you the payroll with the subject <t t-out=\"ctx.get('subject')\" contenteditable=\"false\" data-oe-t-inline=\"true\"/>.<br></p></td></tr><tr><td style=\"font-family:Arial,Helvetica,sans-serif;color:#555; font-size:14px\" valign=\"top\"><br></td></tr><tr><td style=\"font-family:Arial,Helvetica,sans-serif;color:#555; font-size:14px\" valign=\"top\"><br><p></p></td></tr></tbody></table></td></tr><!-- FOOTER --><tr><td style=\"min-width:590px\" align=\"center\"><table style=\"min-width:590px;background-color:#95ce3f; padding:20px; border-collapse:separate\" width=\"590\" cellpadding=\"0\" border=\"0\"><tbody> </tbody></table></td></tr></tbody></table>\n"
27
+ " <p></p>\n"
28
+ " </html>\n"
29
+ " \n"
30
+ " "
31
+ msgstr ""
32
+ "\n"
33
+ " <html>\n"
34
+ " <head></head>\n"
35
+ " <body style=\"margin: 0; padding: 0;\">\n"
36
+ " <table style=\"padding:20px;background-color:#ededed; "
37
+ "border-collapse:separate\" width=\"100%\" cellpadding=\"0\" border=\"0\""
38
+ "><tbody><!-- HEADER --><tr><td style=\"min-width:590px\" align=\"center\""
39
+ "><table style=\"min-width:590px;background-color:#fff; padding:20px; border-"
40
+ "collapse:separate\" width=\"590\" cellpadding=\"0\" border=\"0\""
41
+ "><tbody><tr><td style=\"text-align:right\" valign=\"middle\"><img src=\"/logo"
42
+ ".png\" style=\"padding:0px;margin:0px; height:auto; width:80px\" alt=\""
43
+ "{{object.company_id.name}}\"></td></tr><tr><td style=\"text-align:left\" "
44
+ "valign=\"middle\"><h2 style=\"color:rgb(28, 130, 156)\"><font style=\"color"
45
+ ":rgb(107, 175, 103);\">Stipendio<t t-out=\"ctx.get('subject')\" "
46
+ "contenteditable=\"false\" data-oe-t-inline=\"true\""
47
+ "/></font></h2></td></tr></tbody></table></td></tr><!-- CONTENT --><tr><td "
48
+ "style=\"min-width:590px\" align=\"center\"><table style=\"min-width:590px"
49
+ ";background-color:rgb(255, 255, 255); padding:20px; border-collapse:"
50
+ "separate\" width=\"590\" cellpadding=\"0\" border=\"0\"><tbody><tr><td style"
51
+ "=\"font-family:Arial,Helvetica,sans-serif;color:#555; font-size:14px\" "
52
+ "valign=\"top\"><p> </p><p>Hello <t t-out=\"object.name\" contenteditable="
53
+ "\"false\" data-oe-t-inline=\"true\"/>,</p><br><p>Abbiamo inviato la "
54
+ "retribuzione con soggetto<t t-out=\"ctx.get('subject')\" contenteditable="
55
+ "\"false\" data-oe-t-inline=\"true\"/>.<br></p></td></tr><tr><td style=\"font-"
56
+ "family:Arial,Helvetica,sans-serif;color:#555; font-size:14px\" valign=\"top\""
57
+ "><br></td></tr><tr><td style=\"font-family:Arial,Helvetica,sans-"
58
+ "serif;color:#555; font-size:14px\" valign=\"top\""
59
+ "><br><p></p></td></tr></tbody></table></td></tr><!-- FOOTER --><tr><td style"
60
+ "=\"min-width:590px\" align=\"center\"><table style=\"min-width:590px"
61
+ ";background-color:#95ce3f; padding:20px; border-collapse:separate\" width="
62
+ "\"590\" cellpadding=\"0\" border=\"0\"><tbody> "
63
+ "</tbody></table></td></tr></tbody></table>\n"
64
+ " <p></p>\n"
65
+ " </html>\n"
66
+ " \n"
67
+ " "
68
+
69
+ #. module: hr_payroll_document
70
+ #: model:ir.model,name:hr_payroll_document.model_ir_attachment
71
+ #: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment__payrol_rel
72
+ msgid "Attachment"
73
+ msgstr "Allegato"
74
+
75
+ #. module: hr_payroll_document
76
+ #: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__attachment_id
77
+ msgid "Attachment File"
78
+ msgstr "File allegato"
79
+
80
+ #. module: hr_payroll_document
81
+ #: model_terms:ir.ui.view,arch_db:hr_payroll_document.payrolls_management_wizard_form
82
+ msgid "Close"
83
+ msgstr "Chiudi"
84
+
85
+ #. module: hr_payroll_document
86
+ #: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__create_date
87
+ msgid "Create Date"
88
+ msgstr "Data creazione"
89
+
90
+ #. module: hr_payroll_document
91
+ #: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__create_uid
92
+ #: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__create_uid
93
+ msgid "Created by"
94
+ msgstr "Creato da"
95
+
96
+ #. module: hr_payroll_document
97
+ #: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__create_date
98
+ msgid "Created on"
99
+ msgstr "Creato il"
100
+
101
+ #. module: hr_payroll_document
102
+ #: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__display_name
103
+ #: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__display_name
104
+ msgid "Display Name"
105
+ msgstr "Nome visualizzato"
106
+
107
+ #. module: hr_payroll_document
108
+ #: model:ir.model,name:hr_payroll_document.model_hr_employee
109
+ #: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__employee
110
+ msgid "Employee"
111
+ msgstr "Dipendente"
112
+
113
+ #. module: hr_payroll_document
114
+ #. odoo-python
115
+ #: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0
116
+ #: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0
117
+ #, python-format
118
+ msgid "Employees not found"
119
+ msgstr "Dipendenti non trovati"
120
+
121
+ #. module: hr_payroll_document
122
+ #: model:ir.model.fields,help:hr_payroll_document.field_payroll_management_wizard__subject
123
+ msgid ""
124
+ "Enter the title of the payroll whether it is the month, week, day, etc."
125
+ msgstr ""
126
+ "Inserire il titolo della retribuzione se è il mese, settimana, giorno, ecc."
127
+
128
+ #. module: hr_payroll_document
129
+ #: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__id
130
+ #: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__id
131
+ msgid "ID"
132
+ msgstr "ID"
133
+
134
+ #. module: hr_payroll_document
135
+ #. odoo-python
136
+ #: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0
137
+ #: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0
138
+ #, python-format
139
+ msgid "IDs whose employee has not been found: "
140
+ msgstr "ID il cui dipendente non è stato trovato: "
141
+
142
+ #. module: hr_payroll_document
143
+ #: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__identification_id
144
+ msgid "Identification ID"
145
+ msgstr "ID identificazione"
146
+
147
+ #. module: hr_payroll_document
148
+ #: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom____last_update
149
+ #: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard____last_update
150
+ msgid "Last Modified on"
151
+ msgstr "Ultima modifica il"
152
+
153
+ #. module: hr_payroll_document
154
+ #: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__write_uid
155
+ #: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__write_uid
156
+ msgid "Last Updated by"
157
+ msgstr "Ultimo aggiornamento di"
158
+
159
+ #. module: hr_payroll_document
160
+ #: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__write_date
161
+ #: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__write_date
162
+ msgid "Last Updated on"
163
+ msgstr "Ultimo aggiornamento il"
164
+
165
+ #. module: hr_payroll_document
166
+ #. odoo-python
167
+ #: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0
168
+ #, python-format
169
+ msgid "Missing pdf file signature"
170
+ msgstr "Firma PDF mancante"
171
+
172
+ #. module: hr_payroll_document
173
+ #. odoo-python
174
+ #: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0
175
+ #, python-format
176
+ msgid "Payroll"
177
+ msgstr "Retribuzione"
178
+
179
+ #. module: hr_payroll_document
180
+ #. odoo-python
181
+ #: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0
182
+ #, python-format
183
+ msgid "Payroll "
184
+ msgstr "Retribuzione "
185
+
186
+ #. module: hr_payroll_document
187
+ #: model:mail.template,name:hr_payroll_document.payroll_employee_email_template
188
+ msgid "Payroll Employee"
189
+ msgstr "Retribuzione dipendente"
190
+
191
+ #. module: hr_payroll_document
192
+ #: model:ir.model,name:hr_payroll_document.model_payroll_management_wizard
193
+ msgid "Payroll Management"
194
+ msgstr "Gestione retribuzione"
195
+
196
+ #. module: hr_payroll_document
197
+ #: model:ir.model,name:hr_payroll_document.model_ir_attachment_payroll_custom
198
+ msgid "Payroll attachment"
199
+ msgstr "Allegato retribuzione"
200
+
201
+ #. module: hr_payroll_document
202
+ #: model:mail.template,subject:hr_payroll_document.payroll_employee_email_template
203
+ msgid "Payroll {{ctx.get('subject')}}"
204
+ msgstr "Retribuzione {{ctx.get('subject')}}"
205
+
206
+ #. module: hr_payroll_document
207
+ #: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__payrolls
208
+ msgid "Payrolls"
209
+ msgstr "Retribuzioni"
210
+
211
+ #. module: hr_payroll_document
212
+ #: model:ir.actions.act_window,name:hr_payroll_document.payrolls_management_wizard_action
213
+ #: model:ir.ui.menu,name:hr_payroll_document.payrolls_management_wizard_menu_action
214
+ msgid "Payrolls Management"
215
+ msgstr "Gestione retribuzioni"
216
+
217
+ #. module: hr_payroll_document
218
+ #. odoo-python
219
+ #: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0
220
+ #: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0
221
+ #: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0
222
+ #: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0
223
+ #: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0
224
+ #: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0
225
+ #, python-format
226
+ msgid "Payrolls sent"
227
+ msgstr "Retribuzioni inviate"
228
+
229
+ #. module: hr_payroll_document
230
+ #. odoo-python
231
+ #: code:addons/hr_payroll_document/tests/test_hr_payroll_document.py:0
232
+ #: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0
233
+ #, python-format
234
+ msgid "Payrolls sent to employees correctly"
235
+ msgstr "Retribuzioni inviate correttamente ai dipendenti"
236
+
237
+ #. module: hr_payroll_document
238
+ #: model_terms:ir.ui.view,arch_db:hr_payroll_document.payrolls_management_wizard_form
239
+ msgid "Send"
240
+ msgstr "Invia"
241
+
242
+ #. module: hr_payroll_document
243
+ #: model:ir.model.fields,field_description:hr_payroll_document.field_ir_attachment_payroll_custom__subject
244
+ #: model:ir.model.fields,field_description:hr_payroll_document.field_payroll_management_wizard__subject
245
+ msgid "Subject"
246
+ msgstr "Oggetto"
247
+
248
+ #. module: hr_payroll_document
249
+ #. odoo-python
250
+ #: code:addons/hr_payroll_document/models/hr_employee.py:0
251
+ #, python-format
252
+ msgid "The field identification ID is not valid"
253
+ msgstr "L'ID identificazione file non è corretto"
254
+
255
+ #. module: hr_payroll_document
256
+ #. odoo-python
257
+ #: code:addons/hr_payroll_document/wizard/payroll_management_wizard.py:0
258
+ #, python-format
259
+ msgid "You must to filled country field of company"
260
+ msgstr "Serve compilare il campo nazione dell'azienda"
@@ -1,3 +1,4 @@
1
1
  from . import ir_attachment_payroll_custom
2
2
  from . import ir_attachment
3
3
  from . import hr_employee
4
+ from . import res_users
@@ -1,10 +1,40 @@
1
- from odoo import _, models
1
+ from odoo import _, fields, models
2
2
  from odoo.exceptions import ValidationError
3
3
 
4
4
 
5
5
  class Employee(models.Model):
6
6
  _inherit = "hr.employee"
7
7
 
8
+ payroll_count = fields.Integer(
9
+ compute="_compute_payroll_count",
10
+ )
11
+
12
+ def _compute_payroll_count(self):
13
+ self.payroll_count = len(
14
+ self.env["ir.attachment"].search(
15
+ [
16
+ ("document_type", "=", "payroll"),
17
+ ("res_model", "=", self._name),
18
+ ("res_id", "in", self.ids),
19
+ ]
20
+ )
21
+ )
22
+
23
+ def action_get_payroll_tree_view(self):
24
+ action = self.env.ref("base.action_attachment").sudo().read()[0]
25
+ action["context"] = {
26
+ "default_res_model": self._name,
27
+ "default_res_id": self.ids[0],
28
+ }
29
+ action["domain"] = str(
30
+ [
31
+ ("document_type", "=", "payroll"),
32
+ ("res_model", "=", self._name),
33
+ ("res_id", "in", self.ids),
34
+ ]
35
+ )
36
+ return action
37
+
8
38
  def write(self, vals):
9
39
  res = super().write(vals)
10
40
  if "identification_id" in vals and not self.env["res.partner"].simple_vat_check(
@@ -10,5 +10,5 @@ class Attachment(models.Model):
10
10
  "attachment_id3",
11
11
  "document_id",
12
12
  string="Attachment",
13
- invisible=1,
14
13
  )
14
+ document_type = fields.Selection([("payroll", "Payroll")])
@@ -9,10 +9,15 @@ class IRAttachmentPayrollCustom(models.Model):
9
9
  comodel_name="ir.attachment",
10
10
  string="Attachment File",
11
11
  prefetch=False,
12
- invisible=True,
13
12
  ondelete="cascade",
14
13
  )
15
14
  employee = fields.Char()
16
15
  identification_id = fields.Char("Identification ID")
17
16
  create_date = fields.Date(default=fields.Date.context_today)
18
17
  subject = fields.Char()
18
+
19
+ def download(self):
20
+ return {
21
+ "type": "ir.actions.act_url",
22
+ "url": "web/content/" + str(self.attachment_id.id) + "/?download=True",
23
+ }
@@ -0,0 +1,20 @@
1
+ from odoo import models
2
+
3
+
4
+ class ResUsers(models.Model):
5
+ _inherit = "res.users"
6
+
7
+ def action_get_attachment_tree_view(self):
8
+ action = self.env.ref("base.action_attachment").sudo().read()[0]
9
+ action["context"] = {
10
+ "default_res_model": self._name,
11
+ "default_res_id": self.employee_id.id,
12
+ }
13
+ action["domain"] = str(
14
+ [
15
+ ("document_type", "=", "payroll"),
16
+ ("res_model", "=", self.employee_id._name),
17
+ ("res_id", "in", [self.employee_id.id]),
18
+ ]
19
+ )
20
+ return action
@@ -0,0 +1,3 @@
1
+ - [APSL-Nagarro](https://www.apsl.tech):
2
+ - Antoni Marroig \<<amarroig@apsl.net>\>
3
+ - Miquel Alzanillas \<<malzanillas@apsl.net>\>
@@ -1,18 +1,18 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
1
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
2
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
3
  <head>
5
4
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
5
  <meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
7
- <title>HR - Payroll Document</title>
6
+ <title>README.rst</title>
8
7
  <style type="text/css">
9
8
 
10
9
  /*
11
10
  :Author: David Goodger (goodger@python.org)
12
- :Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
11
+ :Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
13
12
  :Copyright: This stylesheet has been placed in the public domain.
14
13
 
15
14
  Default cascading style sheet for the HTML output of Docutils.
15
+ Despite the name, some widely supported CSS2 features are used.
16
16
 
17
17
  See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
18
18
  customize this style sheet.
@@ -275,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
275
275
  margin-left: 2em ;
276
276
  margin-right: 2em }
277
277
 
278
- pre.code .ln { color: grey; } /* line numbers */
278
+ pre.code .ln { color: gray; } /* line numbers */
279
279
  pre.code, code { background-color: #eeeeee }
280
280
  pre.code .comment, code .comment { color: #5C6576 }
281
281
  pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +301,7 @@ span.option {
301
301
  span.pre {
302
302
  white-space: pre }
303
303
 
304
- span.problematic {
304
+ span.problematic, pre.problematic {
305
305
  color: red }
306
306
 
307
307
  span.section-subtitle {
@@ -360,17 +360,23 @@ ul.auto-toc {
360
360
  </style>
361
361
  </head>
362
362
  <body>
363
- <div class="document" id="hr-payroll-document">
364
- <h1 class="title">HR - Payroll Document</h1>
363
+ <div class="document">
365
364
 
365
+
366
+ <a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367
+ <img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368
+ </a>
369
+ <div class="section" id="hr-payroll-document">
370
+ <h1>HR - Payroll Document</h1>
366
371
  <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367
372
  !! This file is generated by oca-gen-addon-readme !!
368
373
  !! changes will be overwritten. !!
369
374
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370
- !! source digest: sha256:3698f5f5e529d5d32ae80cdc1ab30660ad4e5d39b6d98f8dace97a0b233743c5
375
+ !! source digest: sha256:8541f32cab0e71108ff8c422d602825bb599e0141fe69b9342c16742bee0b915
371
376
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
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/payroll/tree/16.0/hr_payroll_document"><img alt="OCA/payroll" src="https://img.shields.io/badge/github-OCA%2Fpayroll-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/payroll-16-0/payroll-16-0-hr_payroll_document"><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/payroll&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373
- <p>This module have a wizard view to manage the different payrolls of employees which is identified by the identification_id attribute.</p>
377
+ <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/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/payroll/tree/17.0/hr_payroll_document"><img alt="OCA/payroll" src="https://img.shields.io/badge/github-OCA%2Fpayroll-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/payroll-17-0/payroll-17-0-hr_payroll_document"><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/payroll&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378
+ <p>This module have a wizard view to manage the different payrolls of
379
+ employees which is identified by the identification_id attribute.</p>
374
380
  <p><strong>Table of contents</strong></p>
375
381
  <div class="contents local topic" id="contents">
376
382
  <ul class="simple">
@@ -384,41 +390,47 @@ ul.auto-toc {
384
390
  </ul>
385
391
  </div>
386
392
  <div class="section" id="bug-tracker">
387
- <h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
393
+ <h2><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h2>
388
394
  <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/payroll/issues">GitHub Issues</a>.
389
395
  In case of trouble, please check there if your issue has already been reported.
390
396
  If you spotted it first, help us to smash it by providing a detailed and welcomed
391
- <a class="reference external" href="https://github.com/OCA/payroll/issues/new?body=module:%20hr_payroll_document%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
397
+ <a class="reference external" href="https://github.com/OCA/payroll/issues/new?body=module:%20hr_payroll_document%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
392
398
  <p>Do not contact contributors directly about support or help with technical issues.</p>
393
399
  </div>
394
400
  <div class="section" id="credits">
395
- <h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
401
+ <h2><a class="toc-backref" href="#toc-entry-2">Credits</a></h2>
396
402
  <div class="section" id="authors">
397
- <h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
403
+ <h3><a class="toc-backref" href="#toc-entry-3">Authors</a></h3>
398
404
  <ul class="simple">
399
405
  <li>APSL</li>
400
406
  </ul>
401
407
  </div>
402
408
  <div class="section" id="contributors">
403
- <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
409
+ <h3><a class="toc-backref" href="#toc-entry-4">Contributors</a></h3>
404
410
  <ul class="simple">
405
- <li>Antoni Marroig Campomar &lt;<a class="reference external" href="mailto:amarroig&#64;apsl.net">amarroig&#64;apsl.net</a>&gt;</li>
406
- <li>Miquel Alzanillas Monserrat &lt;<a class="reference external" href="mailto:malzanillas&#64;apsl.net">malzanillas&#64;apsl.net</a>&gt;</li>
411
+ <li><a class="reference external" href="https://www.apsl.tech">APSL-Nagarro</a>:<ul>
412
+ <li>Antoni Marroig &lt;<a class="reference external" href="mailto:amarroig&#64;apsl.net">amarroig&#64;apsl.net</a>&gt;</li>
413
+ <li>Miquel Alzanillas &lt;<a class="reference external" href="mailto:malzanillas&#64;apsl.net">malzanillas&#64;apsl.net</a>&gt;</li>
414
+ </ul>
415
+ </li>
407
416
  </ul>
408
417
  </div>
409
418
  <div class="section" id="maintainers">
410
- <h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
419
+ <h3><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h3>
411
420
  <p>This module is maintained by the OCA.</p>
412
- <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
421
+ <a class="reference external image-reference" href="https://odoo-community.org">
422
+ <img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
423
+ </a>
413
424
  <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
414
425
  mission is to support the collaborative development of Odoo features and
415
426
  promote its widespread use.</p>
416
427
  <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
417
428
  <p><a class="reference external image-reference" href="https://github.com/peluko00"><img alt="peluko00" src="https://github.com/peluko00.png?size=40px" /></a></p>
418
- <p>This module is part of the <a class="reference external" href="https://github.com/OCA/payroll/tree/16.0/hr_payroll_document">OCA/payroll</a> project on GitHub.</p>
429
+ <p>This module is part of the <a class="reference external" href="https://github.com/OCA/payroll/tree/17.0/hr_payroll_document">OCA/payroll</a> project on GitHub.</p>
419
430
  <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
420
431
  </div>
421
432
  </div>
422
433
  </div>
434
+ </div>
423
435
  </body>
424
436
  </html>
@@ -2,14 +2,53 @@ import base64
2
2
 
3
3
  from odoo import _
4
4
  from odoo.exceptions import UserError, ValidationError
5
- from odoo.modules.module import get_module_resource
5
+ from odoo.tests import common
6
+ from odoo.tools.misc import file_path
6
7
 
7
- from odoo.addons.hr_payroll_document.tests.common import TestHrPayrollDocument
8
+ from odoo.addons.mail.tests.common import mail_new_test_user
8
9
 
9
10
 
10
- class TestHRPayrollDocument(TestHrPayrollDocument):
11
- def setUp(self, *args, **kwargs):
12
- super().setUp(*args, **kwargs)
11
+ class TestHRPayrollDocument(common.TransactionCase):
12
+ @classmethod
13
+ def setUpClass(cls):
14
+ super().setUpClass()
15
+ cls.env.user.tz = "Europe/Brussels"
16
+ cls.user_admin = cls.env.ref("base.user_admin")
17
+
18
+ # Fix Company without country
19
+ cls.env.company.country_id = False
20
+
21
+ # Test users to use through the various tests
22
+ cls.user_employee = mail_new_test_user(
23
+ cls.env, login="david", groups="base.group_user"
24
+ )
25
+ cls.user_employee_id = cls.user_employee.id
26
+
27
+ # Hr Data
28
+ cls.employee_emp = cls.env["hr.employee"].create(
29
+ {
30
+ "name": "David Employee",
31
+ "user_id": cls.user_employee_id,
32
+ "company_id": 1,
33
+ "identification_id": "30831011V",
34
+ }
35
+ )
36
+
37
+ with open(file_path("hr_payroll_document/tests/test.pdf"), "rb") as pdf_file:
38
+ encoded_string = base64.b64encode(pdf_file.read())
39
+ ir_values = {
40
+ "name": "test",
41
+ "type": "binary",
42
+ "datas": encoded_string,
43
+ "store_fname": encoded_string,
44
+ "res_model": "payroll.management.wizard",
45
+ "res_id": 1,
46
+ }
47
+ cls.attachment = cls.env["ir.attachment"].create(ir_values)
48
+ cls.subject = "January"
49
+ cls.wizard = cls.env["payroll.management.wizard"].create(
50
+ {"payrolls": [cls.attachment.id], "subject": cls.subject}
51
+ )
13
52
 
14
53
  def fill_company_id(self):
15
54
  self.env.company.country_id = self.env["res.country"].search(
@@ -17,9 +56,7 @@ class TestHRPayrollDocument(TestHrPayrollDocument):
17
56
  )
18
57
 
19
58
  def test_extension_error(self):
20
- with open(
21
- get_module_resource("hr_payroll_document", "tests", "test.docx"), "rb"
22
- ) as pdf_file:
59
+ with open(file_path("hr_payroll_document/tests/test.docx"), "rb") as pdf_file:
23
60
  encoded_string = base64.b64encode(pdf_file.read())
24
61
  ir_values = {
25
62
  "name": "test",
@@ -53,55 +90,20 @@ class TestHRPayrollDocument(TestHrPayrollDocument):
53
90
  self.fill_company_id()
54
91
  self.env["hr.employee"].search([("id", "=", 1)]).identification_id = "37936636E"
55
92
  self.assertEqual(
56
- self.wizard.send_payrolls(),
57
- {
58
- "type": "ir.actions.client",
59
- "tag": "display_notification",
60
- "params": {
61
- "title": _("Employees not found"),
62
- "message": _("IDs whose employee has not been found: ")
63
- + "51000278D",
64
- "sticky": True,
65
- "type": "warning",
66
- "next": {
67
- "name": _("Payrolls sent"),
68
- "type": "ir.actions.act_window",
69
- "res_model": "hr.employee",
70
- "views": [
71
- (
72
- self.env.ref("hr.hr_employee_public_view_kanban").id,
73
- "list",
74
- )
75
- ],
76
- },
77
- },
78
- },
93
+ self.wizard.send_payrolls()["params"]["title"], _("Employees not found")
94
+ )
95
+ self.assertEqual(
96
+ self.wizard.send_payrolls()["params"]["message"],
97
+ _("IDs whose employee has not been found: ") + "51000278D",
79
98
  )
80
99
 
81
100
  def test_send_payrolls_correctly(self):
82
101
  self.fill_company_id()
83
102
  self.env["hr.employee"].search([("id", "=", 1)]).identification_id = "51000278D"
84
103
  self.assertEqual(
85
- self.wizard.send_payrolls(),
86
- {
87
- "type": "ir.actions.client",
88
- "tag": "display_notification",
89
- "params": {
90
- "title": _("Payrolls sent"),
91
- "message": _("Payrolls sent to employees correctly"),
92
- "sticky": False,
93
- "type": "success",
94
- "next": {
95
- "name": _("Payrolls sent"),
96
- "type": "ir.actions.act_window",
97
- "res_model": "hr.employee",
98
- "views": [
99
- (
100
- self.env.ref("hr.hr_employee_public_view_kanban").id,
101
- "list",
102
- )
103
- ],
104
- },
105
- },
106
- },
104
+ self.wizard.send_payrolls()["params"]["title"], _("Payrolls sent")
105
+ )
106
+ self.assertEqual(
107
+ self.wizard.send_payrolls()["params"]["message"],
108
+ _("Payrolls sent to employees correctly"),
107
109
  )