Closed sivan-koren closed 3 years ago
Hi @sivan-koren !
I think it's probably an ACL's issue, maybe the user hasn't sufficient permissions.
I've try to run go generate
using a basic user (not admin) and as you, no error prompt, but no model generated.
I've check the odoo server logs and can find Access Denied by ACLs for operation: read, uid: 8, model: ir.model.access
.
Note that this log is INFO
so that's why no error reported on go-odoo generator side.
We probably could add lines here https://github.com/skilld-labs/go-odoo/blob/master/generator/cmd/generator.go#L35 that check for 0 model found and explain that ACL's stuff + linked this issue ? Contribution welcomed :-) . What do you think ?
Can you give a try with admin account and tell if it fixed ?
I confirmed the user has full access to the IR stuff in Odoo.
Also tried chmod -R 777 * on src\github.com\skilld-labs\go-odoo.
Still nothing happens.
Let me know if there is more I can try.
I'm running Ubuntu 20 on WSL. I did also try running as root in an elevated prompt and still had no luck.
If I run your example code in go, however, it does create an opportunity. This is very promising. I just can't get the models to generate.
Can you maybe generate more of the stock models that come with Odoo community? Would that work? I need to import sales orders, customers, invoices, purchase orders etc...
Have you try to run directly ./generator/generator -u $user -d $database -p $password --url $url -o /the/path/for/generated/models
? (Basicaly this is what go generate do using env variables)
If same result, you can debug directly in code ./generator/cmd
, rebuild generator
binary to get what step is wrong (client connection / no models found etc...).
Can you maybe generate more of the stock models that come with Odoo community? Would that work? I need to import sales orders, customers, invoices, purchase orders etc...
Could be a good idea to create a "Community Repository" that contains basic/default models
I tried hard coding my credentials into root.go and rebuilding it. Still no output, still no files.
What version of Odoo are you using this on? I'm running 14.0.
I'm pretty sure it's connecting because if I pass a different URL I get: Post "http://localhost:8069/xmlrpc/2/common": dial tcp 127.0.0.1:8069: connect: connection refused
can you add some debug (fmt.Println) inside this func https://github.com/skilld-labs/go-odoo/blob/master/generator/cmd/generator.go#L34 (that's the first method called by the generator), check if it gets models etc... I bet https://github.com/skilld-labs/go-odoo/blob/master/generator/cmd/generator.go#L35 returns no models.
Btw have you check for odoo server's logs ?
I played with it for a while but I didn't succeed in pulling the models.
I ended up using: https://pkg.go.dev/github.com/ausuwardi/godooj@v0.1.1
I'm going to continue with that for now, just because it's working at this point.
I'd be happy to help you with models generation if you have some time. You can contact me at huret.antoine@yahoo.fr, we can plan a call or so. Closing it !
It does not appear that "go generate" is working as expected. No files are being generated and no output is received on stderr or stdout. I may be missing something.
Please let me know if I can provide more information.