diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/l10n_de/models/base_document_layout.py | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/l10n_de/models/base_document_layout.py')
| -rw-r--r-- | addons/l10n_de/models/base_document_layout.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/addons/l10n_de/models/base_document_layout.py b/addons/l10n_de/models/base_document_layout.py new file mode 100644 index 00000000..6ded58f4 --- /dev/null +++ b/addons/l10n_de/models/base_document_layout.py @@ -0,0 +1,26 @@ +from odoo import models, fields, _ +from odoo.tools import format_date + + +class BaseDocumentLayout(models.TransientModel): + _inherit = 'base.document.layout' + + street = fields.Char(related='company_id.street', readonly=True) + street2 = fields.Char(related='company_id.street2', readonly=True) + zip = fields.Char(related='company_id.zip', readonly=True) + city = fields.Char(related='company_id.city', readonly=True) + company_registry = fields.Char(related='company_id.company_registry', readonly=True) + bank_ids = fields.One2many(related='company_id.partner_id.bank_ids', readonly=True) + l10n_de_template_data = fields.Binary(compute='_compute_l10n_de_template_data') + l10n_de_document_title = fields.Char(compute='_compute_l10n_de_document_title') + + def _compute_l10n_de_template_data(self): + self.l10n_de_template_data = [ + (_("Invoice No."), 'INV/2021/12345'), + (_("Invoice Date"), format_date(self.env, fields.Date.today())), + (_("Due Date"), format_date(self.env, fields.Date.add(fields.Date.today(), days=7))), + (_("Reference"), 'SO/2021/45678'), + ] + + def _compute_l10n_de_document_title(self): + self.l10n_de_document_title = 'Invoice' |
