Skip to content

Commit

Permalink
[IMP] datev_export_xml: Update template invoice_party account
Browse files Browse the repository at this point in the history
  • Loading branch information
jsierp committed Mar 23, 2024
1 parent 6232041 commit f6c10d0
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 17 deletions.
3 changes: 2 additions & 1 deletion datev_export/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Datev Export
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b36b5e781714437c3ad85e354d6b113e43c2060f3660fde6e8e8782e3e1e5743
!! source digest: sha256:9172064f160f749fb1c6a210d38c0dc3358457577326b13ce2f65cbe6cdb15a6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -61,6 +61,7 @@ Authors
* Daniela Scarpa
* Maria Sparenberg
* initOS GmbH
* Jan Sierpina

Contributors
~~~~~~~~~~~~
Expand Down
3 changes: 2 additions & 1 deletion datev_export/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Datev Export</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b36b5e781714437c3ad85e354d6b113e43c2060f3660fde6e8e8782e3e1e5743
!! source digest: sha256:9172064f160f749fb1c6a210d38c0dc3358457577326b13ce2f65cbe6cdb15a6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-germany/tree/16.0/datev_export"><img alt="OCA/l10n-germany" src="https://img.shields.io/badge/github-OCA%2Fl10n--germany-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-germany-16-0/l10n-germany-16-0-datev_export"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-germany&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<div class="section" id="odoo-export-to-datev">
Expand Down Expand Up @@ -395,6 +395,7 @@ <h2>Authors</h2>
<li>Daniela Scarpa</li>
<li>Maria Sparenberg</li>
<li>initOS GmbH</li>
<li>Jan Sierpina</li>
</ul>
</div>
<div class="section" id="contributors">
Expand Down
4 changes: 3 additions & 1 deletion datev_export_xml/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Datev Export XML
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:4bf29e187b7888ebddc3e84b36eff27912dbe167f2ff4cb0ddacf7423a7b429d
!! source digest: sha256:1803438c95ef02a479e84e31c13911c72c38b204b47f0c8ab8a5deeaae1c8ac6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -263,13 +263,15 @@ Authors
* Daniela Scarpa
* Maria Sparenberg
* initOS GmbH
* Jan Sierpina

Contributors
~~~~~~~~~~~~

* Thorsten Vocks (OpenBIG.org)
* Guenter Selbert (sewisoft.de)
* initOS GmbH (initOS.com)
* Solvti sp. z o.o. (https://solvti.pl)

Maintainers
~~~~~~~~~~~
Expand Down
4 changes: 4 additions & 0 deletions datev_export_xml/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def datev_price_information(self):
partner=self.move_id.partner_id,
)

def datev_analytic_account(self):
self.ensure_one()
return self.analytic_line_ids[:1].account_id


class AccountMove(models.Model):
_inherit = "account.move"
Expand Down
4 changes: 3 additions & 1 deletion datev_export_xml/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Datev Export XML</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:4bf29e187b7888ebddc3e84b36eff27912dbe167f2ff4cb0ddacf7423a7b429d
!! source digest: sha256:1803438c95ef02a479e84e31c13911c72c38b204b47f0c8ab8a5deeaae1c8ac6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-germany/tree/16.0/datev_export_xml"><img alt="OCA/l10n-germany" src="https://img.shields.io/badge/github-OCA%2Fl10n--germany-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-germany-16-0/l10n-germany-16-0-datev_export_xml"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-germany&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<div class="section" id="odoo-export-to-datev-xml">
Expand Down Expand Up @@ -508,6 +508,7 @@ <h2>Authors</h2>
<li>Daniela Scarpa</li>
<li>Maria Sparenberg</li>
<li>initOS GmbH</li>
<li>Jan Sierpina</li>
</ul>
</div>
<div class="section" id="contributors">
Expand All @@ -516,6 +517,7 @@ <h2>Contributors</h2>
<li>Thorsten Vocks (OpenBIG.org)</li>
<li>Guenter Selbert (sewisoft.de)</li>
<li>initOS GmbH (initOS.com)</li>
<li>Solvti sp. z o.o. (<a class="reference external" href="https://solvti.pl">https://solvti.pl</a>)</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
4 changes: 2 additions & 2 deletions datev_export_xml/tests/test_datev_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def create_out_invoice(self, customer, start_date, end_date):
"credit": 600.0,
"debit": 0.0,
"account_id": self.account_income.id,
"analytic_distribution": {self.analytic_account_it.id: 1},
"analytic_distribution": {self.analytic_account_it.id: 100},
},
)
],
Expand Down Expand Up @@ -181,7 +181,7 @@ def create_out_invoice_with_tax(self, customer, start_date, end_date, tax):
"quantity": 5.0,
"price_unit": 120.00,
"account_id": self.account_income.id,
"analytic_distribution": {self.analytic_account_it.id: 1},
"analytic_distribution": {self.analytic_account_it.id: 100},
"tax_ids": [(6, 0, tax.ids)],
},
),
Expand Down
19 changes: 8 additions & 11 deletions datev_export_xml/views/templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<accounting_info
t-att-account_no="line.account_id.code or ''"
t-att-cost_category_id="(line.analytic_line_ids[0].account_id.code or '') if line.analytic_line_ids else ''"
t-att-cost_category_id="line.datev_analytic_account().code or ''"
t-att-booking_text="(line.name or line.product_id.name or '')[:60]"
t-att-bu_code="line.tax_ids.l10n_de_datev_code or '0'"
/>
Expand Down Expand Up @@ -86,16 +86,13 @@
t-att-invoice_type="doc.datev_invoice_type()"
/>
<invoice_party t-call="datev_export_xml.export_party">
<t t-if="doc.move_type in ['out_invoice', 'out_refund']">
<t t-set="partner" t-value="doc.partner_id" />
<t
t-set="account"
t-value="partner.property_account_receivable_id"
/>
</t>
<t t-else="">
<t t-set="partner" t-value="doc.company_id.partner_id" />
</t>
<t
t-set="partner"
t-value="doc.partner_id"
t-if="doc.move_type in ['out_invoice', 'out_refund']"
/>
<t t-set="partner" t-value="doc.company_id.partner_id" t-else="" />
<t t-set="account" t-value="partner.property_account_receivable_id" />
</invoice_party>

<supplier_party t-call="datev_export_xml.export_party">
Expand Down

0 comments on commit f6c10d0

Please sign in to comment.