No-estable: Inicio reporte por operario
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Camilo Gonzalez 2023-09-30 19:15:45 -05:00
parent e40991de02
commit fa850b69ef
5 changed files with 57 additions and 0 deletions

View File

@ -4,6 +4,7 @@ from . import prospect_trace
from . import call
from . import pending_call
from . import user
from . import print_report_by_operator
from .locations import city
from .locations import department
@ -28,6 +29,7 @@ def register():
prospect_trace.MakeCallAskTask,
prospect.ReassignProspectByOperatorStart,
prospect.ReassignProspectByProspectStart,
print_report_by_operator.PrintReportByOperatorStart,
module='sale_opportunity_management', type_='model')
Pool.register(
prospect_trace.ScheduleCall,
@ -35,6 +37,7 @@ def register():
prospect_trace.MakeCall,
prospect.ReassignProspectByOperator,
prospect.ReasignProspectByProspect,
print_report_by_operator.PrintReportByOperator,
module='sale_opportunity_management', type_='wizard')
Pool.register(
module='sale_opportunity_management', type_='report')

View File

@ -0,0 +1,24 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
# from trytond.model import ModelSQL, ModelView, fields
from trytond.wizard import Wizard, StateView, Button # , StateReport
from trytond.model import fields, ModelView
class PrintReportByOperatorStart(ModelView):
'Vista inicial de reporte por operario'
__name__ = 'sale.print_report_by_operator.start'
start_date = fields.Date('Start date')
end_date = fields.Date('End date')
class PrintReportByOperator(Wizard):
'Generar reporte por operario'
__name__ = 'sale.print_report_by_operator'
start = StateView(
'sale.print_report_by_operator.start',
'sale_opportunity_management.print_report_by_operator_start_view_form',
[Button("Cancel", "end", "tryton-cancel"),
Button("Print Report", "print_report", "tryton-ok", default=True)])

View File

@ -0,0 +1,16 @@
<!-- <?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<record model="ir.action.wizard" id="print_report_by_operator_wizard">
<field name="name">Print report by operator</field>
<field name="wiz_name">sale.print_report_by_operator</field>
</record>
<record model="ir.ui.view" id="print_report_by_operator_start_view_form">
<field name="model">sale.print_report_by_operator.start</field>
<field name="type">form</field>
<field name="name">print_report_by_operator_start_form</field>
</record>
<data>
<tryton/> -->

View File

@ -365,7 +365,14 @@ Crear un usuario de rol administrador::
>>> admin.user_admin == True
True
.. Generar reporte por operario y consolidado::
.. >>> PrintReportByOperator = Model.get('sale.print_report_by_operato`r', type='wizard')
.. >>> session_id, _, _ = PrintReportByOperator.create()
.. >>> print_report_by_operator = Wizard('sale.print_report_by_operator', [])
.. >>> print_report_by_operator.form.start_date = date.today()
.. >>> print_report_by_operator.form.end_date = date.today()
.. >>> print_report_by_operator.execute('print_report')
--------
Reportes

View File

@ -0,0 +1,7 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tree>
<field name="start_date" expand="1"/>
<field name="end_date" expand="1"/>
</tree>