15.03.26
This commit is contained in:
@@ -2631,6 +2631,17 @@ class LotInvoice(Wizard):
|
|||||||
|
|
||||||
invoicing = StateTransition()
|
invoicing = StateTransition()
|
||||||
|
|
||||||
|
message = StateView(
|
||||||
|
'purchase.create_prepayment.message',
|
||||||
|
'purchase_trade.create_prepayment_message_form',
|
||||||
|
[
|
||||||
|
Button('OK', 'end', 'tryton-ok'),
|
||||||
|
Button('See Invoice', 'see_invoice', 'tryton-go-next'),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
see_invoice = StateAction('account_invoice.act_invoice_form')
|
||||||
|
|
||||||
def transition_start(self):
|
def transition_start(self):
|
||||||
return 'inv'
|
return 'inv'
|
||||||
|
|
||||||
@@ -2775,12 +2786,27 @@ class LotInvoice(Wizard):
|
|||||||
continue
|
continue
|
||||||
lots.append(lot)
|
lots.append(lot)
|
||||||
|
|
||||||
|
invoice = None
|
||||||
if self.inv.type == 'purchase':
|
if self.inv.type == 'purchase':
|
||||||
Purchase._process_invoice([purchase],lots,action,self.inv.pp_pur)
|
Purchase._process_invoice([purchase],lots,action,self.inv.pp_pur)
|
||||||
|
invoice = r.r_lot_p.invoice_line if r.r_lot_p.invoice_line else r.r_lot_p.invoice_line_prov
|
||||||
else:
|
else:
|
||||||
if sale:
|
if sale:
|
||||||
Sale._process_invoice([sale],lots,action,self.inv.pp_sale)
|
Sale._process_invoice([sale],lots,action,self.inv.pp_sale)
|
||||||
return 'end'
|
invoice = r.r_lot_p.invoice_line if r.r_lot_p.sale_invoice_line else r.r_lot_p.sale_invoice_line_prov
|
||||||
|
self.message.invoice = invoice
|
||||||
|
|
||||||
|
return 'message'
|
||||||
|
|
||||||
|
def default_message(self, fields):
|
||||||
|
return {
|
||||||
|
'message': 'The invoice has been successfully created.',
|
||||||
|
}
|
||||||
|
|
||||||
|
def do_see_invoice(self, action):
|
||||||
|
action['views'].reverse() # pour ouvrir en form directement
|
||||||
|
logger.info("*************SEE_INVOICE******************:%s",self.message.invoice)
|
||||||
|
return action, {'res_id':self.message.invoice.id}
|
||||||
|
|
||||||
def end(self):
|
def end(self):
|
||||||
return 'reload'
|
return 'reload'
|
||||||
|
|||||||
Reference in New Issue
Block a user