odoo-addon-l10n-es-subcontractor-certificate 16.0.1.0.0.1__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.
Files changed (36) hide show
  1. odoo/addons/l10n_es_subcontractor_certificate/README.rst +89 -0
  2. odoo/addons/l10n_es_subcontractor_certificate/__init__.py +1 -0
  3. odoo/addons/l10n_es_subcontractor_certificate/__manifest__.py +14 -0
  4. odoo/addons/l10n_es_subcontractor_certificate/i18n/bg.po +98 -0
  5. odoo/addons/l10n_es_subcontractor_certificate/i18n/ca.po +97 -0
  6. odoo/addons/l10n_es_subcontractor_certificate/i18n/cs.po +97 -0
  7. odoo/addons/l10n_es_subcontractor_certificate/i18n/en_US.po +97 -0
  8. odoo/addons/l10n_es_subcontractor_certificate/i18n/es.po +100 -0
  9. odoo/addons/l10n_es_subcontractor_certificate/i18n/es_CR.po +97 -0
  10. odoo/addons/l10n_es_subcontractor_certificate/i18n/eu.po +97 -0
  11. odoo/addons/l10n_es_subcontractor_certificate/i18n/fr.po +97 -0
  12. odoo/addons/l10n_es_subcontractor_certificate/i18n/gl.po +100 -0
  13. odoo/addons/l10n_es_subcontractor_certificate/i18n/hr.po +98 -0
  14. odoo/addons/l10n_es_subcontractor_certificate/i18n/l10n_es_subcontractor_certificate.pot +97 -0
  15. odoo/addons/l10n_es_subcontractor_certificate/i18n/nl.po +97 -0
  16. odoo/addons/l10n_es_subcontractor_certificate/i18n/pl.po +98 -0
  17. odoo/addons/l10n_es_subcontractor_certificate/i18n/pt.po +98 -0
  18. odoo/addons/l10n_es_subcontractor_certificate/i18n/pt_BR.po +97 -0
  19. odoo/addons/l10n_es_subcontractor_certificate/i18n/ru.po +99 -0
  20. odoo/addons/l10n_es_subcontractor_certificate/i18n/sl.po +98 -0
  21. odoo/addons/l10n_es_subcontractor_certificate/i18n/sv.po +98 -0
  22. odoo/addons/l10n_es_subcontractor_certificate/i18n/tr.po +97 -0
  23. odoo/addons/l10n_es_subcontractor_certificate/i18n/vi.po +97 -0
  24. odoo/addons/l10n_es_subcontractor_certificate/models/__init__.py +1 -0
  25. odoo/addons/l10n_es_subcontractor_certificate/models/subcontractor_certificate.py +90 -0
  26. odoo/addons/l10n_es_subcontractor_certificate/readme/CONTRIBUTORS.rst +5 -0
  27. odoo/addons/l10n_es_subcontractor_certificate/readme/DESCRIPTION.rst +6 -0
  28. odoo/addons/l10n_es_subcontractor_certificate/static/description/icon.png +0 -0
  29. odoo/addons/l10n_es_subcontractor_certificate/static/description/index.html +442 -0
  30. odoo/addons/l10n_es_subcontractor_certificate/tests/__init__.py +1 -0
  31. odoo/addons/l10n_es_subcontractor_certificate/tests/test_l10n_es_subcontractor_certificate.py +144 -0
  32. odoo/addons/l10n_es_subcontractor_certificate/views/subcontractor_certificate_view.xml +21 -0
  33. odoo_addon_l10n_es_subcontractor_certificate-16.0.1.0.0.1.dist-info/METADATA +104 -0
  34. odoo_addon_l10n_es_subcontractor_certificate-16.0.1.0.0.1.dist-info/RECORD +36 -0
  35. odoo_addon_l10n_es_subcontractor_certificate-16.0.1.0.0.1.dist-info/WHEEL +5 -0
  36. odoo_addon_l10n_es_subcontractor_certificate-16.0.1.0.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,442 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6
