odoo-addon-account-move-payroll-import 16.0.1.0.0__py2.py3-none-any.whl → 16.0.1.0.1__py2.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.
@@ -3,7 +3,7 @@
3
3
  # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
4
4
  {
5
5
  "name": "SomItCoop ODOO accounting spanish payroll import",
6
- "version": "16.0.1.0.0",
6
+ "version": "16.0.1.0.1",
7
7
  "depends": ["account", "hr", "web", "l10n_es"],
8
8
  "author": """
9
9
  Som It Cooperatiu SCCL,
@@ -10,16 +10,20 @@ class PayrollCustomConcept(models.Model):
10
10
 
11
11
  @api.model
12
12
  def create(self, vals):
13
- default_account_ext_id = "l10n_es.%s_%s" % (
14
- self.env.company.id, vals.get("default_account_xml_id", False)
15
- )
16
- if default_account_ext_id:
17
- account = self.env.ref(default_account_ext_id, False)
18
- vals.update({"account_id": account.id if account else False})
13
+ if not vals.get("account_id", False) and vals.get("default_account_xml_id", False):
14
+ default_account_ext_id = "l10n_es.%s_%s" % (
15
+ self.env.company.id, vals.get("default_account_xml_id", False)
16
+ )
17
+ if default_account_ext_id:
18
+ account = self.env.ref(default_account_ext_id, False)
19
+ vals.update({"account_id": account.id if account else False})
19
20
 
20
21
  return super(PayrollCustomConcept, self).create(vals)
21
22
 
22
23
  def _default_account(self):
24
+ if not self.default_account_xml_id:
25
+ return False
26
+
23
27
  default_account_ext_id = "l10n_es.%s_%s" % (
24
28
  self.env.company.id, self.default_account_xml_id
25
29
  )
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
- from odoo import models, fields, _, Command
3
+ from odoo import models, fields, api, _, Command
4
4
  from odoo.exceptions import UserError
5
5
 
6
6
  from ..utils.parse_utils import abs_float
@@ -78,6 +78,21 @@ class PayrollImportSetup(models.Model):
78
78
  ),
79
79
  ]
80
80
 
81
+ @api.model_create_multi
82
+ def create(self, vals_list):
83
+ for vals in vals_list:
84
+ for custom_concept in vals.get("custom_concepts_ids", []):
85
+ custom_concept = custom_concept[2] if len(custom_concept) >= 3 else {}
86
+
87
+ if not custom_concept.get("account_id", False):
88
+ raise UserError(
89
+ _(
90
+ "Please select an account for the custom concept '%s'."
91
+ % custom_concept.get("name")
92
+ )
93
+ )
94
+ return super(PayrollImportSetup, self).create(vals_list)
95
+
81
96
  name = fields.Char(
82
97
  string="Name",
83
98
  default=_("Payroll Import A3 2024"),
@@ -39,7 +39,10 @@ class AccountPayrollImportWizard(models.TransientModel):
39
39
  def _default_payroll_import_setup(self):
40
40
  payroll_import_setup = self.env["payroll.import.setup"].search([], limit=1)
41
41
  if not payroll_import_setup:
42
- payroll_import_setup = self.env["payroll.import.setup"].create({})
42
+ try:
43
+ payroll_import_setup = self.env["payroll.import.setup"].create({})
44
+ except Exception:
45
+ return False
43
46
 
44
47
  return payroll_import_setup
45
48
 
@@ -71,6 +74,15 @@ class AccountPayrollImportWizard(models.TransientModel):
71
74
  if not self.payroll_import_setup_id.journal_id:
72
75
  raise UserError(_("Please select a journal in the import configuration."))
73
76
 
77
+ for custom_concept in self.payroll_import_setup_id.custom_concepts_ids:
78
+ if not custom_concept.account_id:
79
+ raise UserError(
80
+ _(
81
+ "Please select an account for the custom concept: %s."
82
+ % custom_concept.name
83
+ )
84
+ )
85
+
74
86
  extension = is_valid_extension(self.file_name)
75
87
  if not extension:
76
88
  raise UserError(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: odoo-addon-account-move-payroll-import
3
- Version: 16.0.1.0.0
3
+ Version: 16.0.1.0.1
4
4
  Summary: ODOO account move spanish payroll data import for social cooperatives.
5
5
  Home-page: https://gitlab.com/somitcoop/erp-research/odoo-accounting
6
6
  Author: Som It Cooperatiu SCCL, Som Connexió SCCL
@@ -1,15 +1,15 @@
1
1
  odoo/addons/account_move_payroll_import/CHANGELOG.md,sha256=COE0An9jnvIrV7eWgGSa6XzTGN8tACjr_LkFmjRbqos,608
2
2
  odoo/addons/account_move_payroll_import/README.rst,sha256=fnLmb6E5pLv2d-kzAVwIs2O1QKyApMwCobkT9nUgXbo,3354
3
3
  odoo/addons/account_move_payroll_import/__init__.py,sha256=xdfbExIUANT_2sXVtonxwfOse1Cqvz2AVNntyx_lINE,68
4
- odoo/addons/account_move_payroll_import/__manifest__.py,sha256=6ABK7Sbxchr-Df-d49ElodKYxFx5eCXvp-OHfM9cMyA,1379
4
+ odoo/addons/account_move_payroll_import/__manifest__.py,sha256=8Tl6Ba4ENLvLvnqQc0Z4p4xZm0LvxYVjBFPG6dWfRUc,1379
5
5
  odoo/addons/account_move_payroll_import/data/payroll_import_defaults.xml,sha256=8fnC8Z2ov3ulvcwcaazG5i3DGBzaK5Q0JFhF4dRzn9s,4570
6
6
  odoo/addons/account_move_payroll_import/i18n/ca_ES.po,sha256=8ucDStleOanDEsdBK1IFKGsbwWjrQ6_-YUCICN3TGaI,38186
7
7
  odoo/addons/account_move_payroll_import/i18n/es.po,sha256=grQjubV3lz29tHlLtRyUjSF6NrmHyDRRUGo1V7poTpw,38369
8
8
  odoo/addons/account_move_payroll_import/models/__init__.py,sha256=MvOdNmgSVk-29bpZZRt415YrRUGryuSE7gpIzoRqw5c,161
9
9
  odoo/addons/account_move_payroll_import/models/account_move.py,sha256=8T-DNpKHc_e4r18NSx8Bh2xFQB4DlLI69ImxmghXJU8,6031
10
- odoo/addons/account_move_payroll_import/models/payroll_custom_concept.py,sha256=xTSojF_wYgpIg-jFwCsZVlsllP7Cratmy7Mh6Gr20g4,1817
10
+ odoo/addons/account_move_payroll_import/models/payroll_custom_concept.py,sha256=m8Wl_xFsWCwOqLJWwBFTmtA669rqIg0mIvGNqDtBnfw,2003
11
11
  odoo/addons/account_move_payroll_import/models/payroll_import_mapping.py,sha256=ARiif1H0CMs17n-0SW563Jv9jA1ta3nhCtq9l4vVbHA,943
12
- odoo/addons/account_move_payroll_import/models/payroll_import_setup.py,sha256=odQtiA_58mrQhDG54poEg15ME72bfMCGa4WPIwD5Lkg,16938
12
+ odoo/addons/account_move_payroll_import/models/payroll_import_setup.py,sha256=WHT3A4jy6Ba-8i_A6Voddpxa8Dk4BXJJdaYJpBZFDAI,17577
13
13
  odoo/addons/account_move_payroll_import/security/ir.model.access.csv,sha256=YI4EAYd35NkiQvd1URS3Ex_zV3GVuI1-T-thl9mlCrU,536
14
14
  odoo/addons/account_move_payroll_import/static/src/css/styles.css,sha256=JK4NBJ_TIy-sWYIGa5nRlZh-KH1OKr1eBzCYx7pJjyI,522
15
15
  odoo/addons/account_move_payroll_import/static/src/js/payroll_import_button.js,sha256=cK9eHxA9jCSGr0HuZFV5Gvy8WWXe8iwNSDV4bYpJEFc,844
@@ -20,9 +20,9 @@ odoo/addons/account_move_payroll_import/utils/parse_utils.py,sha256=G5Crc1A0NzMt
20
20
  odoo/addons/account_move_payroll_import/views/assets_template.xml,sha256=SMV2_61cbZG_IjIlsBEiYVLVAb4VmoBRYSsiljou1jU,544
21
21
  odoo/addons/account_move_payroll_import/views/payroll_import_views.xml,sha256=r4PrdTU7MY_KZMJFIcOgms9IaCPv2sirJagnlVWUotI,10386
22
22
  odoo/addons/account_move_payroll_import/wizards/__init__.py,sha256=ZJP90LnlsKPOz5hOqllzpC8O0__7WcIiH6FauPHav_w,60
23
- odoo/addons/account_move_payroll_import/wizards/payroll_import_wizard.py,sha256=MO7ZpnjpEt2_o5LpYbJnDzEXvmzb065hwNlpsYNG_-g,11912
23
+ odoo/addons/account_move_payroll_import/wizards/payroll_import_wizard.py,sha256=gdOBxLPhEmZ2GnUi2rTz5JBfCWk1gy53cFM3Mx8kGCg,12340
24
24
  odoo/addons/account_move_payroll_import/wizards/payroll_import_wizard.xml,sha256=p7ewpc4WKDMdJ3a5DGYLtyX8bYDZWHqUrZ42XKzW868,1926
25
- odoo_addon_account_move_payroll_import-16.0.1.0.0.dist-info/METADATA,sha256=c0fowwohoRC-q-__tYBwpM2dUB1HZnniqWJOi8bFx6I,3905
26
- odoo_addon_account_move_payroll_import-16.0.1.0.0.dist-info/WHEEL,sha256=fS9sRbCBHs7VFcwJLnLXN1MZRR0_TVTxvXKzOnaSFs8,110
27
- odoo_addon_account_move_payroll_import-16.0.1.0.0.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
28
- odoo_addon_account_move_payroll_import-16.0.1.0.0.dist-info/RECORD,,
25
+ odoo_addon_account_move_payroll_import-16.0.1.0.1.dist-info/METADATA,sha256=uqfPwlUPPXRpa289NBaW--5RmVg0MdDZ9DlPwY9Wqss,3905
26
+ odoo_addon_account_move_payroll_import-16.0.1.0.1.dist-info/WHEEL,sha256=QyeGbh-t8WT0nt0_LNSP02jN-g4ymd1egk1U3osCGMU,110
27
+ odoo_addon_account_move_payroll_import-16.0.1.0.1.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
28
+ odoo_addon_account_move_payroll_import-16.0.1.0.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.44.0)
2
+ Generator: bdist_wheel (0.45.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any