En el módulo account_invoice está definido PayInvoice

class PayInvoice(Wizard):
'Pay Invoice'
__name__ = 'account.invoice.pay'
start = StateView('account.invoice.pay.start',
'account_invoice.pay_start_view_form', [
Button('Cancel', 'end', 'tryton-cancel'),
Button('OK', 'choice', 'tryton-ok', default=True),
])
choice = StateTransition()
ask = StateView('account.invoice.pay.ask',
'account_invoice.pay_ask_view_form', [
Button('Cancel', 'end', 'tryton-cancel'),
Button('OK', 'pay', 'tryton-ok', default=True),
])
pay = StateTransition()
Y en teoría este es el método que imprime
def print_invoice(self):
'''
Generate invoice report and store it in invoice_report field.
'''
if self.invoice_report_cache:
return
InvoiceReport = Pool().get('account.invoice', type='report')
InvoiceReport.execute([self.id], {})
Cómo debiera definir el nuevo módulo para modificar el workflow? 

Gracias desde ya!

El domingo, 7 de enero de 2018, 17:34:43 (UTC-6), Sergi Almacellas Abellana 
escribió:
>
> El 07/01/18 a les 23:01, Josias Pérez ha escrit: 
> > Buenas tardes,  
> > 
> > Me gustaría saber si existe una forma de imprimir una factura después 
> > que está se ha pagado, no importando si el monto es total o no.  
> > 
> > Se que debo modificar el workflow pero desconozco como modificiarlo en 
> > el módulo account_invoice. 
>
> Tienes que sobreescribir el asistente de pagar factura para añadir una 
> nuevo StateReport que printe el informe de factura. Una vez añadida este 
> estado, debes sobreescribir la transición de pagar para que el siguiente 
> estado se tu nuevo StateReport i no el final. 
>
> Lo deberías hacer en un módulo nuevo, si modificar el account_invoice 
> original. 
>
> Un saludo, 
>
>
> -- 
> Sergi Almacellas Abellana 
> www.koolpi.com 
> Twitter: @pokoli_srk 
>

Responder a