In my country every electronic invoice is required by law to include a field called "Control Code".
The control code is computed by a series of calculations and algorithms using the invoice date, the invoice number and a few custom fields.
Right now I already have a Python script that generates the control code, but it is a stand alone script, which requires you to manually insert the variables.
I really would like to use this script inside an OpenERP module. I would like the script to:
Validate an Invoice (with all the required fields)
Populate the control code field on the invoice with the result of the Python script.
Ensure the invoice is validated and the Field Control Code is stored in the invoice.