I have a multi-company environment. For whatever reason, invoice sequence numbers are not be created. I have no idea why. It worked for my first 2 trials, but now I'm getting an error on validating invoices "Constraint Error Invoice Number must be unique per Company!"
The reason why it's not unique is because the invoice number its trying to use is just a slash "/".
I am using a user that is specific to that company. All my Warehouses, Locations, Accounts and Journals are specific to that company as well.
For images please see: imgur.com/a/FZtiN
Log:
2013-05-29 22:05:16,888 436 ERROR mydb openerp.sql_db: bad query: update "account_invoice" set "number"='/' where id = 17
Traceback (most recent call last):
File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\sql_db.py", line 226, in execute
IntegrityError: duplicate key value violates unique constraint "account_invoice_number_uniq"
DETAIL: Key (number, company_id, journal_id, type)=(/, 5, 27, out_invoice) already exists.
2013-05-29 22:05:16,888 436 ERROR mydb openerp.tools.safe_eval: Cannot eval u'action_move_create()'
Traceback (most recent call last):
File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\tools\safe_eval.py", line 241, in safe_eval
File "", line 1, in <module>
File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\osv\orm.py", line 374, in function_proxy
File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\openerp\addons\account\account_invoice.py", line 1012, in action_move_create
File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\openerp\addons\mail\mail_thread.py", line 264, in write
File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\osv\orm.py", line 4270, in write
File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\osv\orm.py", line 4640, in _store_set_values
File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\sql_db.py", line 161, in wrapper
File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\sql_db.py", line 226, in execute
IntegrityError: duplicate key value violates unique constraint "account_invoice_number_uniq"
DETAIL: Key (number, company_id, journal_id, type)=(/, 5, 27, out_invoice) already exists.
2013-05-29 22:05:16,888 436 ERROR mydb openerp.netsvc: Constraint Error
Invoice Number must be unique per Company!
Traceback (most recent call last):
File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\netsvc.py", line 293, in dispatch_rpc
File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\service\web_services.py", line 626, in dispatch
File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\osv\osv.py", line 152, in wrapper
File "C:\Program Files (x86)\OpenERP 7.0-20130413-232416\Server\server\.\openerp\netsvc.py", line 72, in abort_response
except_osv: ('Constraint Error', 'Invoice Number must be unique per Company!')
2013-05-29 22:05:16,904 436 INFO mydb werkzeug: 10.0.4.17 - - [29/May/2013 22:05:16] "POST /web/dataset/exec_workflow HTTP/1.1" 200 -
2013-05-29 22:05:16,921 436 INFO ? werkzeug: 10.0.4.17 - - [29/May/2013 22:05:16] "GET /web/static/src/img/warning.png HTTP/1.1" 200 -

I have the same problem. I am using Versión 7.0-20130510-231240. I tried to cancel and re-validate an invoice which had a mistake and when revalidating I got the "Constraint Error Invoice Number must be unique per Company!" error. After that I am unable to make even a new invoice without getting the error. The next sequence number is ok and I have even tried with a far ahead number so I am sure there is no invoice with that number.
My solution was to review every single accounting type setting by comparing it to a functional company. Fix any errors and then go into the database and manually delete the records without proper invoice numbers. It started working at that point.
I'm having the same problem when I try to validate vendor bills in the accounting module. I'm not sure I understand the way you solve your problem. Could you please provide more details on it?