Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
6495 Widoki

i'm using odoo 9 and i want to modify the action on the button print in invoices .So i have created a custom module to override  the function invoice_print to satisfy my conditions but i notice that only the button print in the workflow bar ha been changed ,the other button print which is next to the button Action doesn't apply the modification. I have spend many hours to search the function of this button but i don't know where is the function of this button any help please ?? 

https://ibb.co/BfFDrVY

here is the function that i have modified :

 @api.multi
def invoice_print(self):
 if (self.partner_id.CodeTVA == False) or (self.partner_id.street == False):
        raise UserError(
            _("vous ne pouvez pas lancer l impression. Veuillez remplir le code TVA et/ou l'adresse du partenaire" ))

    elif (self.partner_id.CodeTVA == True) and (self.partner_id.street == True):
        self.ensure_one()
        self.sent = True
    # return self.env['report'].get_action(self, 'account.report_invoice')
    return self.env['report'].get_action(self, 'bi_professional_reports_templates.report_invoice')

  


Awatar
Odrzuć

Did you find a solution ?!

Najlepsza odpowiedź

Have you tried to change the qweb template of the invoice?
the file: "account/views/report_invoice.xml", follow this tutorial: \https://www.odoo.yenthevg.com/inheriting-and-modifying-qweb-reports/

Awatar
Odrzuć
Autor

My major problem that when i modify this function the button "print" which is next to the button "Action" does not change his behaviour . In other way i could not find the function of this button could you help me please ?

it's a build in function in odoo. As soon as you define a qweb template for a certain model, it's displayed. You can't change the "action" behind it, only the resulting rendered report

Autor

yes i notice the modification of my report but it's not the case for the action but i said maybe there is a another solution for that

Powiązane posty Odpowiedzi Widoki Czynność
1
paź 21
4618
2
maj 19
6392
2
maj 19
9073
0
lut 19
2389
0
sty 19
3718