odoo-addon-l10n-es-vat-book 15.0.2.3.0__py3-none-any.whl → 17.0.1.3.5__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-es-vat-book might be problematic. Click here for more details.
- odoo/addons/l10n_es_vat_book/README.rst +60 -52
- odoo/addons/l10n_es_vat_book/__manifest__.py +14 -4
- odoo/addons/l10n_es_vat_book/data/aeat.vat.book.map.line.csv +6 -0
- odoo/addons/l10n_es_vat_book/data/l10n.es.aeat.map.tax.line.account.csv +2 -0
- odoo/addons/l10n_es_vat_book/data/l10n.es.aeat.map.tax.line.tax.csv +106 -0
- odoo/addons/l10n_es_vat_book/i18n/bg.po +33 -60
- odoo/addons/l10n_es_vat_book/i18n/ca.po +76 -70
- odoo/addons/l10n_es_vat_book/i18n/cs.po +33 -60
- odoo/addons/l10n_es_vat_book/i18n/de.po +29 -59
- odoo/addons/l10n_es_vat_book/i18n/es.po +80 -74
- odoo/addons/l10n_es_vat_book/i18n/es_CO.po +33 -60
- odoo/addons/l10n_es_vat_book/i18n/es_CR.po +29 -59
- odoo/addons/l10n_es_vat_book/i18n/eu.po +33 -60
- odoo/addons/l10n_es_vat_book/i18n/fr.po +33 -60
- odoo/addons/l10n_es_vat_book/i18n/gl.po +33 -60
- odoo/addons/l10n_es_vat_book/i18n/hr.po +35 -62
- odoo/addons/l10n_es_vat_book/i18n/l10n_es_vat_book.pot +30 -59
- odoo/addons/l10n_es_vat_book/i18n/nl.po +33 -60
- odoo/addons/l10n_es_vat_book/i18n/pl.po +36 -63
- odoo/addons/l10n_es_vat_book/i18n/pt.po +33 -60
- odoo/addons/l10n_es_vat_book/i18n/pt_BR.po +33 -60
- odoo/addons/l10n_es_vat_book/i18n/ru.po +32 -62
- odoo/addons/l10n_es_vat_book/i18n/sl.po +39 -65
- odoo/addons/l10n_es_vat_book/i18n/sv.po +33 -60
- odoo/addons/l10n_es_vat_book/i18n/tr.po +33 -60
- odoo/addons/l10n_es_vat_book/i18n/vi.po +33 -60
- odoo/addons/l10n_es_vat_book/models/aeat_vat_book_map_line.py +22 -7
- odoo/addons/l10n_es_vat_book/models/l10n_es_vat_book.py +92 -65
- odoo/addons/l10n_es_vat_book/models/l10n_es_vat_book_line.py +0 -1
- odoo/addons/l10n_es_vat_book/models/l10n_es_vat_book_line_tax.py +24 -2
- odoo/addons/l10n_es_vat_book/models/l10n_es_vat_book_summary.py +3 -3
- odoo/addons/l10n_es_vat_book/models/l10n_es_vat_book_tax_summary.py +14 -0
- odoo/addons/l10n_es_vat_book/readme/CONFIGURE.md +6 -0
- odoo/addons/l10n_es_vat_book/readme/CONTRIBUTORS.md +12 -0
- odoo/addons/l10n_es_vat_book/readme/{DESCRIPTION.rst → DESCRIPTION.md} +6 -6
- odoo/addons/l10n_es_vat_book/readme/INSTALL.md +16 -0
- odoo/addons/l10n_es_vat_book/readme/ROADMAP.md +5 -0
- odoo/addons/l10n_es_vat_book/readme/USAGE.md +5 -0
- odoo/addons/l10n_es_vat_book/report/vat_book_xlsx.py +12 -12
- odoo/addons/l10n_es_vat_book/static/description/index.html +56 -45
- odoo/addons/l10n_es_vat_book/tests/test_l10n_es_aeat_vat_book.py +24 -8
- odoo/addons/l10n_es_vat_book/views/aeat_vat_book_map_view.xml +3 -2
- odoo/addons/l10n_es_vat_book/views/l10n_es_vat_book.xml +20 -23
- odoo/addons/l10n_es_vat_book/views/l10n_es_vat_book_line.xml +39 -46
- odoo/addons/l10n_es_vat_book/views/l10n_es_vat_book_tax_summary.xml +17 -0
- {odoo_addon_l10n_es_vat_book-15.0.2.3.0.dist-info → odoo_addon_l10n_es_vat_book-17.0.1.3.5.dist-info}/METADATA +69 -63
- odoo_addon_l10n_es_vat_book-17.0.1.3.5.dist-info/RECORD +62 -0
- {odoo_addon_l10n_es_vat_book-15.0.2.3.0.dist-info → odoo_addon_l10n_es_vat_book-17.0.1.3.5.dist-info}/WHEEL +1 -1
- odoo_addon_l10n_es_vat_book-17.0.1.3.5.dist-info/top_level.txt +1 -0
- odoo/addons/l10n_es_vat_book/data/aeat_vat_book_map_data.xml +0 -121
- odoo/addons/l10n_es_vat_book/readme/CONFIGURE.rst +0 -6
- odoo/addons/l10n_es_vat_book/readme/CONTRIBUTORS.rst +0 -12
- odoo/addons/l10n_es_vat_book/readme/INSTALL.rst +0 -18
- odoo/addons/l10n_es_vat_book/readme/ROADMAP.rst +0 -4
- odoo/addons/l10n_es_vat_book/readme/USAGE.rst +0 -5
- odoo_addon_l10n_es_vat_book-15.0.2.3.0.dist-info/RECORD +0 -60
- odoo_addon_l10n_es_vat_book-15.0.2.3.0.dist-info/top_level.txt +0 -1
|
@@ -318,13 +318,11 @@ msgstr ""
|
|
|
318
318
|
|
|
319
319
|
#. module: l10n_es_vat_book
|
|
320
320
|
#: model:ir.model.fields,help:l10n_es_vat_book.field_l10n_es_vat_book__message_needaction
|
|
321
|
-
#: model:ir.model.fields,help:l10n_es_vat_book.field_l10n_es_vat_book__message_unread
|
|
322
321
|
msgid "If checked, new messages require your attention."
|
|
323
322
|
msgstr ""
|
|
324
323
|
|
|
325
324
|
#. module: l10n_es_vat_book
|
|
326
325
|
#: model:ir.model.fields,help:l10n_es_vat_book.field_l10n_es_vat_book__message_has_error
|
|
327
|
-
#: model:ir.model.fields,help:l10n_es_vat_book.field_l10n_es_vat_book__message_has_sms_error
|
|
328
326
|
msgid "If checked, some messages have a delivery error."
|
|
329
327
|
msgstr ""
|
|
330
328
|
|
|
@@ -402,19 +400,19 @@ msgid "Journal in which post the move."
|
|
|
402
400
|
msgstr ""
|
|
403
401
|
|
|
404
402
|
#. module: l10n_es_vat_book
|
|
405
|
-
#: model:ir.model.fields,field_description:l10n_es_vat_book.
|
|
406
|
-
msgid "
|
|
403
|
+
#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_tax_summary__move_line_ids
|
|
404
|
+
msgid "Journal items"
|
|
407
405
|
msgstr ""
|
|
408
406
|
|
|
409
407
|
#. module: l10n_es_vat_book
|
|
410
|
-
#: model:ir.model.fields,field_description:l10n_es_vat_book.
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
#: model:ir.model.fields,field_description:l10n_es_vat_book.
|
|
416
|
-
msgid "
|
|
417
|
-
msgstr "
|
|
408
|
+
#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_tax_summary__base_move_line_ids
|
|
409
|
+
msgid "Journal items (Base)"
|
|
410
|
+
msgstr ""
|
|
411
|
+
|
|
412
|
+
#. module: l10n_es_vat_book
|
|
413
|
+
#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book__representative_vat
|
|
414
|
+
msgid "L.R. VAT number"
|
|
415
|
+
msgstr ""
|
|
418
416
|
|
|
419
417
|
#. module: l10n_es_vat_book
|
|
420
418
|
#: model:ir.model.fields,field_description:l10n_es_vat_book.field_aeat_vat_book_map_line__write_uid
|
|
@@ -451,11 +449,6 @@ msgstr ""
|
|
|
451
449
|
msgid "Line Type"
|
|
452
450
|
msgstr ""
|
|
453
451
|
|
|
454
|
-
#. module: l10n_es_vat_book
|
|
455
|
-
#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book__message_main_attachment_id
|
|
456
|
-
msgid "Main Attachment"
|
|
457
|
-
msgstr ""
|
|
458
|
-
|
|
459
452
|
#. module: l10n_es_vat_book
|
|
460
453
|
#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book__message_has_error
|
|
461
454
|
msgid "Message Delivery error"
|
|
@@ -466,11 +459,6 @@ msgstr ""
|
|
|
466
459
|
msgid "Messages"
|
|
467
460
|
msgstr ""
|
|
468
461
|
|
|
469
|
-
#. module: l10n_es_vat_book
|
|
470
|
-
#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book__model_id
|
|
471
|
-
msgid "Model"
|
|
472
|
-
msgstr ""
|
|
473
|
-
|
|
474
462
|
#. module: l10n_es_vat_book
|
|
475
463
|
#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book__number
|
|
476
464
|
msgid "Model number"
|
|
@@ -482,6 +470,11 @@ msgstr ""
|
|
|
482
470
|
msgid "Move Lines"
|
|
483
471
|
msgstr ""
|
|
484
472
|
|
|
473
|
+
#. module: l10n_es_vat_book
|
|
474
|
+
#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_line_tax__base_move_line_ids
|
|
475
|
+
msgid "Move Lines (Base)"
|
|
476
|
+
msgstr ""
|
|
477
|
+
|
|
485
478
|
#. module: l10n_es_vat_book
|
|
486
479
|
#: model:ir.model.fields,help:l10n_es_vat_book.field_l10n_es_vat_book__contact_name
|
|
487
480
|
msgid "Must have name and surname."
|
|
@@ -534,7 +527,7 @@ msgstr ""
|
|
|
534
527
|
|
|
535
528
|
#. module: l10n_es_vat_book
|
|
536
529
|
#: model:ir.model.fields,help:l10n_es_vat_book.field_l10n_es_vat_book__message_needaction_counter
|
|
537
|
-
msgid "Number of messages
|
|
530
|
+
msgid "Number of messages requiring action"
|
|
538
531
|
msgstr ""
|
|
539
532
|
|
|
540
533
|
#. module: l10n_es_vat_book
|
|
@@ -542,11 +535,6 @@ msgstr ""
|
|
|
542
535
|
msgid "Number of messages with delivery error"
|
|
543
536
|
msgstr ""
|
|
544
537
|
|
|
545
|
-
#. module: l10n_es_vat_book
|
|
546
|
-
#: model:ir.model.fields,help:l10n_es_vat_book.field_l10n_es_vat_book__message_unread_counter
|
|
547
|
-
msgid "Number of unread messages"
|
|
548
|
-
msgstr ""
|
|
549
|
-
|
|
550
538
|
#. module: l10n_es_vat_book
|
|
551
539
|
#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book__partner_id
|
|
552
540
|
msgid "Partner"
|
|
@@ -635,8 +623,8 @@ msgid "Responsible User"
|
|
|
635
623
|
msgstr ""
|
|
636
624
|
|
|
637
625
|
#. module: l10n_es_vat_book
|
|
638
|
-
#:
|
|
639
|
-
msgid "
|
|
626
|
+
#: model_terms:ir.ui.view,arch_db:l10n_es_vat_book.view_vat_book_tax_summary_tree
|
|
627
|
+
msgid "Show journal items"
|
|
640
628
|
msgstr ""
|
|
641
629
|
|
|
642
630
|
#. module: l10n_es_vat_book
|
|
@@ -743,10 +731,16 @@ msgid "Tax"
|
|
|
743
731
|
msgstr ""
|
|
744
732
|
|
|
745
733
|
#. module: l10n_es_vat_book
|
|
746
|
-
#: model:ir.model.fields,field_description:l10n_es_vat_book.
|
|
734
|
+
#: model:ir.model.fields,field_description:l10n_es_vat_book.field_aeat_vat_book_map_line__account_xmlid_id
|
|
747
735
|
msgid "Tax Account Restriction"
|
|
748
736
|
msgstr ""
|
|
749
737
|
|
|
738
|
+
#. module: l10n_es_vat_book
|
|
739
|
+
#: model:ir.model.fields,field_description:l10n_es_vat_book.field_aeat_vat_book_map_line__tax_agency_ids
|
|
740
|
+
#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book__tax_agency_ids
|
|
741
|
+
msgid "Tax Agency"
|
|
742
|
+
msgstr ""
|
|
743
|
+
|
|
750
744
|
#. module: l10n_es_vat_book
|
|
751
745
|
#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_summary__tax_amount
|
|
752
746
|
#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book_tax_summary__tax_amount
|
|
@@ -775,7 +769,7 @@ msgid "Tax fee"
|
|
|
775
769
|
msgstr ""
|
|
776
770
|
|
|
777
771
|
#. module: l10n_es_vat_book
|
|
778
|
-
#: model:ir.model.fields,field_description:l10n_es_vat_book.
|
|
772
|
+
#: model:ir.model.fields,field_description:l10n_es_vat_book.field_aeat_vat_book_map_line__tax_xmlid_ids
|
|
779
773
|
#: model_terms:ir.ui.view,arch_db:l10n_es_vat_book.view_vat_book_line_form
|
|
780
774
|
msgid "Taxes"
|
|
781
775
|
msgstr ""
|
|
@@ -788,12 +782,14 @@ msgid ""
|
|
|
788
782
|
msgstr ""
|
|
789
783
|
|
|
790
784
|
#. module: l10n_es_vat_book
|
|
785
|
+
#. odoo-python
|
|
791
786
|
#: code:addons/l10n_es_vat_book/models/l10n_es_vat_book.py:0
|
|
792
787
|
#, python-format
|
|
793
788
|
msgid "This book has warnings. Fix it before confirm"
|
|
794
789
|
msgstr ""
|
|
795
790
|
|
|
796
791
|
#. module: l10n_es_vat_book
|
|
792
|
+
#. odoo-python
|
|
797
793
|
#: code:addons/l10n_es_vat_book/models/l10n_es_vat_book.py:0
|
|
798
794
|
#, python-format
|
|
799
795
|
msgid "This company doesn't have VAT"
|
|
@@ -829,16 +825,6 @@ msgstr ""
|
|
|
829
825
|
msgid "Type xlsx column"
|
|
830
826
|
msgstr ""
|
|
831
827
|
|
|
832
|
-
#. module: l10n_es_vat_book
|
|
833
|
-
#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book__message_unread
|
|
834
|
-
msgid "Unread Messages"
|
|
835
|
-
msgstr ""
|
|
836
|
-
|
|
837
|
-
#. module: l10n_es_vat_book
|
|
838
|
-
#: model:ir.model.fields,field_description:l10n_es_vat_book.field_l10n_es_vat_book__message_unread_counter
|
|
839
|
-
msgid "Unread Messages Counter"
|
|
840
|
-
msgstr ""
|
|
841
|
-
|
|
842
828
|
#. module: l10n_es_vat_book
|
|
843
829
|
#: model_terms:ir.ui.view,arch_db:l10n_es_vat_book.vat_book_invoices_head
|
|
844
830
|
msgid "VAT"
|
|
@@ -914,12 +900,14 @@ msgid "Website communication history"
|
|
|
914
900
|
msgstr ""
|
|
915
901
|
|
|
916
902
|
#. module: l10n_es_vat_book
|
|
903
|
+
#. odoo-python
|
|
917
904
|
#: code:addons/l10n_es_vat_book/models/l10n_es_vat_book.py:0
|
|
918
905
|
#, python-format
|
|
919
906
|
msgid "Without Partner"
|
|
920
907
|
msgstr ""
|
|
921
908
|
|
|
922
909
|
#. module: l10n_es_vat_book
|
|
910
|
+
#. odoo-python
|
|
923
911
|
#: code:addons/l10n_es_vat_book/models/l10n_es_vat_book.py:0
|
|
924
912
|
#, python-format
|
|
925
913
|
msgid "Without VAT"
|
|
@@ -930,25 +918,10 @@ msgstr ""
|
|
|
930
918
|
msgid "Year"
|
|
931
919
|
msgstr ""
|
|
932
920
|
|
|
933
|
-
#. module: l10n_es_vat_book
|
|
934
|
-
#: model_terms:ir.ui.view,arch_db:l10n_es_vat_book.view_l10n_es_vat_book_form
|
|
935
|
-
msgid "You have"
|
|
936
|
-
msgstr ""
|
|
937
|
-
|
|
938
|
-
#. module: l10n_es_vat_book
|
|
939
|
-
#: model_terms:ir.ui.view,arch_db:l10n_es_vat_book.view_l10n_es_vat_book_form
|
|
940
|
-
msgid "errors"
|
|
941
|
-
msgstr ""
|
|
942
|
-
|
|
943
|
-
#. module: l10n_es_vat_book
|
|
944
|
-
#: model_terms:ir.ui.view,arch_db:l10n_es_vat_book.view_l10n_es_vat_book_form
|
|
945
|
-
msgid ""
|
|
946
|
-
"in this report.\n"
|
|
947
|
-
" You will not be able to <strong>confirm and submit</"
|
|
948
|
-
"strong> it until they are resolved."
|
|
949
|
-
msgstr ""
|
|
950
|
-
|
|
951
921
|
#. module: l10n_es_vat_book
|
|
952
922
|
#: model:ir.actions.report,print_report_name:l10n_es_vat_book.l10n_es_vat_book_xlsx
|
|
953
923
|
msgid "object.get_report_file_name()"
|
|
954
924
|
msgstr ""
|
|
925
|
+
|
|
926
|
+
#~ msgid "Last Modified on"
|
|
927
|
+
#~ msgstr "Sửa lần cuối vào"
|
|
@@ -24,15 +24,30 @@ class AeatVatBookMapLines(models.Model):
|
|
|
24
24
|
)
|
|
25
25
|
fee_type_xlsx_column = fields.Char(string="Type xlsx column")
|
|
26
26
|
fee_amount_xlsx_column = fields.Char(string="Base xlsx column")
|
|
27
|
-
|
|
28
|
-
comodel_name="
|
|
29
|
-
string="Taxes",
|
|
27
|
+
tax_xmlid_ids = fields.Many2many(
|
|
28
|
+
comodel_name="l10n.es.aeat.map.tax.line.tax", string="Taxes"
|
|
30
29
|
)
|
|
31
|
-
|
|
32
|
-
comodel_name="
|
|
30
|
+
account_xmlid_id = fields.Many2one(
|
|
31
|
+
comodel_name="l10n.es.aeat.map.tax.line.account",
|
|
33
32
|
string="Tax Account Restriction",
|
|
34
33
|
)
|
|
34
|
+
tax_agency_ids = fields.Many2many("aeat.tax.agency", string="Tax Agency")
|
|
35
35
|
|
|
36
|
-
def
|
|
36
|
+
def get_taxes_for_company(self, company):
|
|
37
|
+
"""Obtain the taxes corresponding to this line according the given company."""
|
|
37
38
|
self.ensure_one()
|
|
38
|
-
|
|
39
|
+
tax_ids = set()
|
|
40
|
+
for tax_xmlid in self.tax_xmlid_ids:
|
|
41
|
+
tax_id = company._get_tax_id_from_xmlid(tax_xmlid.name)
|
|
42
|
+
if tax_id:
|
|
43
|
+
tax_ids.add(tax_id)
|
|
44
|
+
return self.env["account.tax"].browse(list(tax_ids))
|
|
45
|
+
|
|
46
|
+
def get_accounts_for_company(self, company):
|
|
47
|
+
"""Obtain the accounts corresponding to the line according the given company."""
|
|
48
|
+
self.ensure_one()
|
|
49
|
+
account_ids = set()
|
|
50
|
+
account_id = company._get_account_id_from_xmlid(self.account_xmlid_id.name)
|
|
51
|
+
if account_id:
|
|
52
|
+
account_ids.add(account_id)
|
|
53
|
+
return self.env["account.account"].browse(list(account_ids))
|
|
@@ -20,14 +20,14 @@ class L10nEsVatBook(models.Model):
|
|
|
20
20
|
_aeat_number = "LIVA"
|
|
21
21
|
_period_yearly = True
|
|
22
22
|
|
|
23
|
-
number = fields.Char(default="vat_book", readonly=
|
|
23
|
+
number = fields.Char(default="vat_book", readonly=True)
|
|
24
24
|
|
|
25
25
|
line_ids = fields.One2many(
|
|
26
26
|
comodel_name="l10n.es.vat.book.line",
|
|
27
27
|
inverse_name="vat_book_id",
|
|
28
28
|
string="Issued/Received invoices",
|
|
29
29
|
copy=False,
|
|
30
|
-
readonly=
|
|
30
|
+
readonly=True,
|
|
31
31
|
)
|
|
32
32
|
|
|
33
33
|
issued_line_ids = fields.One2many(
|
|
@@ -36,7 +36,7 @@ class L10nEsVatBook(models.Model):
|
|
|
36
36
|
domain=[("line_type", "=", "issued")],
|
|
37
37
|
string="Issued invoices",
|
|
38
38
|
copy=False,
|
|
39
|
-
readonly=
|
|
39
|
+
readonly=True,
|
|
40
40
|
)
|
|
41
41
|
|
|
42
42
|
rectification_issued_line_ids = fields.One2many(
|
|
@@ -45,7 +45,7 @@ class L10nEsVatBook(models.Model):
|
|
|
45
45
|
domain=[("line_type", "=", "rectification_issued")],
|
|
46
46
|
string="Issued Refund Invoices",
|
|
47
47
|
copy=False,
|
|
48
|
-
readonly=
|
|
48
|
+
readonly=True,
|
|
49
49
|
)
|
|
50
50
|
|
|
51
51
|
received_line_ids = fields.One2many(
|
|
@@ -54,7 +54,7 @@ class L10nEsVatBook(models.Model):
|
|
|
54
54
|
domain=[("line_type", "=", "received")],
|
|
55
55
|
string="Received invoices",
|
|
56
56
|
copy=False,
|
|
57
|
-
readonly=
|
|
57
|
+
readonly=True,
|
|
58
58
|
)
|
|
59
59
|
|
|
60
60
|
rectification_received_line_ids = fields.One2many(
|
|
@@ -63,7 +63,7 @@ class L10nEsVatBook(models.Model):
|
|
|
63
63
|
domain=[("line_type", "=", "rectification_received")],
|
|
64
64
|
string="Received Refund Invoices",
|
|
65
65
|
copy=False,
|
|
66
|
-
readonly=
|
|
66
|
+
readonly=True,
|
|
67
67
|
)
|
|
68
68
|
|
|
69
69
|
calculation_date = fields.Date()
|
|
@@ -72,7 +72,7 @@ class L10nEsVatBook(models.Model):
|
|
|
72
72
|
comodel_name="l10n.es.vat.book.tax.summary",
|
|
73
73
|
string="Tax Summary",
|
|
74
74
|
inverse_name="vat_book_id",
|
|
75
|
-
readonly=
|
|
75
|
+
readonly=True,
|
|
76
76
|
)
|
|
77
77
|
|
|
78
78
|
issued_tax_summary_ids = fields.One2many(
|
|
@@ -80,7 +80,7 @@ class L10nEsVatBook(models.Model):
|
|
|
80
80
|
string="Issued Tax Summary",
|
|
81
81
|
inverse_name="vat_book_id",
|
|
82
82
|
domain=[("book_type", "=", "issued")],
|
|
83
|
-
readonly=
|
|
83
|
+
readonly=True,
|
|
84
84
|
)
|
|
85
85
|
|
|
86
86
|
received_tax_summary_ids = fields.One2many(
|
|
@@ -88,14 +88,14 @@ class L10nEsVatBook(models.Model):
|
|
|
88
88
|
string="Received Tax Summary",
|
|
89
89
|
inverse_name="vat_book_id",
|
|
90
90
|
domain=[("book_type", "=", "received")],
|
|
91
|
-
readonly=
|
|
91
|
+
readonly=True,
|
|
92
92
|
)
|
|
93
93
|
|
|
94
94
|
summary_ids = fields.One2many(
|
|
95
95
|
comodel_name="l10n.es.vat.book.summary",
|
|
96
96
|
string="Summary",
|
|
97
97
|
inverse_name="vat_book_id",
|
|
98
|
-
readonly=
|
|
98
|
+
readonly=True,
|
|
99
99
|
)
|
|
100
100
|
|
|
101
101
|
issued_summary_ids = fields.One2many(
|
|
@@ -103,7 +103,7 @@ class L10nEsVatBook(models.Model):
|
|
|
103
103
|
string="Issued Summary",
|
|
104
104
|
inverse_name="vat_book_id",
|
|
105
105
|
domain=[("book_type", "=", "issued")],
|
|
106
|
-
readonly=
|
|
106
|
+
readonly=True,
|
|
107
107
|
)
|
|
108
108
|
|
|
109
109
|
received_summary_ids = fields.One2many(
|
|
@@ -111,11 +111,11 @@ class L10nEsVatBook(models.Model):
|
|
|
111
111
|
string="Received Summary",
|
|
112
112
|
inverse_name="vat_book_id",
|
|
113
113
|
domain=[("book_type", "=", "received")],
|
|
114
|
-
readonly=
|
|
114
|
+
readonly=True,
|
|
115
115
|
)
|
|
116
116
|
|
|
117
117
|
auto_renumber = fields.Boolean(
|
|
118
|
-
"Auto renumber invoices received",
|
|
118
|
+
"Auto renumber invoices received",
|
|
119
119
|
)
|
|
120
120
|
|
|
121
121
|
error_count = fields.Integer(
|
|
@@ -150,6 +150,8 @@ class L10nEsVatBook(models.Model):
|
|
|
150
150
|
"tax_id": tax_line.tax_id.id,
|
|
151
151
|
"vat_book_id": self.id,
|
|
152
152
|
"special_tax_group": tax_line.special_tax_group,
|
|
153
|
+
"base_move_line_ids": tax_line.base_move_line_ids.ids,
|
|
154
|
+
"move_line_ids": tax_line.move_line_ids.ids,
|
|
153
155
|
}
|
|
154
156
|
tax_summary_data_recs[tax_line.tax_id][
|
|
155
157
|
"base_amount"
|
|
@@ -158,6 +160,12 @@ class L10nEsVatBook(models.Model):
|
|
|
158
160
|
tax_summary_data_recs[tax_line.tax_id][
|
|
159
161
|
"total_amount"
|
|
160
162
|
] += tax_line.total_amount
|
|
163
|
+
tax_summary_data_recs[tax_line.tax_id][
|
|
164
|
+
"base_move_line_ids"
|
|
165
|
+
] += tax_line.base_move_line_ids.ids
|
|
166
|
+
tax_summary_data_recs[tax_line.tax_id][
|
|
167
|
+
"move_line_ids"
|
|
168
|
+
] += tax_line.move_line_ids.ids
|
|
161
169
|
return tax_summary_data_recs
|
|
162
170
|
|
|
163
171
|
@api.model
|
|
@@ -222,14 +230,16 @@ class L10nEsVatBook(models.Model):
|
|
|
222
230
|
ext_ref = ""
|
|
223
231
|
invoice = move_line.move_id
|
|
224
232
|
partner = move_line.partner_id
|
|
233
|
+
invoice_date = move_line.date
|
|
225
234
|
if invoice:
|
|
226
235
|
if invoice.is_invoice():
|
|
227
236
|
partner = invoice.commercial_partner_id
|
|
237
|
+
invoice_date = invoice.invoice_date
|
|
228
238
|
ref = invoice.name
|
|
229
239
|
ext_ref = invoice.ref
|
|
230
240
|
return {
|
|
231
241
|
"line_type": line_type,
|
|
232
|
-
"invoice_date":
|
|
242
|
+
"invoice_date": invoice_date,
|
|
233
243
|
"partner_id": partner.id,
|
|
234
244
|
"vat_number": partner.vat,
|
|
235
245
|
"move_id": invoice.id,
|
|
@@ -249,28 +259,31 @@ class L10nEsVatBook(models.Model):
|
|
|
249
259
|
balance if move_line.tax_ids and not move_line.tax_line_id else 0.0
|
|
250
260
|
)
|
|
251
261
|
fee_amount_untaxed = balance if move_line.tax_line_id else 0.0
|
|
252
|
-
|
|
262
|
+
vals = {
|
|
253
263
|
"tax_id": move_line.tax_line_id.id,
|
|
254
264
|
"base_amount": base_amount_untaxed,
|
|
255
265
|
"tax_amount": fee_amount_untaxed,
|
|
256
|
-
"
|
|
257
|
-
"move_line_ids": [
|
|
266
|
+
"base_move_line_ids": [],
|
|
267
|
+
"move_line_ids": [],
|
|
258
268
|
"special_tax_group": False,
|
|
259
269
|
}
|
|
270
|
+
if move_line.tax_ids:
|
|
271
|
+
vals["base_move_line_ids"].append((4, move_line.id))
|
|
272
|
+
elif move_line.tax_line_id:
|
|
273
|
+
vals["move_line_ids"].append((4, move_line.id))
|
|
274
|
+
return vals
|
|
260
275
|
|
|
261
276
|
def upsert_book_line_tax(self, move_line, vat_book_line, implied_taxes):
|
|
262
277
|
vals = self._prepare_book_line_tax_vals(move_line, vat_book_line)
|
|
263
278
|
tax_lines = vat_book_line["tax_lines"]
|
|
264
|
-
implied_lines = []
|
|
265
279
|
if move_line.tax_line_id:
|
|
266
280
|
key = self.get_book_line_tax_key(move_line, move_line.tax_line_id)
|
|
267
281
|
if key not in tax_lines:
|
|
268
|
-
tax_lines[key] = vals
|
|
282
|
+
tax_lines[key] = vals
|
|
269
283
|
else:
|
|
284
|
+
tax_lines[key]["tax_id"] = move_line.tax_line_id.id
|
|
270
285
|
tax_lines[key]["tax_amount"] += vals["tax_amount"]
|
|
271
|
-
tax_lines[key]["total_amount"] += vals["total_amount"]
|
|
272
286
|
tax_lines[key]["move_line_ids"] += vals["move_line_ids"]
|
|
273
|
-
implied_lines.append(tax_lines[key])
|
|
274
287
|
for i, tax in enumerate(move_line.tax_ids):
|
|
275
288
|
if i == 0:
|
|
276
289
|
vat_book_line["base_amount"] += vals["base_amount"]
|
|
@@ -282,31 +295,9 @@ class L10nEsVatBook(models.Model):
|
|
|
282
295
|
tax_lines[key]["tax_id"] = tax.id
|
|
283
296
|
else:
|
|
284
297
|
tax_lines[key]["base_amount"] += vals["base_amount"]
|
|
285
|
-
tax_lines[key]["
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
implied_lines.append(tax_lines[key])
|
|
289
|
-
sp_taxes_dic = self.get_special_taxes_dic()
|
|
290
|
-
if tax.id in sp_taxes_dic:
|
|
291
|
-
tax_group = sp_taxes_dic[tax.id]["special_tax_group"]
|
|
292
|
-
vat_book_line["special_tax_group"] = tax_group
|
|
293
|
-
tax_lines[key]["special_tax_group"] = tax_group
|
|
294
|
-
if vat_book_line["special_tax_group"]:
|
|
295
|
-
base_line = next(
|
|
296
|
-
filter(lambda l: not l["special_tax_group"], implied_lines), None
|
|
297
|
-
)
|
|
298
|
-
special_line = next(
|
|
299
|
-
filter(lambda l: l["special_tax_group"], implied_lines), None
|
|
300
|
-
)
|
|
301
|
-
if base_line and special_line:
|
|
302
|
-
base_line.update(
|
|
303
|
-
{
|
|
304
|
-
"special_tax_id": special_line["tax_id"],
|
|
305
|
-
"special_tax_amount": special_line["tax_amount"],
|
|
306
|
-
"total_amount_special_include": base_line["total_amount"]
|
|
307
|
-
+ special_line["tax_amount"],
|
|
308
|
-
}
|
|
309
|
-
)
|
|
298
|
+
tax_lines[key]["base_move_line_ids"] += vals["base_move_line_ids"]
|
|
299
|
+
# For later matching special taxes
|
|
300
|
+
tax_lines[key]["other_tax_ids"] = (move_line.tax_ids - tax).ids
|
|
310
301
|
|
|
311
302
|
def _clear_old_data(self):
|
|
312
303
|
"""
|
|
@@ -323,6 +314,7 @@ class L10nEsVatBook(models.Model):
|
|
|
323
314
|
("date", ">=", self.date_start),
|
|
324
315
|
("date", "<=", self.date_end),
|
|
325
316
|
("parent_state", "=", "posted"),
|
|
317
|
+
("display_type", "not in", ("line_section", "line_note")),
|
|
326
318
|
]
|
|
327
319
|
if taxes:
|
|
328
320
|
domain.append(("tax_ids", "in", taxes.ids))
|
|
@@ -347,7 +339,6 @@ class L10nEsVatBook(models.Model):
|
|
|
347
339
|
self._account_move_line_domain(taxes=taxes, account=account)
|
|
348
340
|
)
|
|
349
341
|
|
|
350
|
-
@ormcache("self.id")
|
|
351
342
|
def get_pos_partner_ids(self):
|
|
352
343
|
return (
|
|
353
344
|
self.env["res.partner"]
|
|
@@ -358,12 +349,15 @@ class L10nEsVatBook(models.Model):
|
|
|
358
349
|
|
|
359
350
|
@ormcache("self.id")
|
|
360
351
|
def get_special_taxes_dic(self):
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
352
|
+
domain = [("special_tax_group", "!=", False)]
|
|
353
|
+
if self.tax_agency_ids:
|
|
354
|
+
domain += [
|
|
355
|
+
("tax_agency_ids", "in", [False] + self.tax_agency_ids.ids),
|
|
356
|
+
]
|
|
357
|
+
map_lines = self.env["aeat.vat.book.map.line"].search(domain)
|
|
364
358
|
special_dic = {}
|
|
365
359
|
for map_line in map_lines:
|
|
366
|
-
for tax in map_line.
|
|
360
|
+
for tax in map_line.get_taxes_for_company(self.company_id):
|
|
367
361
|
special_dic[tax.id] = {
|
|
368
362
|
"name": map_line.name,
|
|
369
363
|
"book_type": map_line.book_type,
|
|
@@ -374,23 +368,32 @@ class L10nEsVatBook(models.Model):
|
|
|
374
368
|
return special_dic
|
|
375
369
|
|
|
376
370
|
def get_book_line_key(self, move_line):
|
|
377
|
-
return move_line.move_id.id
|
|
371
|
+
return move_line.move_id.id
|
|
378
372
|
|
|
379
373
|
def get_book_line_tax_key(self, move_line, tax):
|
|
380
|
-
return move_line.move_id.id,
|
|
374
|
+
return move_line.move_id.id, tax.id
|
|
381
375
|
|
|
382
376
|
def _set_line_type(self, line_vals, line_type):
|
|
383
377
|
if line_vals["base_amount"] < 0.0:
|
|
384
378
|
line_vals["line_type"] = "rectification_{}".format(line_type)
|
|
385
379
|
|
|
386
380
|
def _check_exceptions(self, line_vals):
|
|
381
|
+
rp_model = self.env["res.partner"]
|
|
387
382
|
if not line_vals["partner_id"]:
|
|
388
383
|
line_vals["exception_text"] = _("Without Partner")
|
|
389
|
-
elif
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
384
|
+
elif not line_vals["vat_number"]: # Doesn't have VAT
|
|
385
|
+
partner = rp_model.browse(line_vals["partner_id"])
|
|
386
|
+
country_code, identifier_type, vat_number = partner._parse_aeat_vat_info()
|
|
387
|
+
req_vat_identif_types = [
|
|
388
|
+
s_opt[0]
|
|
389
|
+
for s_opt in rp_model._fields["aeat_identification_type"].selection
|
|
390
|
+
] + [""] # "" is the identification type for Spain
|
|
391
|
+
# Partner type requires VAT
|
|
392
|
+
if (
|
|
393
|
+
identifier_type in req_vat_identif_types
|
|
394
|
+
and line_vals["partner_id"] not in self.get_pos_partner_ids()
|
|
395
|
+
):
|
|
396
|
+
line_vals["exception_text"] = _("Without VAT")
|
|
394
397
|
|
|
395
398
|
def create_vat_book_lines(self, move_lines, line_type, taxes):
|
|
396
399
|
VatBookLine = self.env["l10n.es.vat.book.line"]
|
|
@@ -403,6 +406,26 @@ class L10nEsVatBook(models.Model):
|
|
|
403
406
|
lines_values = []
|
|
404
407
|
for line_vals in moves_dic.values():
|
|
405
408
|
tax_lines = line_vals.pop("tax_lines")
|
|
409
|
+
# Match special taxes groups
|
|
410
|
+
sp_taxes_dic = self.get_special_taxes_dic()
|
|
411
|
+
sp_taxes = {}
|
|
412
|
+
# First loop for extracting special taxes
|
|
413
|
+
for tax_line in tax_lines.values():
|
|
414
|
+
if tax_line["tax_id"] in sp_taxes_dic:
|
|
415
|
+
tax_group = sp_taxes_dic[tax_line["tax_id"]]["special_tax_group"]
|
|
416
|
+
line_vals["special_tax_group"] = tax_group
|
|
417
|
+
tax_line["special_tax_group"] = tax_group
|
|
418
|
+
if "other_tax_ids" in tax_line:
|
|
419
|
+
sp_taxes[tuple(tax_line["other_tax_ids"])] = tax_line
|
|
420
|
+
tax_line.pop("other_tax_ids", None)
|
|
421
|
+
# Second loop for putting the values in the other lines
|
|
422
|
+
if sp_taxes:
|
|
423
|
+
for tax_line in tax_lines.values():
|
|
424
|
+
key = (tax_line["tax_id"],)
|
|
425
|
+
if key in sp_taxes:
|
|
426
|
+
sp_vals = sp_taxes[key]
|
|
427
|
+
tax_line["special_tax_id"] = sp_vals["tax_id"]
|
|
428
|
+
tax_line["special_tax_amount"] = sp_vals["tax_amount"]
|
|
406
429
|
tax_line_list = []
|
|
407
430
|
tax_amount = 0.0
|
|
408
431
|
for tax_line_vals in tax_lines.values():
|
|
@@ -431,16 +454,19 @@ class L10nEsVatBook(models.Model):
|
|
|
431
454
|
# Searches for all possible usable lines to report
|
|
432
455
|
moves = rec._get_account_move_lines()
|
|
433
456
|
for book_type in ["issued", "received"]:
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
457
|
+
domain = [("book_type", "=", book_type)]
|
|
458
|
+
if rec.tax_agency_ids:
|
|
459
|
+
domain += [
|
|
460
|
+
("tax_agency_ids", "in", [False] + rec.tax_agency_ids.ids),
|
|
461
|
+
]
|
|
462
|
+
map_lines = self.env["aeat.vat.book.map.line"].search(domain)
|
|
437
463
|
taxes = self.env["account.tax"]
|
|
438
464
|
accounts = {}
|
|
439
465
|
for map_line in map_lines:
|
|
440
|
-
line_taxes = map_line.
|
|
466
|
+
line_taxes = map_line.get_taxes_for_company(rec.company_id)
|
|
441
467
|
taxes |= line_taxes
|
|
442
|
-
if map_line.
|
|
443
|
-
account =
|
|
468
|
+
if map_line.account_xmlid_id:
|
|
469
|
+
account = map_line.get_accounts_for_company(rec.company_id)
|
|
444
470
|
accounts.update({tax: account for tax in line_taxes})
|
|
445
471
|
# Filter in all possible data using sets for improving performance
|
|
446
472
|
if accounts:
|
|
@@ -456,7 +482,8 @@ class L10nEsVatBook(models.Model):
|
|
|
456
482
|
lines = moves.filtered(
|
|
457
483
|
lambda line: (line.tax_ids | line.tax_line_id) & taxes
|
|
458
484
|
)
|
|
459
|
-
|
|
485
|
+
if map_lines:
|
|
486
|
+
rec.create_vat_book_lines(lines, map_lines[:1].book_type, taxes)
|
|
460
487
|
# Issued
|
|
461
488
|
book_type = "issued"
|
|
462
489
|
issued_tax_lines = rec.issued_line_ids.mapped("tax_line_ids")
|
|
@@ -32,7 +32,6 @@ class L10nEsVatBookLine(models.Model):
|
|
|
32
32
|
invoice_date = fields.Date()
|
|
33
33
|
|
|
34
34
|
partner_id = fields.Many2one(comodel_name="res.partner", string="Empresa")
|
|
35
|
-
|
|
36
35
|
vat_number = fields.Char(string="NIF")
|
|
37
36
|
|
|
38
37
|
vat_book_id = fields.Many2one(comodel_name="l10n.es.vat.book", string="Vat Book id")
|
|
@@ -25,8 +25,16 @@ class L10nEsVatBookLineTax(models.Model):
|
|
|
25
25
|
|
|
26
26
|
tax_amount = fields.Float(string="Tax fee")
|
|
27
27
|
|
|
28
|
-
total_amount = fields.Float(
|
|
29
|
-
|
|
28
|
+
total_amount = fields.Float(
|
|
29
|
+
string="Total",
|
|
30
|
+
compute="_compute_total_amount",
|
|
31
|
+
store=True,
|
|
32
|
+
)
|
|
33
|
+
base_move_line_ids = fields.Many2many(
|
|
34
|
+
comodel_name="account.move.line",
|
|
35
|
+
string="Move Lines (Base)",
|
|
36
|
+
relation="account_move_line_l10n_es_vat_book_line_tax_base_rel",
|
|
37
|
+
)
|
|
30
38
|
move_line_ids = fields.Many2many(
|
|
31
39
|
comodel_name="account.move.line", string="Move Lines"
|
|
32
40
|
)
|
|
@@ -44,9 +52,23 @@ class L10nEsVatBookLineTax(models.Model):
|
|
|
44
52
|
)
|
|
45
53
|
total_amount_special_include = fields.Float(
|
|
46
54
|
string="Total w/Special",
|
|
55
|
+
compute="_compute_total_amount_special_include",
|
|
56
|
+
store=True,
|
|
47
57
|
)
|
|
48
58
|
|
|
49
59
|
@api.depends("tax_id")
|
|
50
60
|
def _compute_tax_rate(self):
|
|
51
61
|
for rec in self:
|
|
52
62
|
rec.tax_rate = rec.tax_id.amount
|
|
63
|
+
|
|
64
|
+
@api.depends("base_amount", "tax_amount")
|
|
65
|
+
def _compute_total_amount(self):
|
|
66
|
+
for record in self:
|
|
67
|
+
record.total_amount = record.base_amount + record.tax_amount
|
|
68
|
+
|
|
69
|
+
@api.depends("total_amount", "special_tax_amount")
|
|
70
|
+
def _compute_total_amount_special_include(self):
|
|
71
|
+
for record in self:
|
|
72
|
+
record.total_amount_special_include = (
|
|
73
|
+
record.total_amount + record.special_tax_amount
|
|
74
|
+
)
|
|
@@ -23,11 +23,11 @@ class L10nEsVatBookIssuedSummary(models.Model):
|
|
|
23
23
|
selection=[("issued", "Issued"), ("received", "Received")],
|
|
24
24
|
)
|
|
25
25
|
|
|
26
|
-
base_amount = fields.Float(readonly=
|
|
26
|
+
base_amount = fields.Float(readonly=True)
|
|
27
27
|
|
|
28
|
-
tax_amount = fields.Float(readonly=
|
|
28
|
+
tax_amount = fields.Float(readonly=True)
|
|
29
29
|
|
|
30
|
-
total_amount = fields.Float(readonly=
|
|
30
|
+
total_amount = fields.Float(readonly=True)
|
|
31
31
|
special_tax_group = fields.Selection(
|
|
32
32
|
selection=_selection_special_tax_group,
|
|
33
33
|
string="Special group",
|