Skip to Content
Menu
This question has been flagged

Hi,

I'm trying to create an invoice from a sale order. When using the interface, I can click on 'Create Invoice', this will open a pop-up, giving me few options and allowing to confirm by clickin on 'Create Invoice' again.Trough this process my invoice is generated from a sale order.

I'd like to do it in node.js, so I know I have to call 2 actions:

- invoice_order, which create an invoice from sale order

- create invoices, which validate the pop-up

My problem is, I don't know how and I can't find any example on how to call those methods.

The node package I'm using: https://www.npmjs.com/package/odoo?activeTab=readmeThe only 'example' I could find is the rpc_call, but I keep having errors such as

{ debug: 'Traceback (most recent call last):\n File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 638, in _handle_exception\n return super(JsonRequest, self)._handle_exception(exception)\n File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 675, in dispatch\n result = self._call_function(**self.params)\n File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 331, in _call_function\n return checked_call(self.db, *args, **kwargs)\n File "/usr/lib/python2.7/dist-packages/odoo/service/model.py", line 119, in wrapper\n return f(dbname, *args, **kwargs)\n File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 324, in checked_call\n result = self.endpoint(*a, **kw)\n File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 933, in __call__\n return self.method(*args, **kw)\n File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 504, in response_wrap\n response = f(*args, **kw)\n File "/usr/lib/python2.7/dist-packages/odoo/addons/web/controllers/main.py", line 885, in call_kw\n return self._call_kw(model, method, args, kwargs)\n File "/usr/lib/python2.7/dist-packages/odoo/addons/web/controllers/main.py", line 877, in _call_kw\n return call_kw(request.env[model], method, args, kwargs)\n File "/usr/lib/python2.7/dist-packages/odoo/api.py", line 677, in call_kw\n method = getattr(type(model), name)\nAttributeError: type object \'sale.order\' has no attribute \'invoice_order\'\n',

exception_type: 'internal_error',

message: 'type object \'sale.order\' has no attribute \'invoice_order\'',

name: 'exceptions.AttributeError',

arguments:

[ 'type object \'sale.order\' has no attribute \'invoice_order\'' ] } }

Any lead on how I can directly call methods from odoo ?

Thanks, 

Avatar
Discard
Author Best Answer

Hi

I'm still stuck in this process, any hints ?

Avatar
Discard
Related Posts Replies Views Activity
1
Jun 24
669
1
Nov 22
17411
1
Oct 22
2813
1
Feb 17
2342
2
Jan 17
5802