Hello, I am using v9 and I am trying to apply global discount in customer invoices. I am trying the user solution given here:
https://www.odoo.com/forum/help-1/question/how-to-give-discount-on-the-total-of-a-sales-order-6600
I have created a float field called x_global_invoice_discount , I am displaying that field in the account.invoice form and I have placed the method inside the file "/addons/account/models/account_invoice.py" in the class AccountInvoice but I am getting "undifiend object 'apply.discount' in model 'account.invoice'"
If i place the code in the file "/addons/sale/sale.py" in the class AccountInvoice then no error, but nothing happens. I am tailing the log file and the onchange event doesn't trigger :/
I am new in odoo and in python as I was writing in php and java so far... some help will be much appreciated!
The goal is: The user will add all the products he wants, then he will input the discount (eg 10%) and the value of that field should be applied in the discount field in the invoice lines. Finally the order total should be updated. In a most advanced version of this the discount should be put in each customer and applied automatically in the invoice lines.
I can provide additional info and screenshots if needed.