odoo-addon-l10n-br-fiscal 16.0.1.18.2.1__py3-none-any.whl → 16.0.2.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-l10n-br-fiscal might be problematic. Click here for more details.

Files changed (42) hide show
  1. odoo/addons/l10n_br_fiscal/README.rst +1 -1
  2. odoo/addons/l10n_br_fiscal/__manifest__.py +2 -12
  3. odoo/addons/l10n_br_fiscal/i18n/l10n_br_fiscal.pot +72 -820
  4. odoo/addons/l10n_br_fiscal/i18n/pt_BR.po +72 -0
  5. odoo/addons/l10n_br_fiscal/migrations/16.0.2.0.0/pre-migration.py +25 -0
  6. odoo/addons/l10n_br_fiscal/models/__init__.py +0 -3
  7. odoo/addons/l10n_br_fiscal/models/document.py +62 -20
  8. odoo/addons/l10n_br_fiscal/models/invalidate_number.py +0 -44
  9. odoo/addons/l10n_br_fiscal/security/ir.model.access.csv +0 -5
  10. odoo/addons/l10n_br_fiscal/static/description/index.html +1 -1
  11. odoo/addons/l10n_br_fiscal/tests/__init__.py +0 -1
  12. odoo/addons/l10n_br_fiscal/tests/test_fiscal_document_generic.py +0 -48
  13. odoo/addons/l10n_br_fiscal/tests/test_fiscal_document_nfse.py +0 -2
  14. odoo/addons/l10n_br_fiscal/tests/test_subsequent_operation.py +2 -1
  15. odoo/addons/l10n_br_fiscal/tests/test_tax_benefit.py +0 -21
  16. odoo/addons/l10n_br_fiscal/views/document_view.xml +3 -69
  17. odoo/addons/l10n_br_fiscal/views/invalidate_number_view.xml +2 -7
  18. odoo/addons/l10n_br_fiscal/views/l10n_br_fiscal_action.xml +0 -34
  19. odoo/addons/l10n_br_fiscal/views/l10n_br_fiscal_menu.xml +0 -19
  20. odoo/addons/l10n_br_fiscal/wizards/__init__.py +0 -6
  21. odoo/addons/l10n_br_fiscal/wizards/base_wizard_mixin.py +0 -5
  22. odoo/addons/l10n_br_fiscal/wizards/document_status_wizard.py +2 -0
  23. {odoo_addon_l10n_br_fiscal-16.0.1.18.2.1.dist-info → odoo_addon_l10n_br_fiscal-16.0.2.0.0.2.dist-info}/METADATA +3 -3
  24. {odoo_addon_l10n_br_fiscal-16.0.1.18.2.1.dist-info → odoo_addon_l10n_br_fiscal-16.0.2.0.0.2.dist-info}/RECORD +26 -41
  25. odoo/addons/l10n_br_fiscal/models/document_eletronic.py +0 -233
  26. odoo/addons/l10n_br_fiscal/models/document_event.py +0 -392
  27. odoo/addons/l10n_br_fiscal/models/document_workflow.py +0 -402
  28. odoo/addons/l10n_br_fiscal/tests/test_workflow.py +0 -118
  29. odoo/addons/l10n_br_fiscal/views/document_event_report.xml +0 -15
  30. odoo/addons/l10n_br_fiscal/views/document_event_template.xml +0 -114
  31. odoo/addons/l10n_br_fiscal/views/document_event_view.xml +0 -68
  32. odoo/addons/l10n_br_fiscal/wizards/document_cancel_wizard.py +0 -20
  33. odoo/addons/l10n_br_fiscal/wizards/document_cancel_wizard.xml +0 -30
  34. odoo/addons/l10n_br_fiscal/wizards/document_correction_wizard.py +0 -17
  35. odoo/addons/l10n_br_fiscal/wizards/document_correction_wizard.xml +0 -30
  36. odoo/addons/l10n_br_fiscal/wizards/document_import_wizard_mixin.py +0 -132
  37. odoo/addons/l10n_br_fiscal/wizards/document_import_wizard_mixin.xml +0 -44
  38. odoo/addons/l10n_br_fiscal/wizards/document_status_wizard.xml +0 -58
  39. odoo/addons/l10n_br_fiscal/wizards/invalidate_number_wizard.py +0 -29
  40. odoo/addons/l10n_br_fiscal/wizards/invalidate_number_wizard.xml +0 -30
  41. {odoo_addon_l10n_br_fiscal-16.0.1.18.2.1.dist-info → odoo_addon_l10n_br_fiscal-16.0.2.0.0.2.dist-info}/WHEEL +0 -0
  42. {odoo_addon_l10n_br_fiscal-16.0.1.18.2.1.dist-info → odoo_addon_l10n_br_fiscal-16.0.2.0.0.2.dist-info}/top_level.txt +0 -0
