In below api controller, after printing the values it is not going on next line where Vals Dictionary is created, it is directly goes to the exception. Please guide me where the problem is.
class ApiResellerControllersModule(http.Controller):
@http.route('/web/session/get_reseller_info', type='json', auth="public", csrf=False)
def get_reseller_info(self, **kw):
try:
print(kw.get('reseller'))
print(kw.get('description'))
print(kw.get('amount'))
print(kw.get('attachment'))
print(kw.get('payment_type'))
print(kw.get('token'))
vals = {
"partner_id": 1176,
"journal_id": 1,
"company_id": 1,
"journal_remarks": ('%s - %s' % kw.get('reseller'), kw.get('description')),
"type": "out_invoice",
"invoice_line_ids": [(0, 0, {
"product_id": 1925,
"quantity": 1,
"price_subtotal": kw.get('amount')
})],
}
print(vals)
invoice = http.request.env['account.move'].create(vals)
print(invoice)
data = {
"status": "200",
"message": "Success",
"invoice_id": invoice.id,
"response": {
'Invoice Created Successfully'
},
}
return data
except Exception as e:
data = {
"status": "400",
"message": "Not found",
"response": {},
}
return data
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Бухгалтерия
- Склад
- PoS
- Project
- MRP
Этот вопрос был отмечен
1829
Представления
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
РегистрацияRelated Posts | Ответы | Просмотры | Активность | |
---|---|---|---|---|
|
2
окт. 20
|
4713 | ||
|
0
авг. 20
|
1847 | ||
|
0
мар. 20
|
19292 | ||
|
0
янв. 21
|
2878 | ||
|
2
сент. 20
|
11152 |
I think your issue happened during the invoice creation. did you check the odoo log file?