Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

DataError: invalid input syntax for integer: "product_id"

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
javascriptodoo8.0
1 Répondre
11306 Vues
Avatar
Ranga Dharmapriya

I'm try to  generate mrp order, When click the req button . But when I run my code I got this error?

 Traceback (most recent call last):
  File "D:\Odoo\odoo-v8-osm\openerp\http.py", line 530, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "D:\Odoo\odoo-v8-osm\openerp\http.py", line 567, in dispatch
    result = self._call_function(**self.params)
  File "D:\Odoo\odoo-v8-osm\openerp\http.py", line 303, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "D:\Odoo\odoo-v8-osm\openerp\service\model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "D:\Odoo\odoo-v8-osm\openerp\http.py", line 300, in checked_call
    return self.endpoint(*a, **kw)
  File "D:\Odoo\odoo-v8-osm\openerp\http.py", line 796, in __call__
    return self.method(*args, **kw)
  File "D:\Odoo\odoo-v8-osm\openerp\http.py", line 396, in response_wrap
    response = f(*args, **kw)
  File "D:\Odoo\odoo-v8-osm\addons\web\controllers\main.py", line 935, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "D:\Odoo\odoo-v8-osm\addons\web\controllers\main.py", line 927, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "D:\Odoo\odoo-v8-osm\openerp\api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "D:\Odoo\odoo-v8-osm\addons\mrp\mrp.py", line 929, in action_produce
    production_qty_uom = uom_obj._compute_qty(cr, uid, production.product_uom.id, production_qty, production.product_id.uom_id.id)
  File "D:\Odoo\odoo-v8-osm\openerp\fields.py", line 817, in __get__
    self.determine_value(record)
  File "D:\Odoo\odoo-v8-osm\openerp\fields.py", line 910, in determine_value
    record._prefetch_field(self)
  File "D:\Odoo\odoo-v8-osm\openerp\api.py", line 239, in wrapper
    return new_api(self, *args, **kwargs)
  File "D:\Odoo\odoo-v8-osm\openerp\models.py", line 3211, in _prefetch_field
    result = records.read(list(fnames), load='_classic_write')
  File "D:\Odoo\odoo-v8-osm\openerp\api.py", line 239, in wrapper
    return new_api(self, *args, **kwargs)
  File "D:\Odoo\odoo-v8-osm\openerp\models.py", line 3156, in read
    self._read_from_database(stored, inherited)
  File "D:\Odoo\odoo-v8-osm\openerp\api.py", line 239, in wrapper
    return new_api(self, *args, **kwargs)
  File "D:\Odoo\odoo-v8-osm\openerp\models.py", line 3279, in _read_from_database
    cr.execute(query_str, [tuple(sub_ids)] + where_params)
  File "D:\Odoo\odoo-v8-osm\openerp\sql_db.py", line 158, in wrapper
    return f(self, *args, **kwargs)
  File "D:\Odoo\odoo-v8-osm\openerp\sql_db.py", line 234, in execute
    res = self._obj.execute(query, params)
DataError: invalid input syntax for integer: "product_id"
LINE 2: ...                    WHERE "mrp_production".id IN ('product_i...
                                                             ^
My code

 function openerp_restaurant_reqbill(instance,module){
    var QWeb = instance.web.qweb;
    var _t = instance.web._t;

    module.PosWidget.include({
        build_widgets: function(){
            var self = this;
            this._super();

            if(this.pos.config.iface_raqbill){
                var reqbill = $(QWeb.render('PrintReqButton'));
                reqbill.click(function(){
                    var order = self.pos.get('selectedOrder');
                    if(order.get('orderLines').models.length > 0){
                        var receipt = order.export_for_printing();
                        self.pos.proxy.print_receipt(QWeb.render('BillReceipts',{
                            receipt: receipt, widget: self,
                        }));
                    }
                  self.picking_order();
                });
                reqbill.appendTo(this.$('.control-buttons'));
                this.$('.control-buttons').removeClass('oe_hidden');
            }
        },

        picking_order: function() {
            var self = this;
            var currentOrder = self.pos.get('selectedOrder');
            var a = currentOrder.selected_orderline.collection.models;
            var production_mode = 'consume_produce';
            for(i=0; i< a.length; i++){
                var product_id = (a[i].product.id);
                var product_qty = (a[i].quantity);
                new instance.web.Model("mrp.production").call('action_produce',[('product_id'),('product_qty'),('production_mode')]);
            }
            console.log(currentOrder);
            console.log(a);
            //new instance.web.Model("ir.model.data").get_func("search_read")([['name', '=', 'action_pos_session_opening']], ['res_id'])
            }
    });

}
0
Avatar
Ignorer
Avatar
Emipro Technologies Pvt. Ltd.
Meilleure réponse

Hi,

you have done wrong code inside below line.

new instance.web.Model("mrp.production").call('action_produce',[('product_id'),('product_qty'),('production_mode')])

In this line you have to pass appropriate arguments inside function calling. Your code is going to call function 

def action_produce(self, cr, uid, production_id, production_qty, production_mode, wiz=False, context=None):

So, you have to pass correct argument.

I hope you will resolve your issue.

2
Avatar
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
Javascript on click event in odoo8
javascript click odoo8.0
Avatar
1
déc. 20
5742
JS in Odoo 8
javascript odoo8.0 JavascriptCallFromOdoo
Avatar
Avatar
5
déc. 17
6663
Limiting the number of kanban box?
javascript kanban odoo8.0
Avatar
Avatar
1
avr. 16
5898
Point of sale
javascript point_of_sale odoo8.0
Avatar
Avatar
Avatar
2
avr. 16
4106
Error While Installing Accounting Module in Odoo 19 Enterprise (Works on Another PC)
javascript
Avatar
0
nov. 25
195
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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