@@ -1,402 +0,0 @@
1
- # Copyright (C) 2019 KMEE INFORMATICA LTDA
2
- # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
3
-
4
- from erpbrasil.base.fiscal.edoc import ChaveEdoc
5
-
6
- from odoo import _, api, fields, models
7
- from odoo.exceptions import UserError
8
-
9
- from ..constants.fiscal import (
10
- DOCUMENT_ISSUER_COMPANY,
11
- MODELO_FISCAL_CTE,
12
- MODELO_FISCAL_NFCE,
13
- MODELO_FISCAL_NFE,
14
- MODELO_FISCAL_NFSE,
15
- SITUACAO_EDOC,
16
- SITUACAO_EDOC_A_ENVIAR,
17
- SITUACAO_EDOC_AUTORIZADA,
18
- SITUACAO_EDOC_CANCELADA,
19
- SITUACAO_EDOC_DENEGADA,
20
- SITUACAO_EDOC_EM_DIGITACAO,
21
- SITUACAO_EDOC_ENVIADA,
22
- SITUACAO_EDOC_INUTILIZADA,
23
- SITUACAO_EDOC_REJEITADA,
24
- SITUACAO_FISCAL,
25
- SITUACAO_FISCAL_SPED_CONSIDERA_CANCELADO,
26
- WORKFLOW_DOCUMENTO_NAO_ELETRONICO,
27
- WORKFLOW_EDOC,
28
- )
29
-
30
-
31
- class DocumentWorkflow(models.AbstractModel):
32
- _name = "l10n_br_fiscal.document.workflow"
33
- _description = "Fiscal Document Workflow"
34
-
35
- state_edoc = fields.Selection(
36
- selection=SITUACAO_EDOC,
37
- string="Situação e-doc",
38
- default=SITUACAO_EDOC_EM_DIGITACAO,
39
- copy=False,
40
- required=True,
41
- readonly=True,
42
- # tracking=True,
43
- index=True,
44
- )
45
-
46
- state_fiscal = fields.Selection(
47
- selection=SITUACAO_FISCAL,
48
- string="Situação Fiscal",
49
- copy=False,
50
- # tracking=True,
51
- index=True,
52
- )
53
-
54
- cancel_reason = fields.Char()
55
-
56
- correction_reason = fields.Char()
57
-
58
- def _direct_draft_send(self):
59
- return False
60
-
61
- @api.model
62
- def _avaliable_transition(self, old_state, new_state):
63
- """Verifica as transições disponiveis, para não permitir alterações
64
- de estado desconhecidas. Para mais detalhes verificar a variável
65
- WORKFLOW_EDOC
66
-
67
- (old_state, new_state) in (SITUACAO_EDOC_EM_DIGITACAO,
68
- SITUACAO_EDOC_A_ENVIAR)
69
-
70
- :param old_state: estado antigo
71
- :param new_state: novo estado
72
- :return:
73
- """
74
- self.ensure_one()
75
- if self.document_electronic:
76
- return (old_state, new_state) in WORKFLOW_EDOC
77
- else:
78
- return (old_state, new_state) in WORKFLOW_DOCUMENTO_NAO_ELETRONICO
79
-
80
- def _exec_before_SITUACAO_EDOC_EM_DIGITACAO(self, old_state, new_state):
81
- return True
82
-
83
- def _exec_before_SITUACAO_EDOC_A_ENVIAR(self, old_state, new_state):
84
- self._document_date()
85
- self._document_number()
86
- self._document_comment()
87
- self._document_check()
88
- self._document_export()
89
- return True
90
-
91
- def _exec_before_SITUACAO_EDOC_ENVIADA(self, old_state, new_state):
92
- return True
93
-
94
- def _exec_before_SITUACAO_EDOC_REJEITADA(self, old_state, new_state):
95
- return True
96
-
97
- def _exec_before_SITUACAO_EDOC_AUTORIZADA(self, old_state, new_state):
98
- self._document_date()
99
- return True
100
-
101
- def _exec_before_SITUACAO_EDOC_CANCELADA(self, old_state, new_state):
102
- return True
103
-
104
- def _exec_before_SITUACAO_EDOC_DENEGADA(self, old_state, new_state):
105
- return True
106
-
107
- def _exec_before_SITUACAO_EDOC_INUTILIZADA(self, old_state, new_state):
108
- return True
109
-
110
- def _before_change_state(self, old_state, new_state):
111
- """Hook para realizar alterações depois da alteração do estado do doc.
112
-
113
- A variável self.state_edoc já estará com o novo estado neste momento.
114
-
115
- :param old_state:
116
- :param new_state:
117
- :return:
118
- """
119
- self.ensure_one()
120
- if new_state == SITUACAO_EDOC_EM_DIGITACAO:
121
- return self._exec_before_SITUACAO_EDOC_EM_DIGITACAO(old_state, new_state)
122
- elif new_state == SITUACAO_EDOC_A_ENVIAR:
123
- return self._exec_before_SITUACAO_EDOC_A_ENVIAR(old_state, new_state)
124
- elif new_state == SITUACAO_EDOC_ENVIADA:
125
- return self._exec_before_SITUACAO_EDOC_ENVIADA(old_state, new_state)
126
- elif new_state == SITUACAO_EDOC_REJEITADA:
127
- return self._exec_before_SITUACAO_EDOC_REJEITADA(old_state, new_state)
128
- elif new_state == SITUACAO_EDOC_AUTORIZADA:
129
- return self._exec_before_SITUACAO_EDOC_AUTORIZADA(old_state, new_state)
130
- elif new_state == SITUACAO_EDOC_CANCELADA:
131
- return self._exec_before_SITUACAO_EDOC_CANCELADA(old_state, new_state)
132
- elif new_state == SITUACAO_EDOC_DENEGADA:
133
- return self._exec_before_SITUACAO_EDOC_DENEGADA(old_state, new_state)
134
- elif new_state == SITUACAO_EDOC_INUTILIZADA:
135
- return self._exec_before_SITUACAO_EDOC_INUTILIZADA(old_state, new_state)
136
-
137
- def _exec_after_SITUACAO_EDOC_EM_DIGITACAO(self, old_state, new_state):
138
- self.ensure_one()
139
- if self.state_fiscal in SITUACAO_FISCAL_SPED_CONSIDERA_CANCELADO:
140
- raise (
141
- _(
142
- "Não é possível retornar o documento para em \n"
143
- "digitação, quando o mesmo esta na situação: \n"
144
- "%(old_state)s, %(fiscal_state)s",
145
- old_state=old_state,
146
- fiscal_state=self.state_fiscal,
147
- )
148
- )
149
-
150
- def _exec_after_SITUACAO_EDOC_A_ENVIAR(self, old_state, new_state):
151
- self.ensure_one()
152
- if self._direct_draft_send():
153
- self.action_document_send()
154
-
155
- def _exec_after_SITUACAO_EDOC_ENVIADA(self, old_state, new_state):
156
- pass
157
-
158
- def _exec_after_SITUACAO_EDOC_REJEITADA(self, old_state, new_state):
159
- pass
160
-
161
- def _exec_after_SITUACAO_EDOC_AUTORIZADA(self, old_state, new_state):
162
- pass
163
-
164
- def _exec_after_SITUACAO_EDOC_CANCELADA(self, old_state, new_state):
165
- pass
166
-
167
- def _exec_after_SITUACAO_EDOC_DENEGADA(self, old_state, new_state):
168
- pass
169
-
170
- def _exec_after_SITUACAO_EDOC_INUTILIZADA(self, old_state, new_state):
171
- pass
172
-
173
- def _after_change_state(self, old_state, new_state):
174
- """Hook para realizar alterações depois da alteração do estado do doc.
175
-
176
- A variável self.state_edoc já estará com o novo estado neste momento.
177
-
178
- :param old_state:
179
- :param new_state:
180
- :return:
181
- """
182
- self.ensure_one()
183
- if new_state == SITUACAO_EDOC_EM_DIGITACAO:
184
- self._exec_after_SITUACAO_EDOC_EM_DIGITACAO(old_state, new_state)
185
- elif new_state == SITUACAO_EDOC_A_ENVIAR:
186
- self._exec_after_SITUACAO_EDOC_A_ENVIAR(old_state, new_state)
187
- elif new_state == SITUACAO_EDOC_ENVIADA:
188
- self._exec_after_SITUACAO_EDOC_ENVIADA(old_state, new_state)
189
- elif new_state == SITUACAO_EDOC_REJEITADA:
190
- self._exec_after_SITUACAO_EDOC_REJEITADA(old_state, new_state)
191
- elif new_state == SITUACAO_EDOC_AUTORIZADA:
192
- self._exec_after_SITUACAO_EDOC_AUTORIZADA(old_state, new_state)
193
- elif new_state == SITUACAO_EDOC_CANCELADA:
194
- self._exec_after_SITUACAO_EDOC_CANCELADA(old_state, new_state)
195
- elif new_state == SITUACAO_EDOC_DENEGADA:
196
- self._exec_after_SITUACAO_EDOC_DENEGADA(old_state, new_state)
197
- elif new_state == SITUACAO_EDOC_INUTILIZADA:
198
- self._exec_after_SITUACAO_EDOC_INUTILIZADA(old_state, new_state)
199
-
200
- self._generates_subsequent_operations()
201
-
202
- def _change_state(self, new_state, force_change=False):
203
- """Método para alterar o estado do documento fiscal, mantendo a
204
- integridade do workflow da invoice.
205
-
206
- Tenha muito cuidado ao alterar o workflow da invoice manualmente,
207
- prefira alterar o estado do documento fiscal e ele se encarregar de
208
- alterar o estado da invoice.
209
-
210
- :param new_state: Novo estado
211
- :return: status: Status da conclusão da mudança de estado
212
- """
213
-
214
- status = False
215
- for record in self:
216
- old_state = record.state_edoc
217
-
218
- if force_change or record._avaliable_transition(old_state, new_state):
219
- pass
220
- else:
221
- raise UserError(
222
- _(
223
- "Não é possível realizar esta operação,\n"
224
- "esta transição não é permitida:\n\n"
225
- "De: {old_state}\n\n Para: {new_state}"
226
- ).format(old_state=old_state, new_state=new_state)
227
- )
228
-
229
- if record._before_change_state(old_state, new_state):
230
- record.state_edoc = new_state
231
- record._after_change_state(old_state, new_state)
232
- status = True
233
-
234
- return status
235
-
236
- def _document_date(self):
237
- if not self.document_date:
238
- self.document_date = self._date_server_format()
239
- if not self.date_in_out:
240
- self.date_in_out = self._date_server_format()
241
-
242
- def _document_check(self):
243
- return True
244
-
245
- def _generate_key(self):
246
- for record in self:
247
- if record.document_type_id.code in (
248
- MODELO_FISCAL_NFE,
249
- MODELO_FISCAL_NFCE,
250
- MODELO_FISCAL_CTE,
251
- ):
252
- date = fields.Datetime.context_timestamp(record, record.document_date)
253
- chave_edoc = ChaveEdoc(
254
- ano_mes=date.strftime("%y%m").zfill(4),
255
- cnpj_cpf_emitente=record.company_cnpj_cpf,
256
- codigo_uf=(
257
- record.company_state_id
258
- and record.company_state_id.ibge_code
259
- or ""
260
- ),
261
- forma_emissao=1, # TODO: Implementar campo no Odoo
262
- modelo_documento=record.document_type_id.code or "",
263
- numero_documento=record.document_number or "",
264
- numero_serie=record.document_serie or "",
265
- validar=False,
266
- )
267
- # TODO: Implementar campos no Odoo
268
- # record.key_number = chave_edoc.campos
269
- # record.key_formated = ' '.joint(chave_edoc.partes())
270
- record.document_key = chave_edoc.chave
271
-
272
- def _document_number(self):
273
- self.ensure_one()
274
- if self.issuer == DOCUMENT_ISSUER_COMPANY:
275
- if self.document_serie_id:
276
- self.document_serie = self.document_serie_id.code
277
-
278
- if self.document_type == MODELO_FISCAL_NFSE and not self.rps_number:
279
- self.rps_number = self.document_serie_id.next_seq_number()
280
-
281
- if (
282
- self.document_type != MODELO_FISCAL_NFSE
283
- and not self.document_number
284
- ):
285
- self.document_number = self.document_serie_id.next_seq_number()
286
-
287
- if not self.operation_name:
288
- self.operation_name = ", ".join(
289
- [
290
- line.name
291
- for line in self.fiscal_line_ids.mapped("fiscal_operation_id")
292
- ]
293
- )
294
-
295
- if self.document_electronic and not self.document_key:
296
- self._generate_key()
297
-
298
- def _document_confirm(self):
299
- if self.issuer == DOCUMENT_ISSUER_COMPANY:
300
- if not self.comment_ids and self.fiscal_operation_id.comment_ids:
301
- self.comment_ids |= self.fiscal_operation_id.comment_ids
302
-
303
- for line in self.fiscal_line_ids:
304
- if not line.comment_ids and line.fiscal_operation_line_id.comment_ids:
305
- line.comment_ids |= line.fiscal_operation_line_id.comment_ids
306
- self._change_state(SITUACAO_EDOC_A_ENVIAR)
307
- else:
308
- self._change_state(SITUACAO_EDOC_AUTORIZADA)
309
-
310
- def _document_confirm_to_send(self):
311
- to_confirm = self.filtered(lambda inv: inv.state_edoc != SITUACAO_EDOC_A_ENVIAR)
312
- if to_confirm:
313
- to_confirm._document_confirm()
314
-
315
- def action_document_confirm(self):
316
- self._document_confirm_to_send()
317
-
318
- def _no_eletronic_document_send(self):
319
- self._change_state(SITUACAO_EDOC_AUTORIZADA)
320
-
321
- def _document_export(self):
322
- pass
323
-
324
- def action_document_send(self):
325
- to_send = self.filtered(
326
- lambda d: d.state_edoc
327
- in (
328
- SITUACAO_EDOC_A_ENVIAR,
329
- SITUACAO_EDOC_ENVIADA,
330
- SITUACAO_EDOC_REJEITADA,
331
- )
332
- )
333
- if to_send:
334
- to_send._document_send()
335
-
336
- def document_back2draft(self):
337
- self.xml_error_message = False
338
- self.file_report_id = False
339
- if self.issuer == DOCUMENT_ISSUER_COMPANY:
340
- self._change_state(SITUACAO_EDOC_EM_DIGITACAO)
341
- else:
342
- self.state_edoc = SITUACAO_EDOC_EM_DIGITACAO
343
-
344
- def action_document_back2draft(self):
345
- self.document_back2draft()
346
-
347
- def _document_cancel(self, justificative):
348
- self.ensure_one()
349
- self.cancel_reason = justificative
350
- if self._change_state(SITUACAO_EDOC_CANCELADA):
351
- self.cancel_reason = justificative
352
-
353
- def action_document_cancel(self):
354
- self.ensure_one()
355
- if self.issuer == DOCUMENT_ISSUER_COMPANY:
356
- if self.state_edoc == SITUACAO_EDOC_AUTORIZADA:
357
- result = self.env["ir.actions.act_window"]._for_xml_id(
358
- "l10n_br_fiscal.document_cancel_wizard_action"
359
- )
360
- return result
361
- else:
362
- self.state_edoc = SITUACAO_EDOC_CANCELADA
363
-
364
- def action_document_invalidate(self):
365
- self.ensure_one()
366
- if (
367
- self.document_number
368
- and self.document_serie
369
- and self.state_edoc
370
- in (
371
- SITUACAO_EDOC_EM_DIGITACAO,
372
- SITUACAO_EDOC_REJEITADA,
373
- SITUACAO_EDOC_A_ENVIAR,
374
- )
375
- and self.issuer == DOCUMENT_ISSUER_COMPANY
376
- ):
377
- return self.env["ir.actions.act_window"]._for_xml_id(
378
- "l10n_br_fiscal.invalidate_number_wizard_action"
379
- )
380
- else:
381
- raise UserError(_("You cannot invalidate this document"))
382
-
383
- def _document_correction(self, justificative):
384
- self.ensure_one()
385
- self.correction_reason = justificative
386
-
387
- def action_document_correction(self):
388
- self.ensure_one()
389
- if (
390
- self.state_edoc in SITUACAO_EDOC_AUTORIZADA
391
- and self.issuer == DOCUMENT_ISSUER_COMPANY
392
- ):
393
- return self.env["ir.actions.act_window"]._for_xml_id(
394
- "l10n_br_fiscal.document_correction_wizard_action"
395
- )
396
- else:
397
- raise UserError(
398
- _(
399
- "You cannot create a fiscal correction document if "
400
- "this fical document you are not the document issuer"
401
- )
402
- )
@@ -1,118 +0,0 @@
1
- # Copyright (C) 2020 KMEE INFORMATICA LTDA
2
- # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
3
-
4
- from odoo.tests import TransactionCase
5
-
6
- from ..constants.fiscal import (
7
- SITUACAO_EDOC_A_ENVIAR,
8
- SITUACAO_EDOC_AUTORIZADA,
9
- SITUACAO_EDOC_CANCELADA,
10
- SITUACAO_EDOC_EM_DIGITACAO,
11
- SITUACAO_EDOC_REJEITADA,
12
- )
13
-
14
-
15
- class TestWorkflow(TransactionCase):
16
- @classmethod
17
- def setUpClass(cls):
18
- super().setUpClass()
19
- cls.fiscal_document = cls.env["l10n_br_fiscal.document"].create(
20
- {
21
- "document_type_id": cls.env.ref(
22
- "l10n_br_fiscal.document_55_serie_1"
23
- ).id,
24
- "fiscal_operation_type": "out",
25
- }
26
- )
27
-
28
- def test_no_electronic_01_confirm(self):
29
- self.fiscal_document.document_electronic = False
30
- assert (
31
- self.fiscal_document.state_edoc == SITUACAO_EDOC_EM_DIGITACAO
32
- ), "Error with document workflow, state 'SITUACAO_EDOC_A_ENVIAR' "
33
-
34
- self.fiscal_document.action_document_confirm()
35
- assert (
36
- self.fiscal_document.state_edoc == SITUACAO_EDOC_A_ENVIAR
37
- ), "Error with document workflow, state 'SITUACAO_EDOC_A_ENVIAR' "
38
-
39
- self.fiscal_document.action_document_send()
40
- assert (
41
- self.fiscal_document.state_edoc == SITUACAO_EDOC_AUTORIZADA
42
- ), "Error with document workflow, state 'SITUACAO_EDOC_AUTORIZADA' "
43
-
44
- def test_electronic_01_confirm(self):
45
- self.fiscal_document.document_electronic = True
46
-
47
- assert (
48
- self.fiscal_document.state_edoc == SITUACAO_EDOC_EM_DIGITACAO
49
- ), "Error with document workflow, state 'SITUACAO_EDOC_A_ENVIAR' "
50
-
51
- self.fiscal_document.action_document_confirm()
52
- assert (
53
- self.fiscal_document.state_edoc == SITUACAO_EDOC_A_ENVIAR
54
- ), "Error with document workflow, state 'SITUACAO_EDOC_A_ENVIAR' "
55
-
56
- self.fiscal_document.action_document_send()
57
- assert (
58
- self.fiscal_document.state_edoc == SITUACAO_EDOC_AUTORIZADA
59
- ), "Error with document workflow, state 'SITUACAO_EDOC_AUTORIZADA' "
60
-
61
- def test_electronic_01_rejeitada(self):
62
- self.fiscal_document.document_electronic = True
63
-
64
- assert (
65
- self.fiscal_document.state_edoc == SITUACAO_EDOC_EM_DIGITACAO
66
- ), "Error with document workflow, state 'SITUACAO_EDOC_A_ENVIAR' "
67
-
68
- self.fiscal_document.action_document_confirm()
69
- self.fiscal_document._change_state(SITUACAO_EDOC_REJEITADA)
70
-
71
- assert (
72
- self.fiscal_document.state_edoc == SITUACAO_EDOC_REJEITADA
73
- ), "Error with document workflow, state 'SITUACAO_EDOC_REJEITADA' "
74
-
75
- self.fiscal_document.action_document_send()
76
- assert (
77
- self.fiscal_document.state_edoc == SITUACAO_EDOC_AUTORIZADA
78
- ), "Error with document workflow, state 'SITUACAO_EDOC_AUTORIZADA' "
79
-
80
- def test_no_electronic_01_draft_cancel(self):
81
- self.fiscal_document.document_electronic = False
82
-
83
- assert (
84
- self.fiscal_document.state_edoc == SITUACAO_EDOC_EM_DIGITACAO
85
- ), "Error with document workflow, state 'SITUACAO_EDOC_A_ENVIAR' "
86
-
87
- self.fiscal_document._document_cancel("Test")
88
-
89
- assert (
90
- self.fiscal_document.state_edoc == SITUACAO_EDOC_CANCELADA
91
- ), "Error with document workflow, state 'SITUACAO_EDOC_REJEITADA' "
92
-
93
- def test_electronic_01_draft_cancel(self):
94
- self.fiscal_document.document_electronic = True
95
-
96
- assert (
97
- self.fiscal_document.state_edoc == SITUACAO_EDOC_EM_DIGITACAO
98
- ), "Error with document workflow, state 'SITUACAO_EDOC_A_ENVIAR' "
99
-
100
- self.fiscal_document._document_cancel("Test")
101
-
102
- assert (
103
- self.fiscal_document.state_edoc == SITUACAO_EDOC_CANCELADA
104
- ), "Error with document workflow, state 'SITUACAO_EDOC_REJEITADA' "
105
-
106
- def test_electronic_01_back2draft(self):
107
- self.fiscal_document.document_electronic = True
108
-
109
- assert (
110
- self.fiscal_document.state_edoc == SITUACAO_EDOC_EM_DIGITACAO
111
- ), "Error with document workflow, state 'SITUACAO_EDOC_A_ENVIAR' "
112
-
113
- self.fiscal_document.action_document_confirm()
114
- self.fiscal_document.action_document_back2draft()
115
-
116
- assert (
117
- self.fiscal_document.state_edoc == SITUACAO_EDOC_EM_DIGITACAO
118
- ), "Error with document workflow, state 'SITUACAO_EDOC_A_ENVIAR' "
@@ -1,15 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <odoo>
3
- <record id="action_report_document_event" model="ir.actions.report">
4
- <field name="name">Document Event</field>
5
- <field name="model">l10n_br_fiscal.event</field>
6
- <field name="report_type">qweb-pdf</field>
7
- <field name="report_name">l10n_br_fiscal.main_report_document_event</field>
8
- <field name="report_file">l10n_br_fiscal.report_document_event</field>
9
- <field
10
- name="print_report_name"
11
- >dict(object.fields_get(allfields=['type'])['type']['selection'])[object.type]</field>
12
- <field name="binding_model_id" ref="model_l10n_br_fiscal_event" />
13
- <field name="binding_type">report</field>
14
- </record>
15
- </odoo>
@@ -1,114 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <odoo>
3
- <template id="report_document_event">
4
- <t t-set="o" t-value="doc" />
5
- <t t-set="o" t-value="o.with_context(lang=o.document_id.partner_id.lang)" />
6
- <div class="page" style="font-size:16px;">
7
- <style type="text/css">
8
- .col-1,
9
- .col-2,
10
- .col-3,
11
- .col-4,
12
- .col-5,
13
- .col-6,
14
- .col-7,
15
- .col-8,
16
- .col-9,
17
- .col-10,
18
- .col-11,
19
- .col-12 {
20
- padding: 5px 5px 5px 5px;
21
- }
22
- .bt {
23
- border-top: 1px solid black;
24
- }
25
- .bb {
26
- border-bottom: 1px solid black;
27
- }
28
- .bl {
29
- border-left: 1px solid black;
30
- }
31
- .br {
32
- border-right: 1px solid black;
33
- }
34
- row {
35
- cols: 10;
36
- }
37
- </style>
38
-
39
- <div class="oe_structure" />
40
-
41
- <div id="header" class="row bt bb bl br">
42
- <div class="col-12" style="text-align: center; font-size: 36px;">
43
- <span t-field="o.type" />
44
- </div>
45
- </div>
46
- <div class="row bb bl br">
47
- <div id="document_key" class="col-6">
48
- <strong style="font-size:18px;">Document Key:</strong>
49
- <p t-field="o.document_id.document_key" />
50
- </div>
51
- <div id="company_cnpj_cpf" class="col-6 bl">
52
- <strong style="font-size:18px;">CNPJ:</strong>
53
- <p t-field="o.document_id.company_cnpj_cpf" />
54
- </div>
55
- </div>
56
- <div class="row bb bl br">
57
- <div id="document_number" class="col-3">
58
- <strong style="font-size:18px;">Document Number:</strong>
59
- <p t-field="o.document_number" />
60
- </div>
61
- <div id="document_serie_code" class="col-3 bl">
62
- <strong style="font-size:18px;">Document Serie:</strong>
63
- <p t-field="o.document_serie_id.code" />
64
- </div>
65
- <div id="environment" class="col-6 bl">
66
- <strong style="font-size:18px;">Environment:</strong>
67
- <p t-field="o.environment" />
68
- </div>
69
- </div>
70
- <div class="row bb bl br">
71
- <div id="protocol_number" class="col-6">
72
- <strong style="font-size:18px;">Protocol Number:</strong>
73
- <p t-field="o.protocol_number" />
74
- </div>
75
- <div id="protocol_date" class="col-6 bl">
76
- <strong style="font-size:18px;">Protocol Date:</strong>
77
- <p t-field="o.protocol_date" />
78
- </div>
79
- </div>
80
- <div id="justification" class="row bb bl br">
81
- <div class="col-12" t-if="o.justification">
82
- <strong style="font-size:18px;">Justification:</strong>
83
- <p t-field="o.justification" />
84
- </div>
85
- </div>
86
- <div id="cce_notes" class="row bb bl br">
87
- <div class="col-12" style="font-size:10px;" t-if="o.type == '14'">
88
- A Carta de Correção é disciplinada pelo parágrafo 1o-A do artigo 7o do Convênio S/N, de 15 de dezembro de 1970 e pode ser utilizada para regularização de erro ocorrido na emissão de documento fiscal, desde que o erro não seja relacionado com:<br
89
- />
90
- <br />
91
- I - as variáveis que determinam o valor do imposto tais como: base de cálculo, alíquota, diferença de preço, quantidade, valor da operação ou da prestação;<br
92
- />
93
- II - a correção de dados cadastrais que impliquem mudança do remetente ou do destinatário;<br
94
- />
95
- III - a data de emissão ou de saída.<br />
96
- </div>
97
- </div>
98
- </div>
99
- </template>
100
-
101
- <template id="main_report_document_event">
102
- <t t-call="web.html_container">
103
- <div class="article">
104
- <t t-foreach="docs" t-as="doc">
105
- <t
106
- t-call="l10n_br_fiscal.report_document_event"
107
- t-lang="doc.document_id.partner_id.lang"
108
- />
109
- </t>
110
- </div>
111
- </t>
112
- </template>
113
-
114
- </odoo>