+ <title>README.rst</title>
7
+ <style type="text/css">
8
+
9
+ /*
10
+ :Author: David Goodger (goodger@python.org)
11
+ :Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
12
+ :Copyright: This stylesheet has been placed in the public domain.
13
+
14
+ Default cascading style sheet for the HTML output of Docutils.
15
+ Despite the name, some widely supported CSS2 features are used.
16
+
17
+ See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
18
+ customize this style sheet.
19
+ */
20
+
21
+ /* used to remove borders from tables and images */
22
+ .borderless, table.borderless td, table.borderless th {
23
+ border: 0 }
24
+
25
+ table.borderless td, table.borderless th {
26
+ /* Override padding for "table.docutils td" with "! important".
27
+ The right padding separates the table cells. */
28
+ padding: 0 0.5em 0 0 ! important }
29
+
30
+ .first {
31
+ /* Override more specific margin styles with "! important". */
32
+ margin-top: 0 ! important }
33
+
34
+ .last, .with-subtitle {
35
+ margin-bottom: 0 ! important }
36
+
37
+ .hidden {
38
+ display: none }
39
+
40
+ .subscript {
41
+ vertical-align: sub;
42
+ font-size: smaller }
43
+
44
+ .superscript {
45
+ vertical-align: super;
46
+ font-size: smaller }
47
+
48
+ a.toc-backref {
49
+ text-decoration: none ;
50
+ color: black }
51
+
52
+ blockquote.epigraph {
53
+ margin: 2em 5em ; }
54
+
55
+ dl.docutils dd {
56
+ margin-bottom: 0.5em }
57
+
58
+ object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
59
+ overflow: hidden;
60
+ }
61
+
62
+ /* Uncomment (and remove this text!) to get bold-faced definition list terms
63
+ dl.docutils dt {
64
+ font-weight: bold }
65
+ */
66
+
67
+ div.abstract {
68
+ margin: 2em 5em }
69
+
70
+ div.abstract p.topic-title {
71
+ font-weight: bold ;
72
+ text-align: center }
73
+
74
+ div.admonition, div.attention, div.caution, div.danger, div.error,
75
+ div.hint, div.important, div.note, div.tip, div.warning {
76
+ margin: 2em ;
77
+ border: medium outset ;
78
+ padding: 1em }
79
+
80
+ div.admonition p.admonition-title, div.hint p.admonition-title,
81
+ div.important p.admonition-title, div.note p.admonition-title,
82
+ div.tip p.admonition-title {
83
+ font-weight: bold ;
84
+ font-family: sans-serif }
85
+
86
+ div.attention p.admonition-title, div.caution p.admonition-title,
87
+ div.danger p.admonition-title, div.error p.admonition-title,
88
+ div.warning p.admonition-title, .code .error {
89
+ color: red ;
90
+ font-weight: bold ;
91
+ font-family: sans-serif }
92
+
93
+ /* Uncomment (and remove this text!) to get reduced vertical space in
94
+ compound paragraphs.
95
+ div.compound .compound-first, div.compound .compound-middle {
96
+ margin-bottom: 0.5em }
97
+
98
+ div.compound .compound-last, div.compound .compound-middle {
99
+ margin-top: 0.5em }
100
+ */
101
+
102
+ div.dedication {
103
+ margin: 2em 5em ;
104
+ text-align: center ;
105
+ font-style: italic }
106
+
107
+ div.dedication p.topic-title {
108
+ font-weight: bold ;
109
+ font-style: normal }
110
+
111
+ div.figure {
112
+ margin-left: 2em ;
113
+ margin-right: 2em }
114
+
115
+ div.footer, div.header {
116
+ clear: both;
117
+ font-size: smaller }
118
+
119
+ div.line-block {
120
+ display: block ;
121
+ margin-top: 1em ;
122
+ margin-bottom: 1em }
123
+
124
+ div.line-block div.line-block {
125
+ margin-top: 0 ;
126
+ margin-bottom: 0 ;
127
+ margin-left: 1.5em }
128
+
129
+ div.sidebar {
130
+ margin: 0 0 0.5em 1em ;
131
+ border: medium outset ;
132
+ padding: 1em ;
133
+ background-color: #ffffee ;
134
+ width: 40% ;
135
+ float: right ;
136
+ clear: right }
137
+
138
+ div.sidebar p.rubric {
139
+ font-family: sans-serif ;
140
+ font-size: medium }
141
+
142
+ div.system-messages {
143
+ margin: 5em }
144
+
145
+ div.system-messages h1 {
146
+ color: red }
147
+
148
+ div.system-message {
149
+ border: medium outset ;
150
+ padding: 1em }
151
+
152
+ div.system-message p.system-message-title {
153
+ color: red ;
154
+ font-weight: bold }
155
+
156
+ div.topic {
157
+ margin: 2em }
158
+
159
+ h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
160
+ h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
161
+ margin-top: 0.4em }
162
+
163
+ h1.title {
164
+ text-align: center }
165
+
166
+ h2.subtitle {
167
+ text-align: center }
168
+
169
+ hr.docutils {
170
+ width: 75% }
171
+
172
+ img.align-left, .figure.align-left, object.align-left, table.align-left {
173
+ clear: left ;
174
+ float: left ;
175
+ margin-right: 1em }
176
+
177
+ img.align-right, .figure.align-right, object.align-right, table.align-right {
178
+ clear: right ;
179
+ float: right ;
180
+ margin-left: 1em }
181
+
182
+ img.align-center, .figure.align-center, object.align-center {
183
+ display: block;
184
+ margin-left: auto;
185
+ margin-right: auto;
186
+ }
187
+
188
+ table.align-center {
189
+ margin-left: auto;
190
+ margin-right: auto;
191
+ }
192
+
193
+ .align-left {
194
+ text-align: left }
195
+
196
+ .align-center {
197
+ clear: both ;
198
+ text-align: center }
199
+
200
+ .align-right {
201
+ text-align: right }
202
+
203
+ /* reset inner alignment in figures */
204
+ div.align-right {
205
+ text-align: inherit }
206
+
207
+ /* div.align-center * { */
208
+ /* text-align: left } */
209
+
210
+ .align-top {
211
+ vertical-align: top }
212
+
213
+ .align-middle {
214
+ vertical-align: middle }
215
+
216
+ .align-bottom {
217
+ vertical-align: bottom }
218
+
219
+ ol.simple, ul.simple {
220
+ margin-bottom: 1em }
221
+
222
+ ol.arabic {
223
+ list-style: decimal }
224
+
225
+ ol.loweralpha {
226
+ list-style: lower-alpha }
227
+
228
+ ol.upperalpha {
229
+ list-style: upper-alpha }
230
+
231
+ ol.lowerroman {
232
+ list-style: lower-roman }
233
+
234
+ ol.upperroman {
235
+ list-style: upper-roman }
236
+
237
+ p.attribution {
238
+ text-align: right ;
239
+ margin-left: 50% }
240
+
241
+ p.caption {
242
+ font-style: italic }
243
+
244
+ p.credits {
245
+ font-style: italic ;
246
+ font-size: smaller }
247
+
248
+ p.label {
249
+ white-space: nowrap }
250
+
251
+ p.rubric {
252
+ font-weight: bold ;
253
+ font-size: larger ;
254
+ color: maroon ;
255
+ text-align: center }
256
+
257
+ p.sidebar-title {
258
+ font-family: sans-serif ;
259
+ font-weight: bold ;
260
+ font-size: larger }
261
+
262
+ p.sidebar-subtitle {
263
+ font-family: sans-serif ;
264
+ font-weight: bold }
265
+
266
+ p.topic-title {
267
+ font-weight: bold }
268
+
269
+ pre.address {
270
+ margin-bottom: 0 ;
271
+ margin-top: 0 ;
272
+ font: inherit }
273
+
274
+ pre.literal-block, pre.doctest-block, pre.math, pre.code {
275
+ margin-left: 2em ;
276
+ margin-right: 2em }
277
+
278
+ pre.code .ln { color: gray; } /* line numbers */
279
+ pre.code, code { background-color: #eeeeee }
280
+ pre.code .comment, code .comment { color: #5C6576 }
281
+ pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
282
+ pre.code .literal.string, code .literal.string { color: #0C5404 }
283
+ pre.code .name.builtin, code .name.builtin { color: #352B84 }
284
+ pre.code .deleted, code .deleted { background-color: #DEB0A1}
285
+ pre.code .inserted, code .inserted { background-color: #A3D289}
286
+
287
+ span.classifier {
288
+ font-family: sans-serif ;
289
+ font-style: oblique }
290
+
291
+ span.classifier-delimiter {
292
+ font-family: sans-serif ;
293
+ font-weight: bold }
294
+
295
+ span.interpreted {
296
+ font-family: sans-serif }
297
+
298
+ span.option {
299
+ white-space: nowrap }
300
+
301
+ span.pre {
302
+ white-space: pre }
303
+
304
+ span.problematic, pre.problematic {
305
+ color: red }
306
+
307
+ span.section-subtitle {
308
+ /* font-size relative to parent (h1..h6 element) */
309
+ font-size: 80% }
310
+
311
+ table.citation {
312
+ border-left: solid 1px gray;
313
+ margin-left: 1px }
314
+
315
+ table.docinfo {
316
+ margin: 2em 4em }
317
+
318
+ table.docutils {
319
+ margin-top: 0.5em ;
320
+ margin-bottom: 0.5em }
321
+
322
+ table.footnote {
323
+ border-left: solid 1px black;
324
+ margin-left: 1px }
325
+
326
+ table.docutils td, table.docutils th,
327
+ table.docinfo td, table.docinfo th {
328
+ padding-left: 0.5em ;
329
+ padding-right: 0.5em ;
330
+ vertical-align: top }
331
+
332
+ table.docutils th.field-name, table.docinfo th.docinfo-name {
333
+ font-weight: bold ;
334
+ text-align: left ;
335
+ white-space: nowrap ;
336
+ padding-left: 0 }
337
+
338
+ /* "booktabs" style (no vertical lines) */
339
+ table.docutils.booktabs {
340
+ border: 0px;
341
+ border-top: 2px solid;
342
+ border-bottom: 2px solid;
343
+ border-collapse: collapse;
344
+ }
345
+ table.docutils.booktabs * {
346
+ border: 0px;
347
+ }
348
+ table.docutils.booktabs th {
349
+ border-bottom: thin solid;
350
+ text-align: left;
351
+ }
352
+
353
+ h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
354
+ h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
355
+ font-size: 100% }
356
+
357
+ ul.auto-toc {
358
+ list-style-type: none }
359
+
360
+ </style>
361
+ </head>
362
+ <body>
363
+ <div class="document">
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="certificado-de-subcontratista">
370
+ <h1>Certificado de subcontratista</h1>
371
+ <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
372
+ !! This file is generated by oca-gen-addon-readme !!
373
+ !! changes will be overwritten. !!
374
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375
+ !! source digest: sha256:f22e0ade735bdb3d6a0c427477838e5d0f1e1485974d6dec7d6e67e9706297f1
376
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
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/l10n-spain/tree/16.0/l10n_es_subcontractor_certificate"><img alt="OCA/l10n-spain" src="https://img.shields.io/badge/github-OCA%2Fl10n--spain-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-spain-16-0/l10n-spain-16-0-l10n_es_subcontractor_certificate"><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/l10n-spain&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378
+ <p>Este módulo permite gestionar el certificado de subcontratista de los
379
+ proveedores, en su ficha la caducidad del certificado.</p>
380
+ <p>En pedidos de compra y facturas, al seleccionar el proveedor, si este
381
+ tiene fecha de caducidad del certificado y es anterior a la fecha actual
382
+ devolverá un aviso indicando que tiene el certificado caducado.</p>
383
+ <p><strong>Table of contents</strong></p>
384
+ <div class="contents local topic" id="contents">
385
+ <ul class="simple">
386
+ <li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
387
+ <li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
388
+ <li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
389
+ <li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
390
+ <li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
391
+ </ul>
392
+ </li>
393
+ </ul>
394
+ </div>
395
+ <div class="section" id="bug-tracker">
396
+ <h2><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h2>
397
+ <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-spain/issues">GitHub Issues</a>.
398
+ In case of trouble, please check there if your issue has already been reported.
399
+ If you spotted it first, help us to smash it by providing a detailed and welcomed
400
+ <a class="reference external" href="https://github.com/OCA/l10n-spain/issues/new?body=module:%20l10n_es_subcontractor_certificate%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
401
+ <p>Do not contact contributors directly about support or help with technical issues.</p>
402
+ </div>
403
+ <div class="section" id="credits">
404
+ <h2><a class="toc-backref" href="#toc-entry-2">Credits</a></h2>
405
+ <div class="section" id="authors">
406
+ <h3><a class="toc-backref" href="#toc-entry-3">Authors</a></h3>
407
+ <ul class="simple">
408
+ <li>Domatix</li>
409
+ </ul>
410
+ </div>
411
+ <div class="section" id="contributors">
412
+ <h3><a class="toc-backref" href="#toc-entry-4">Contributors</a></h3>
413
+ <ul class="simple">
414
+ <li>Domatix - Angel Moya</li>
415
+ <li>Pablo Fuentes &lt;<a class="reference external" href="mailto:pablo&#64;studio73.es">pablo&#64;studio73.es</a>&gt;</li>
416
+ <li><dl class="first docutils">
417
+ <dt><a class="reference external" href="https://www.trey.es">Trey</a>:</dt>
418
+ <dd><ul class="first last">
419
+ <li>Alejandro Bermudez &lt;<a class="reference external" href="mailto:alex&#64;trey.es">alex&#64;trey.es</a>&gt;</li>
420
+ </ul>
421
+ </dd>
422
+ </dl>
423
+ </li>
424
+ </ul>
425
+ </div>
426
+ <div class="section" id="maintainers">
427
+ <h3><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h3>
428
+ <p>This module is maintained by the OCA.</p>
429
+ <a class="reference external image-reference" href="https://odoo-community.org">
430
+ <img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
431
+ </a>
432
+ <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
433
+ mission is to support the collaborative development of Odoo features and
434
+ promote its widespread use.</p>
435
+ <p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-spain/tree/16.0/l10n_es_subcontractor_certificate">OCA/l10n-spain</a> project on GitHub.</p>
436
+ <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>
437
+ </div>
438
+ </div>
439
+ </div>
440
+ </div>
441
+ </body>
442
+ </html>
@@ -0,0 +1 @@
1
+ from . import test_l10n_es_subcontractor_certificate
@@ -0,0 +1,144 @@
1
+ # Copyright 2019 Studio73 - Pablo Fuentes <pablo@studio73.es>
2
+ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3
+ from datetime import timedelta
4
+
5
+ from odoo import fields
6
+ from odoo.tests import tagged
7
+
8
+ from odoo.addons.account.tests.common import AccountTestInvoicingCommon
9
+
10
+ from ..models.subcontractor_certificate import (
11
+ EXPIRED_WARNING_AEAT,
12
+ EXPIRED_WARNING_SS,
13
+ REQUIRED_WARNING_AEAT,
14
+ REQUIRED_WARNING_SS,
15
+ )
16
+
17
+
18
+ @tagged("post_install", "-at_install")
19
+ class TestL10nEsSubcontractorCertificate(AccountTestInvoicingCommon):
20
+ def setUp(self):
21
+ super(TestL10nEsSubcontractorCertificate, self).setUp()
22
+ self.account_receivable_a1 = self.env["account.account"].create(
23
+ {
24
+ "name": "Receivable A1",
25
+ "code": "REC.A",
26
+ "account_type": "asset_receivable",
27
+ "company_id": self.company_data["company"].id,
28
+ }
29
+ )
30
+ self.ctx_no_mail = {
31
+ "no_reset_password": True,
32
+ "mail_create_nosubscribe": True,
33
+ "mail_create_nolog": True,
34
+ }
35
+ Partner = self.env["res.partner"].with_context(**self.ctx_no_mail)
36
+ Purchase = self.env["purchase.order"].with_context(**self.ctx_no_mail)
37
+ Invoice = self.env["account.move"].with_context(**self.ctx_no_mail)
38
+ Journal = self.env["account.journal"]
39
+ self.journal_purchase = Journal.create(
40
+ {
41
+ "name": "Vendor Bills",
42
+ "type": "purchase",
43
+ "code": "TPUR",
44
+ "company_id": self.env.company.id,
45
+ }
46
+ )
47
+ self.partner = Partner.create(
48
+ {
49
+ "name": "Demo Supplier",
50
+ "email": "demo@supplier.com",
51
+ "property_account_receivable_id": self.account_receivable_a1.id,
52
+ }
53
+ )
54
+ self.purchase = Purchase.create({"partner_id": self.partner.id})
55
+ self.invoice = Invoice.create(
56
+ {
57
+ "partner_id": self.partner.id,
58
+ "move_type": "in_invoice",
59
+ "journal_id": self.journal_purchase.id,
60
+ }
61
+ )
62
+ self.expired_date = fields.Date.today() - timedelta(days=1)
63
+
64
+ def test_00_onchange_partner_id(self):
65
+ self.partner.write(
66
+ {
67
+ "certificate_required": True,
68
+ }
69
+ )
70
+ res_purchase = self.purchase.onchange_partner_id()
71
+ self.assertEqual(
72
+ res_purchase.get("warning", False),
73
+ REQUIRED_WARNING_AEAT,
74
+ "Purchase should show warning required AEAT" "certificate expiration date",
75
+ )
76
+ res_invoice = self.invoice._onchange_partner_id()
77
+ self.assertEqual(
78
+ res_invoice.get("warning", False),
79
+ REQUIRED_WARNING_AEAT,
80
+ "Invoice should show warning required AEAT" "certificate expiration date",
81
+ )
82
+
83
+ def test_01_onchange_partner_id(self):
84
+ self.partner.write(
85
+ {
86
+ "certificate_required": True,
87
+ "certificate_expiration_aeat": fields.Date.today(),
88
+ }
89
+ )
90
+ res_purchase = self.purchase.onchange_partner_id()
91
+ self.assertEqual(
92
+ res_purchase.get("warning"),
93
+ REQUIRED_WARNING_SS,
94
+ "Purchase should show warning required SS " "certificate expiration date",
95
+ )
96
+ res_invoice = self.invoice._onchange_partner_id()
97
+ self.assertEqual(
98
+ res_invoice.get("warning"),
99
+ REQUIRED_WARNING_SS,
100
+ "Invoice should show warning required SS " "certificate expiration date",
101
+ )
102
+
103
+ def test_02_onchange_partner_id(self):
104
+ self.partner.write(
105
+ {
106
+ "certificate_required": True,
107
+ "certificate_expiration_aeat": self.expired_date,
108
+ "certificate_expiration_ss": fields.Date.today(),
109
+ }
110
+ )
111
+ res_purchase = self.purchase.onchange_partner_id()
112
+
113
+ self.assertEqual(
114
+ res_purchase.get("warning"),
115
+ EXPIRED_WARNING_AEAT,
116
+ "Purchase should show warning expired AEAT certificate",
117
+ )
118
+ res_invoice = self.invoice._onchange_partner_id()
119
+ self.assertEqual(
120
+ res_invoice.get("warning"),
121
+ EXPIRED_WARNING_AEAT,
122
+ "Invoice should show warning expired AEAT certificate",
123
+ )
124
+
125
+ def test_03_onchange_partner_id(self):
126
+ self.partner.write(
127
+ {
128
+ "certificate_required": True,
129
+ "certificate_expiration_aeat": fields.Date.today(),
130
+ "certificate_expiration_ss": self.expired_date,
131
+ }
132
+ )
133
+ res_purchase = self.purchase.onchange_partner_id()
134
+ self.assertEqual(
135
+ res_purchase.get("warning"),
136
+ EXPIRED_WARNING_SS,
137
+ "Purchase should show warning expired SS certificate",
138
+ )
139
+ res_invoice = self.invoice._onchange_partner_id()
140
+ self.assertEqual(
141
+ res_invoice.get("warning"),
142
+ EXPIRED_WARNING_SS,
143
+ "Invoice should show warning expired SS certificate",
144
+ )
@@ -0,0 +1,21 @@
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <odoo>
3
+ <record model="ir.ui.view" id="view_partner_account_code_form">
4
+ <field name="name">view.partner.account.code.form</field>
5
+ <field name="model">res.partner</field>
6
+ <field name="inherit_id" ref="account.view_partner_property_form" />
7
+ <field name="arch" type="xml">
8
+ <xpath expr="//group[@name='fiscal_information']" position="inside">
9
+ <field name="certificate_required" />
10
+ <field
11
+ name="certificate_expiration_aeat"
12
+ attrs="{'invisible': [('certificate_required','=', False)]}"
13
+ />
14
+ <field
15
+ name="certificate_expiration_ss"
16
+ attrs="{'invisible': [('certificate_required','=', False)]}"
17
+ />
18
+ </xpath>
19
+ </field>
20
+ </record>
21
+ </odoo>