Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.0][MIG] account_e-invoice_generate #44

Merged
merged 2 commits into from
Jul 5, 2018
Merged
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
61 changes: 61 additions & 0 deletions account_e-invoice_generate/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: https://www.gnu.org/licenses/agpl
:alt: License: AGPL-3

=============================
Electronic Invoice Generation
=============================

This is a technical module needed to ensure compatibility between
the two electronic invoice generation modules: *account_invoice_ubl*
and *account_invoice_factur-x*. These 2 modules are able to embed an
XML file in the PDF invoice, but for the moment only one XML file can
be embedded in the PDF. And it can be useful to have both modules installed,
because, for example, you may need to generate Factur-X PDF invoices
for some customers and UBL XML files for other customers. So it adds
a configuration parameter to decide which XML format is embedded in the PDF.

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

The new configuration parameter *XML Format embedded in PDF invoice*
is available in the menu *Accounting > Configuration > Settings*.

Usage
=====

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/226/11.0

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

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/edi/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.

Credits
=======

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

* Alexis de Lattre <alexis.delattre@akretion.com>
* Andrea Stirpe <a.stirpe@onestein.nl>

Maintainer
----------

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

This module is maintained by the OCA.

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.

To contribute to this module, please visit https://odoo-community.org.
3 changes: 3 additions & 0 deletions account_e-invoice_generate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
19 changes: 19 additions & 0 deletions account_e-invoice_generate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2018 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
'name': 'Account e-invoice Generate',
'version': '11.0.1.0.0',
'category': 'Accounting & Finance',
'license': 'AGPL-3',
'summary': 'Technical module to generate PDF invoices with '
'embedded XML file',
'author': 'Akretion,Odoo Community Association (OCA)',
'website': 'https://github.com/OCA/edi',
'depends': ['account'],
'data': [
'views/res_config_settings.xml',
],
'installable': True,
}
4 changes: 4 additions & 0 deletions account_e-invoice_generate/models/__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 res_company
from . import res_config_settings
13 changes: 13 additions & 0 deletions account_e-invoice_generate/models/res_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2018 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResCompany(models.Model):
_inherit = 'res.company'

xml_format_in_pdf_invoice = fields.Selection([
('none', 'None'),
], string='XML Format embedded in PDF invoice')
12 changes: 12 additions & 0 deletions account_e-invoice_generate/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2018 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'

xml_format_in_pdf_invoice = fields.Selection(
related='company_id.xml_format_in_pdf_invoice')
2 changes: 2 additions & 0 deletions account_e-invoice_generate/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The new configuration parameter *XML Format embedded in PDF invoice*
is available in the menu *Accounting > Configuration > Settings*.
2 changes: 2 additions & 0 deletions account_e-invoice_generate/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Alexis de Lattre <alexis.delattre@akretion.com>
* Andrea Stirpe <a.stirpe@onestein.nl>
8 changes: 8 additions & 0 deletions account_e-invoice_generate/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This is a technical module needed to ensure compatibility between
the two electronic invoice generation modules: *account_invoice_ubl*
and *account_invoice_factur-x*. These 2 modules are able to embed an
XML file in the PDF invoice, but for the moment only one XML file can
be embedded in the PDF. And it can be useful to have both modules installed,
because, for example, you may need to generate Factur-X PDF invoices
for some customers and UBL XML files for other customers. So it adds
a configuration parameter to decide which XML format is embedded in the PDF.
35 changes: 35 additions & 0 deletions account_e-invoice_generate/views/res_config_settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>

<record id="view_account_config_settings" model="ir.ui.view">
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="account.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='invoicing_settings']" position="after">
<h2>Electronic Invoices</h2>
<div class="row mt16 o_settings_container" id="invoicing_settings">
<div class="col-xs-12 col-md-6 o_setting_box" id="e-invoices">
<div class="o_setting_left_pane"/>
<div class="o_setting_right_pane">
<label string="Select Format"/>
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." groups="base.group_multi_company"/>
<div class="text-muted">
Select the format of your e-invoices.
</div>
<div class="content-group" name="xml_format_in_pdf_invoice">
<div class="row mt16">
<label string="Format" class="col-md-3 o_light_label"/>
<field name="xml_format_in_pdf_invoice"/>
</div>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>

</odoo>