Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

TypeError: load() missing 1 required positional argument: 'action_id'

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
erroraddonsodoo12
2 Respuestas
74084 Vistas
Avatar
Lima Saudara

I go this following error when I click a button on my custom addons:


Error:
Odoo Server Error
Traceback (most recent call last):
  File "/opt/odoo/odoo12/odoo/http.py", line 656, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/odoo12/odoo/http.py", line 314, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/opt/odoo/odoo12/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/opt/odoo/odoo12/odoo/http.py", line 698, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/odoo12/odoo/http.py", line 346, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/odoo12/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/odoo12/odoo/http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "/opt/odoo/odoo12/odoo/http.py", line 941, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/odoo12/odoo/http.py", line 519, in response_wrap
    response = f(*args, **kw)
TypeError: load() missing 1 required positional argument: 'action_id'


But not sure from where that following error source since the error log does not refer to any of my customs addons.


So, what should I fix for this..?


UPDATE: Add code.

Here is my models.py

from odoo import api, fields, models, _
import time
from odoo.exceptions import UserError
import logging

_logger = logging.getLogger(__name__)


class invoice(models.Model):
_name = 'account.invoice'
_inherit = 'account.invoice'

printer_data = fields.Text(string="Printer Data", required=False)

@api.multi
def generate_printer_data(self):
tpl = self.env['mail.template'].search([('name', '=', 'Dot Matrix Invoice')])
data = tpl._render_template(tpl.body_html, 'account.invoice', self.id, post_process=False)
self.printer_data = data

@api.multi
def action_invoice_cancel(self):
self.printer_data = ''
return super(invoice, self).action_cancel()

@api.multi
def action_invoice_open(self):
res = super(invoice, self).action_invoice_open()
self.generate_printer_data()
return res


And here is my invoice.xml where the button I click got that error.

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_dotmatrix_invoice" model="ir.ui.view">
<field name="name">view_dotmatrix_invoice</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<header position="inside">
                # I got error when I click this button bellow
<button type="action" string="Dot Matrix" icon="fa-print" custom="print"/>
</header>

<notebook position="inside">
<page string="Dot Matrix">
<button string="Refresh Printer Data" icon="fa-print" states="open" type="object" name="generate_printer_data"/>
<pre>
<field name="printer_data"/>
</pre>
</page>
</notebook>
</field>
</record>
</odoo>




and here is the print_button.js

odoo.define('vit_dotmatrix.print_button', function (require) {
'use strict';

var form_widget = require('web.form_widgets');
var core = require('web.core');

var QWeb = core.qweb;
var _t = core._t;


form_widget.WidgetButton.include({
on_click: function() {
if(this.node.attrs.custom === "print" ){
console.log("print triggered");
var url = "http://localhost/dotmatrix/print.php";

var view = this.getParent();
var printer_data = view.datarecord.printer_data;
if (!printer_data){
alert('No data to print. Please click Update Printer Data');
return;
}
// code ajax printer
console.log(printer_data);

$.ajax({
method : "POST",
url: url,
data: {
printer_data: printer_data
},
success: function(data){
console.log('Success');
console.log(data);
},
error: function(data){
console.log('Failed');
console.log(data);
},
});
}
else{
this._super();
}
}
});
});


That is three related code from my addons.

0
Avatar
Descartar
Avatar
Niyas Raphy (Walnut Software Solutions)
Mejor respuesta

Hi,

The reason of this error is function might be expecting three arguments and you might be called the same function with only two arguments, where the function is expected to call with three arguments, in this case you will get such an error message.


So in your case if you are getting error on clicking the custom button, check the code and corresponding function of the button and see. Or update the question with the necessary code that you have added for the button.


UPDT:

You haven't specified the action to the button, that's why you get the error, you have given the button type as action, so using the name you have to specify which action to execute.


Sample:

<button type="action"
name="%(mrp.action_change_production_qty)d"
string="Update" states="confirmed,planned,progress" class="oe_link"/>

Button Types in Odoo: https://www.youtube.com/watch?v=_aCRtK0xOpQ

Thanks

1
Avatar
Descartar
Lima Saudara
Autor

Hi, thanks for this response, I have updated my questions.

Look forward to your next response :)

Niyas Raphy (Walnut Software Solutions)

See the updated answer

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
odoo 12 in ubuntu 18.04.4 Error ModuleNotFoundError: No module named 'werkzeug.contrib' Resuelto
error odoo12
Avatar
Avatar
Avatar
3
sept 21
13273
Can not tabbing over readonly field in odoo 12. Help me please !!!
error bug odoo12
Avatar
0
abr 24
2212
Error when installing "G.C.C - Arabic/English" 'l10n_gcc_invoice' or "K.S.A - Invoice" 'l10n_sa_invoice' Resuelto
error install addons
Avatar
Avatar
1
ago 24
4638
Problems migrating from odoo 12 to odoo 14 Resuelto
error odoo12 v14
Avatar
Avatar
2
ene 21
6049
the open box many times in iot box
error Posbox odoo12
Avatar
0
dic 19
3764
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now