Review: Needs Fixing Non è sufficiente verificare solo per periodo, in quanto così facendo si possono registrare ancora fatture in tutti i periodi precedenti senza problemi.
Vuoi provare con un sql che ragiona tipo così, legato all'anno e slegato dal numero (conta l'ultima data di registrazione sul sezionale): SELECT max(ai.registration_date) FROM account_invoice ai LEFT JOIN account_period ap ON ai.period_id = ap.id LEFT JOIN account_fiscalyear af ON af.id = ap.fiscalyear_id WHERE ai.journal_id = %s AND af.name = '%s'; -- https://code.launchpad.net/~a-camilli/openobject-italia/6.1-fix-controllo-data-registrazione-consecutiva/+merge/162563 Your team OpenERP Italia core devs is subscribed to branch lp:openobject-italia/6.1. _______________________________________________ Mailing list: https://launchpad.net/~openobject-italia-core-devs Post to : [email protected] Unsubscribe : https://launchpad.net/~openobject-italia-core-devs More help : https://help.launchpad.net/ListHelp

