-
-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathres_company.py
More file actions
49 lines (39 loc) · 1.31 KB
/
res_company.py
File metadata and controls
49 lines (39 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Copyright (C) 2023 initOS GmbH
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models
class ResCompany(models.Model):
_inherit = "res.company"
datev_consultant_number = fields.Char(
string="Consultant Number",
size=8,
help="Number from 1000 to 99999999",
)
datev_client_number = fields.Char(
string="Client Number",
size=5,
help="Number from 0 to 99999",
)
datev_account_code_length = fields.Integer(
string="DATEV account code length",
default=5,
)
datev_partner_numbering = fields.Selection(
selection="_selection_datev_partner_numbering",
string="DATEV Partner numbering",
default="none",
)
datev_customer_sequence_id = fields.Many2one(
"ir.sequence", "DATEV sequence for customers"
)
datev_supplier_sequence_id = fields.Many2one(
"ir.sequence", "DATEV sequence for suppliers"
)
def _selection_datev_partner_numbering(self):
reports_installed = (
"l10n_de_datev_reports" in self.env["ir.module.module"]._installed()
)
return (
[("none", "None")]
+ ([("ee", "Enterprises Edition")] if reports_installed else [])
+ [("sequence", "Sequence")]
)