Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions datev_export_dtvf/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
=================
Datev Export DTVF
=================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8878a789c9b1ba895ae3cf433f914f9f752d8fc14b4c2ee0a993cccfe49fa497
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--germany-lightgray.png?logo=github
:target: https://github.com/OCA/l10n-germany/tree/18.0/datev_export_dtvf
:alt: OCA/l10n-germany
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/l10n-germany-18-0/l10n-germany-18-0-datev_export_dtvf
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-germany&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module implements DATEV exports in the dtvf format.

**Table of contents**

.. contents::
:local:

Configuration
=============

To configure this module, you need to:

1. Go to Settings -> Invoicing
2. Fill in the fields in the DATEV section
3. For accounts where you want to suppress automatic calculations (for
ie taxes), set the according flag

The module also contains an inactive cronjob and a mail template
allowing you to send period DATEV export somewhere via email. It relies
on finding exactly one date range for the previous month and one for the
year of the previous month, otherwise you'll see an error message in
your log when running the cronjob. Note that the data transmitted via
email is not encrypted.

Usage
=====

To use this module, you need to:

1. Go to Invoicing / Reporting / DATEV export
2. Create an export, choose a date range to use as fiscal year, and
ranges to export
3. Click ``Generate``

Known issues / Roadmap
======================

- support missing formats
- add empty fields

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-germany/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/l10n-germany/issues/new?body=module:%20datev_export_dtvf%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Hunki Enterprises BV

Contributors
------------

- Holger Brunn <mail@hunki-enterprises.com>
(https://hunki-enterprises.com)

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/l10n-germany <https://github.com/OCA/l10n-germany/tree/18.0/datev_export_dtvf>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions datev_export_dtvf/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
from . import datev
26 changes: 26 additions & 0 deletions datev_export_dtvf/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2022 Hunki Enterprises BV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Datev Export DTVF",
"summary": "Export Data for DATEV (dtvf)",
"version": "18.0.1.0.0",
"development_status": "Beta",
"category": "Accounting",
"website": "https://github.com/OCA/l10n-germany",
"author": "Hunki Enterprises BV, Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": [
"account",
"date_range",
"datev_export",
],
"data": [
"data/ir_cron.xml",
"data/mail_template.xml",
"security/ir.model.access.csv",
"views/account_account.xml",
"views/datev_export_dtvf.xml",
"views/res_config_settings.xml",
"views/res_partner.xml",
],
}
33 changes: 33 additions & 0 deletions datev_export_dtvf/data/ir_cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<odoo noupdate="1">
<record id="cron_export" model="ir.cron">
<field name="name">Monthly DATEV export via mail (dtvf)</field>
<field name="interval_number">1</field>
<field name="interval_type">months</field>
<field name="model_id" ref="model_datev_export_dtvf_export" />
<field name="active" eval="False" />
<field name="code">
<![CDATA[
relativedelta = dateutil.relativedelta.relativedelta
last_month_start = datetime.date.today() - relativedelta(months=1, day=1)
last_month_end = last_month_start + relativedelta(months=1, days=-1)
year_start = last_month_start + relativedelta(month=1, day=1)
year_end = year_start + relativedelta(years=1, days=-1)
year_range = env['date.range'].search([('date_start', '=', year_start), ('date_end', '=', year_end)], limit=1)
period_range = env['date.range'].search([('date_start', '=', last_month_start), ('date_end', '=', last_month_end)], limit=1)
if year_range and period_range:
export = model.create({
'fiscalyear_id': year_range.id,
'period_ids': [(6, 0, period_range.ids)],
'name': ('Export %s-%02d') % (last_month_start.year, last_month_start.month),
})
export.action_generate()
env.ref('datev_export_dtvf.mail_template_cron_export').send_mail(
export.id,
email_values={'attachments': [(export.file_name, export.file_data)]},
)
else:
raise UserError('No appropriate date ranges found for periodic export')
]]>
</field>
</record>
</odoo>
16 changes: 16 additions & 0 deletions datev_export_dtvf/data/mail_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<odoo noupdate="1">
<record id="mail_template_cron_export" model="mail.template">
<field name="name">DATEV export</field>
<field name="subject">{{object.name}}</field>
<field name="email_to">test@test.com</field>
<field name="model_id" ref="model_datev_export_dtvf_export" />
<field name="body_html" type="html">
<h1>Dear recipient,</h1>
<p>
please find attached the latest DATEV export from <t
t-out="object.company_id.name"
/>.
</p>
</field>
</record>
</odoo>
Loading
Loading