Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
2285 Näkymät

I have made controller in my module and have created one table similar to the controller(url link), now if user enters the data in url then in my database it should be automaticallly created i.e. in my table

Avatar
Hylkää
Paras vastaus

Create record using Odoo Create method inside your URL controller function


from odoo.http import request
@http.route('/your/url',type='json', auth='user')
def invoice_payment(self, **kwargs):
    request.env['your.table'].create({'name': 'ABC','column2': 'XYX'})
Avatar
Hylkää