Skip to content

Instantly share code, notes, and snippets.

@name1984
name1984 / python
Created September 20, 2024 15:54
Búsqueda de Descuentos por Linea de Orden de Compra
po = env['purchase.order'].search([('state','in', ['purchase','done'])])
f = open("/tmp/myfile.txt", "w")
for line in po:
if line.order_line.filtered(lambda x: x.discount > 0):
f.write(line.name+' '+str(line.create_date)+'\n')
@name1984
name1984 / Json
Created September 12, 2024 12:00
json cancelación
{
"meta": {
"date": "2024-09-11T16:21:22.236Z",
"type": "cancel_invoice"
},
"data": {
"type": "out_invoice",
"cancel_invoice_id": "24BB20003MX3EBL7L",
"customer_amount": 109,
"multicurrency": {
@name1984
name1984 / python
Created September 4, 2024 16:26
error
Traceback (most recent call last):
File "/odoo/odoo-server/odoo/http.py", line 1632, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/odoo/odoo-server/odoo/service/model.py", line 133, in retrying
result = func()
File "/odoo/odoo-server/odoo/http.py", line 1659, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/odoo/odoo-server/odoo/http.py", line 1863, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "/odoo/odoo-server/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
@name1984
name1984 / python
Created September 3, 2024 18:01
error
Traceback (most recent call last):
File "/odoo/odoo-server/odoo/http.py", line 1589, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/odoo/odoo-server/odoo/service/model.py", line 133, in retrying
result = func()
File "/odoo/odoo-server/odoo/http.py", line 1616, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/odoo/odoo-server/odoo/http.py", line 1820, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "/odoo/odoo-server/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
@name1984
name1984 / python
Created August 21, 2024 01:50
error
Traceback (most recent call last):
File "/odoo/odoo-server/odoo/api.py", line 997, in get
cache_value = field_cache[record._ids[0]]
KeyError: <NewId 0x7fa5ac69aef0>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/odoo/odoo-server/odoo/fields.py", line 1161, in __get__
value = env.cache.get(record, self)
@name1984
name1984 / python
Created August 15, 2024 23:50
Error odoo
Traceback (most recent call last):
File "/home/odoo/instance/odoo/odoo/http.py", line 1764, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/home/odoo/instance/odoo/odoo/service/model.py", line 133, in retrying
result = func()
File "/home/odoo/instance/odoo/odoo/http.py", line 1791, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/home/odoo/instance/odoo/odoo/http.py", line 1908, in dispatch
return self.request.registry['ir.http']._dispatch(endpoint)
File "/home/odoo/instance/odoo/addons/website/models/ir_http.py", line 235, in _dispatch
@name1984
name1984 / python
Created August 15, 2024 15:54
Error al abrir reporte de Ganancias y Perdidas TYP
Traceback (most recent call last):
File "/home/odoo/instance/odoo/odoo/models.py", line 5856, in ensure_one
_id, = self._ids
ValueError: not enough values to unpack (expected 1, got 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/odoo/instance/odoo/odoo/http.py", line 1764, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
<xpath expr="//tree" position="attributes">
<attribute name="create">true</attribute>
</xpath>
@name1984
name1984 / python
Created July 9, 2024 04:40
ERROR ODOO
Traceback (most recent call last):
File "/home/odoo/instance/odoo/odoo/tools/cache.py", line 99, in lookup
r = d[key]
File "<decorator-gen-5>", line 2, in __getitem__
File "/home/odoo/instance/odoo/odoo/tools/func.py", line 87, in locked
return func(inst, *args, **kwargs)
File "/home/odoo/instance/odoo/odoo/tools/lru.py", line 34, in __getitem__
a = self.d[obj]
KeyError: ('ir.model.data', <function IrModelData._xmlid_lookup at 0x7fc15dfccd30>, 'grupo_v.invoice_report_paperformat_ortopeck')
@name1984
name1984 / python
Created June 25, 2024 16:00
error server action
Traceback (most recent call last):
File "/odoo/odoo-server/odoo/tools/safe_eval.py", line 362, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "ir.actions.server(294,)", line 14, in <module>
AttributeError: 'Environment' object has no attribute 'add_todo'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/odoo/odoo-server/odoo/http.py", line 1589, in _serve_db