Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
439 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from . import models | ||
from . import wizards |
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
16 changes: 16 additions & 0 deletions
16
sipreco_subsidy_management/data/ir_actions_server_data.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,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<!-- Generar expédientes --> | ||
<record model="ir.actions.server" id="action_generate_expedient"> | ||
<field name="name">Generar Expediente</field> | ||
<field name="model_id" ref="helpdesk.model_helpdesk_ticket"/> | ||
<field name="binding_model_id" ref="helpdesk.model_helpdesk_ticket"/> | ||
<field name="state">code</field> | ||
<field name="code"> | ||
action = env["ir.actions.act_window"]._for_xml_id('sipreco_subsidy_management.action_create_expedients_wizard') | ||
helpdesk_tickets = records.filtered(lambda x: x.stage_id.name in ['Ticket', 'Aprobado']) | ||
action['context'] = {'active_ids': helpdesk_tickets.ids} | ||
</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
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,18 @@ | ||
from odoo import models, fields | ||
|
||
|
||
class PublicBudgetExpedient(models.Model): | ||
|
||
_inherit = 'public_budget.expedient' | ||
|
||
purchase_order_ids = fields.One2many( | ||
'helpdesk.ticket', | ||
'expedient_id', | ||
) | ||
|
||
def action_open_subsidy_ticket(self): | ||
action = self.env["ir.actions.actions"]._for_xml_id("helpdesk.helpdesk_ticket_action_main_tree") | ||
action['context'] = {} | ||
all_child = self.with_context(active_test=False).search([('id', 'child_of', self.ids)]) | ||
action['domain'] = [('expedient_id', 'in', self.ids)] | ||
return action |
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,71 @@ | ||
from odoo import fields, models, api, _ | ||
import odoo.http as http | ||
from odoo.exceptions import ValidationError | ||
import stdnum | ||
|
||
class PublicBudgetSubsidyTicket(models.Model): | ||
|
||
_inherit = 'helpdesk.ticket' | ||
|
||
dni = fields.Char( | ||
size=8, | ||
string="DNI", | ||
required=True, | ||
) | ||
currency_id = fields.Many2one( | ||
'res.currency', | ||
related='company_id.currency_id', | ||
readonly=True, | ||
) | ||
amount = fields.Monetary( | ||
required=True, | ||
currency_field='currency_id', | ||
) | ||
cbu = fields.Char( | ||
size=22, | ||
string="CBU", | ||
required=True, | ||
) | ||
photo_dni = fields.Binary( | ||
string="Foto DNI", | ||
store=True, | ||
) | ||
expedient_id = fields.Many2one( | ||
"public_budget.expedient", | ||
string="Expediente", | ||
copy=False, | ||
readonly=True, | ||
) | ||
responsible_user = fields.Many2one( | ||
'res.users', | ||
string="Usuario Responsable", | ||
readonly=True, | ||
) | ||
|
||
@api.constrains('cbu') | ||
def _check_cbu_length(self): | ||
for partner in self: | ||
if partner.cbu and len(partner.cbu) != 22: | ||
raise ValidationError("El CBU debe tener 22 caracteres.") | ||
|
||
@api.constrains('dni') | ||
def _check_dni_length(self): | ||
for partner in self: | ||
if partner.dni and len(partner.dni) != 8: | ||
raise ValidationError("El DNI debe tener 8 caracteres.") | ||
|
||
# def action_view_ticket(self): | ||
# self.ensure_one() | ||
# action = self.env["ir.actions.act_window"]._for_xml_id( | ||
# 'sipreco_subsidy_management.action_sipreco_subsidy_management_subsidy_tickets') | ||
# action['domain'] = [('id', 'in', self.ticket_ids.ids)] | ||
# return action | ||
|
||
@api.model_create_multi | ||
def create(self, list_value): | ||
tickets = super().create(list_value) | ||
for ticket in tickets: | ||
user = http.request.env.user | ||
if user: | ||
ticket.responsible_user = user | ||
return tickets |
Binary file added
BIN
+13.7 KB
sipreco_subsidy_management/reports/report_subsidy_tickets_resolution.ods
Binary file not shown.
49 changes: 49 additions & 0 deletions
49
sipreco_subsidy_management/reports/report_ticket_template.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,49 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo noupdate="1"> | ||
|
||
<!-- Printed Invoice --> | ||
<record id="action_aeroo_subsidy_tickets_resolution_report" model="ir.actions.report"> | ||
<field name="name">Reporte Tabla Resoluciones de Subsidios</field> | ||
<field name="model">helpdesk.ticket</field> | ||
<field name="report_name">subsidy_tickets_resolution_report</field> | ||
<field name="report_type">aeroo</field> | ||
<field name="in_format">oo-ods</field> | ||
<field name="report_file">sipreco_subsidy_management/reports/report_subsidy_tickets_resolution.ods</field> | ||
<field name="tml_source">file</field> | ||
<field name="out_format" ref="report_aeroo.report_mimetypes_xls_odt"/> | ||
<field name="styles_mode">specified</field> | ||
<field name="stylesheet_id" ref="public_budget.sipreco_stylesheet"/> | ||
<field name="binding_model_id" ref="model_helpdesk_ticket"/> | ||
<field name="binding_type">report</field> | ||
</record> | ||
|
||
<record id="action_aeroo_subsidy_tickets_resolution_INSTIT" model="ir.actions.report"> | ||
<field name="name">Resolucion INSTIT</field> | ||
<field name="model">helpdesk.ticket</field> | ||
<field name="report_name">subsidy_tickets_resolution_INSTIT</field> | ||
<field name="report_type">aeroo</field> | ||
<field name="in_format">oo-odt</field> | ||
<field name="report_file">sipreco_subsidy_management/reports/subsidy_tickets_resolution_INSTIT.odt</field> | ||
<field name="tml_source">file</field> | ||
<field name="out_format" ref="report_aeroo.report_mimetypes_doc_odt"/> | ||
<field name="styles_mode">specified</field> | ||
<field name="stylesheet_id" ref="public_budget.sipreco_stylesheet"/> | ||
<field name="binding_model_id" ref="model_helpdesk_ticket"/> | ||
<field name="binding_type">report</field> | ||
</record> | ||
|
||
<record id="action_aeroo_subsidy_tickets_resolution_COMUN_report" model="ir.actions.report"> | ||
<field name="name">Resolucion COMUN</field> | ||
<field name="model">helpdesk.ticket</field> | ||
<field name="report_name">subsidy_tickets_resolution_report_COMUN</field> | ||
<field name="report_type">aeroo</field> | ||
<field name="in_format">oo-odt</field> | ||
<field name="report_file">sipreco_subsidy_management/reports/subsidy_tickets_resolution_COMUN.odt</field> | ||
<field name="tml_source">file</field> | ||
<field name="out_format" ref="report_aeroo.report_mimetypes_doc_odt"/> | ||
<field name="styles_mode">specified</field> | ||
<field name="stylesheet_id" ref="public_budget.sipreco_stylesheet"/> | ||
<field name="binding_model_id" ref="model_helpdesk_ticket"/> | ||
<field name="binding_type">report</field> | ||
</record> | ||
</odoo> |
Binary file added
BIN
+22.3 KB
sipreco_subsidy_management/reports/subsidy_tickets_resolution_COMUN.odt
Binary file not shown.
Binary file added
BIN
+25.1 KB
sipreco_subsidy_management/reports/subsidy_tickets_resolution_INSTIT.odt
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<!-- Add contextual button on partner form view --> | ||
<record id="view_expedients_form" model="ir.ui.view"> | ||
<field name="name">public_budget.expedient.form</field> | ||
<field name="model">public_budget.expedient</field> | ||
<field name="inherit_id" ref="public_budget.view_public_budget_expedient_form"/> | ||
<field name="arch" type="xml"> | ||
<div name="button_box" position="inside"> | ||
<button class="oe_stat_button" type="object" | ||
name="action_open_subsidy_ticket" context="{'default_partner_id': active_id}" icon="fa-life-ring"> | ||
<div class="o_stat_info"> | ||
<span class="o_stat_text"> Subsidies</span> | ||
</div> | ||
</button> | ||
</div> | ||
</field> | ||
</record> | ||
</odoo> |
14 changes: 14 additions & 0 deletions
14
sipreco_subsidy_management/views/subsidy_ticket_director_views.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,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<record id="subsidy_ticket_director_view_form" model="ir.ui.view"> | ||
<field name="name">subsidy.ticket.director.form</field> | ||
<field name="model">helpdesk.ticket</field> | ||
<field name="groups_id" eval="[(4, ref('public_budget.group_secretary_director'))]"/> | ||
<field name="inherit_id" ref="subsidy_ticket_view_form"/> | ||
<field name="arch" type="xml"> | ||
<field name="expedient_id" position="attributes"> | ||
<attribute name="readonly">0</attribute> | ||
</field> | ||
</field> | ||
</record> | ||
</odoo> |
Oops, something went wrong.