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

[14.0][IMP] epa_account_custom: add flexible installments #64

Merged
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
3 changes: 2 additions & 1 deletion epa_account_custom/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Epa Account Custom
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:05107e92a3a2a2037bc97206eb8b338a6f1edc86dee0aaef8840e4b50a56a82a
!! source digest: sha256:4f1029b0c2f01a63eb2c73ca489c267fe16aac30ec3be4732283df01112db0d8
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand All @@ -23,6 +23,7 @@ Epa Account Custom
|badge1| |badge2| |badge3|

- Hide Register Payment Button from Bills
- Flexible Installments

**Table of contents**

Expand Down
15 changes: 14 additions & 1 deletion epa_account_custom/models/account_move.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
# Copyright 2022 - TODAY, Marcel Savegnago <marcel.savegnago@escodoo.com.br>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models
from odoo import api, fields, models


class AccountMove(models.Model):
_inherit = "account.move"

flexible_installments = fields.Boolean(default=False)

@api.onchange(
"line_ids",
"invoice_payment_term_id",
"invoice_date_due",
"invoice_cash_rounding_id",
"invoice_vendor_bill_id",
)
def _onchange_recompute_dynamic_lines(self):
if not self.flexible_installments:
self._recompute_dynamic_lines()
1 change: 1 addition & 0 deletions epa_account_custom/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Hide Register Payment Button from Bills
- Flexible Installments
10 changes: 5 additions & 5 deletions epa_account_custom/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@

/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -276,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: gray; } /* line numbers */
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -302,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic, pre.problematic {
span.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -368,11 +367,12 @@ <h1 class="title">Epa Account Custom</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:05107e92a3a2a2037bc97206eb8b338a6f1edc86dee0aaef8840e4b50a56a82a
!! source digest: sha256:4f1029b0c2f01a63eb2c73ca489c267fe16aac30ec3be4732283df01112db0d8
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/Escodoo/epa-addons/tree/14.0/epa_account_custom"><img alt="Escodoo/epa-addons" src="https://img.shields.io/badge/github-Escodoo%2Fepa--addons-lightgray.png?logo=github" /></a></p>
<ul class="simple">
<li>Hide Register Payment Button from Bills</li>
<li>Flexible Installments</li>
</ul>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
Expand Down
8 changes: 8 additions & 0 deletions epa_account_custom/views/account_move.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
<attribute name="invisible">0</attribute>
<attribute name="optional">show</attribute>
</xpath>
<xpath expr="//sheet//label[@for='journal_id']" position="before">
<field
name="flexible_installments"
groups="account.group_account_user"
states="draft"
attrs="{'invisible': [('invoice_payment_term_id', '=', False)]}"
/>
</xpath>
</field>
</record>

Expand Down
Loading