Skip to content

Commit

Permalink
Merge PR #4202 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by eLBati
  • Loading branch information
OCA-git-bot committed Jun 21, 2024
2 parents 8bdb2e8 + 26cb72c commit 5e37827
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 4 deletions.
1 change: 1 addition & 0 deletions l10n_it_riba/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 10 additions & 0 deletions l10n_it_riba/models/riba.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions l10n_it_riba/security/ir.model.access.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 7 additions & 4 deletions l10n_it_riba/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
: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.
Expand Down Expand Up @@ -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 }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

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

span.section-subtitle {
Expand Down Expand Up @@ -475,7 +476,9 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>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.</p>
Expand Down
37 changes: 37 additions & 0 deletions l10n_it_riba/views/wizard_due_date_settlement.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>

<record id="riba_due_date_settlement" model="ir.ui.view">
<field name="name">riba.due.date.settlement.wizard</field>
<field name="model">riba.due.date.settlement</field>
<field name="arch" type="xml">
<form>
<separator
string="This wizard will set 'Paid' all C/O details selected by due date"
colspan="4"
/>
<group>
<field name="due_date" />
</group>
<footer>
<button
string="Confirm"
name="due_date_settlement_confirm"
type="object"
class="oe_highlight"
/>
<button string="Cancel" special="cancel" class="oe_link" />
</footer>
</form>
</field>
</record>

<record id="action_wizard_riba_due_date_settlement" model="ir.actions.server">
<field name="name">C/O Due Date Settlement</field>
<field name="model_id" ref="l10n_it_riba.model_riba_slip" />
<field name="binding_model_id" ref="l10n_it_riba.model_riba_slip" />
<field name="state">code</field>
<field name="code">action = records.action_riba_due_date_settlement()</field>
</record>

</odoo>
1 change: 1 addition & 0 deletions l10n_it_riba/wizard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
from . import wizard_credit
from . import wizard_past_due
from . import wizard_presentation_riba
from . import wizard_due_date_settlement
22 changes: 22 additions & 0 deletions l10n_it_riba/wizard/wizard_due_date_settlement.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 5e37827

Please sign in to comment.