Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Nekilnojamasis turtas
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Konsultavimas
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Maistas
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Saulės energijos sistemos
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Kiti
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

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

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
erroraddonsodoo12
2 Replies
74074 Rodiniai
Portretas
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
Portretas
Atmesti
Portretas
Niyas Raphy (Walnut Software Solutions)
Best Answer

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
Portretas
Atmesti
Lima Saudara
Autorius

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

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registracija
Related Posts Replies Rodiniai Veikla
odoo 12 in ubuntu 18.04.4 Error ModuleNotFoundError: No module named 'werkzeug.contrib' Solved
error odoo12
Portretas
Portretas
Portretas
3
rugs. 21
13272
Can not tabbing over readonly field in odoo 12. Help me please !!!
error bug odoo12
Portretas
0
bal. 24
2211
Error when installing "G.C.C - Arabic/English" 'l10n_gcc_invoice' or "K.S.A - Invoice" 'l10n_sa_invoice' Solved
error install addons
Portretas
Portretas
1
rugp. 24
4635
Problems migrating from odoo 12 to odoo 14 Solved
error odoo12 v14
Portretas
Portretas
2
saus. 21
6049
the open box many times in iot box
error Posbox odoo12
Portretas
0
gruod. 19
3763
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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