-
-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] l10n_it_ricevute_bancarie: add possibility to change riba payme…
…nts date
- Loading branch information
1 parent
d41e70c
commit 6d9c241
Showing
10 changed files
with
90 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
l10n_it_ricevute_bancarie/views/wizard_riba_payment_date.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<!-- | ||
~ Copyright 2024 Nextev Srl | ||
~ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
--> | ||
<odoo> | ||
<record id="wizard_riba_payment_date" model="ir.ui.view"> | ||
<field name="name">Set RiBa Payment Date</field> | ||
<field name="model">riba.payment.date</field> | ||
<field name="arch" type="xml"> | ||
<form string="Set RiBa Payment Date"> | ||
<group col="4"> | ||
<group colspan="4"> | ||
<field name="date" /> | ||
</group> | ||
<footer colspan="4"> | ||
<button | ||
name="set_riba_payment_date" | ||
string="Confirm" | ||
type="object" | ||
/> | ||
<button special="cancel" string="Close" /> | ||
</footer> | ||
</group> | ||
</form> | ||
</field> | ||
</record> | ||
|
||
<record id="action_riba_payment_date" model="ir.actions.server"> | ||
<field name="name">RiBa Payment Date</field> | ||
<field name="model_id" ref="account.model_account_move" /> | ||
<field name="binding_model_id" ref="account.model_account_move" /> | ||
<field name="state">code</field> | ||
<field name="code">action = records.action_riba_payment_date()</field> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
l10n_it_ricevute_bancarie/wizard/wizard_riba_payment_date.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 2024 Nextev Srl | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import _, fields, models | ||
from odoo.exceptions import UserError | ||
|
||
|
||
# ------------------------------------------------------- | ||
# RIBA PAYMENT DATE | ||
# ------------------------------------------------------- | ||
class RibaPaymentDate(models.TransientModel): | ||
_name = "riba.payment.date" | ||
_description = "RiBa Payment Date" | ||
|
||
date = fields.Date(string="Payment Date", required=True) | ||
|
||
def set_riba_payment_date(self): | ||
active_id = self.env.context.get("active_id", False) | ||
if not active_id: | ||
raise UserError(_("No active ID found.")) | ||
move = self.env["account.move"].browse([active_id]) | ||
move.date = self.date | ||