diff --git a/l10n_it_riba/__manifest__.py b/l10n_it_riba/__manifest__.py index ab3e2564edc5..f5a2dccb249e 100644 --- a/l10n_it_riba/__manifest__.py +++ b/l10n_it_riba/__manifest__.py @@ -42,6 +42,7 @@ "views/slip_report.xml", "views/riba_detail_view.xml", "views/wizard_presentation.xml", + "views/wizard_due_date_settlement.xml", ], "demo": ["demo/riba_demo.xml"], "installable": True, diff --git a/l10n_it_riba/models/riba.py b/l10n_it_riba/models/riba.py index c4928c7efe56..3b0f529ec62b 100644 --- a/l10n_it_riba/models/riba.py +++ b/l10n_it_riba/models/riba.py @@ -134,6 +134,16 @@ def action_riba_export(self): "context": self.env.context, } + def action_riba_due_date_settlement(self): + return { + "type": "ir.actions.act_window", + "name": "C/O Due Date Settlement", + "res_model": "riba.due.date.settlement", + "view_mode": "form", + "target": "new", + "context": self.env.context, + } + @api.ondelete(at_uninstall=False) def _unlink_if_not_confirmed(self): for riba_list in self: diff --git a/l10n_it_riba/security/ir.model.access.csv b/l10n_it_riba/security/ir.model.access.csv index 4c7c9d9f10b1..a7c4473be717 100644 --- a/l10n_it_riba/security/ir.model.access.csv +++ b/l10n_it_riba/security/ir.model.access.csv @@ -18,3 +18,4 @@ access_riba_past_due,riba_past_due,model_riba_past_due,account.group_account_inv access_riba_credit,riba_credit,model_riba_credit,account.group_account_invoice,1,1,1,1 access_riba_file_export,riba_file_export,model_riba_file_export,account.group_account_invoice,1,1,1,1 access_presentation_riba_issue,access_presentation_riba_issue,model_presentation_riba_issue,account.group_account_invoice,1,1,1,1 +access_riba_due_date_settlement,riba_due_date_settlement,model_riba_due_date_settlement,account.group_account_invoice,1,1,1,1 diff --git a/l10n_it_riba/static/description/index.html b/l10n_it_riba/static/description/index.html index 365d63a1dd30..51ec5d686be9 100644 --- a/l10n_it_riba/static/description/index.html +++ b/l10n_it_riba/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z 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. @@ -274,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* 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 } @@ -300,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -475,7 +476,9 @@

Contributors

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

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.

diff --git a/l10n_it_riba/views/wizard_due_date_settlement.xml b/l10n_it_riba/views/wizard_due_date_settlement.xml new file mode 100644 index 000000000000..d49d2e522edf --- /dev/null +++ b/l10n_it_riba/views/wizard_due_date_settlement.xml @@ -0,0 +1,37 @@ + + + + + riba.due.date.settlement.wizard + riba.due.date.settlement + +
+ + + + +
+
+ +
+
+ + + C/O Due Date Settlement + + + code + action = records.action_riba_due_date_settlement() + + +
diff --git a/l10n_it_riba/wizard/__init__.py b/l10n_it_riba/wizard/__init__.py index edfc7305728d..1a70ca517010 100644 --- a/l10n_it_riba/wizard/__init__.py +++ b/l10n_it_riba/wizard/__init__.py @@ -11,3 +11,4 @@ from . import wizard_credit from . import wizard_past_due from . import wizard_presentation_riba +from . import wizard_due_date_settlement diff --git a/l10n_it_riba/wizard/wizard_due_date_settlement.py b/l10n_it_riba/wizard/wizard_due_date_settlement.py new file mode 100644 index 000000000000..bd16a2c44127 --- /dev/null +++ b/l10n_it_riba/wizard/wizard_due_date_settlement.py @@ -0,0 +1,22 @@ +# Copyright (C) 2024 Giuseppe Borruso - Dinamiche Aziendali srl +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import _, fields, models +from odoo.exceptions import UserError + + +class RibaDueDateSettlement(models.TransientModel): + _name = "riba.due.date.settlement" + _description = "Riba Due Date Settlement" + + due_date = fields.Date() + + def due_date_settlement_confirm(self): + active_ids = self.env.context.get("active_ids", False) + if not active_ids: + raise UserError(_("No active ID found.")) + riba_ids = self.env["riba.slip"].browse(active_ids) + riba_lines = riba_ids.mapped("line_ids").filtered( + lambda rl: rl.state == "credited" and rl.due_date == self.due_date + ) + riba_lines.riba_line_settlement()