How To Call A Python Function While Printing PDF Report in Odoo

Поделиться
HTML-код
  • Опубликовано: 20 окт 2024

Комментарии • 113

  • @abduljabbar8383
    @abduljabbar8383 3 года назад +1

    @Odoo Mates i have done all after so much trys all done thanks for such videos.

    • @OdooMates
      @OdooMates  3 года назад +1

      welcome :)

    • @abduljabbar8383
      @abduljabbar8383 3 года назад

      @@OdooMates Odoo Mates, I want to sum and count values and pass to pdf report can you help me?

  • @mohamedabdelnaser8300
    @mohamedabdelnaser8300 3 года назад +1

    i can print qweb report in any language but it not working in arbic ?

  • @pyland2475
    @pyland2475 2 года назад +1

    hi
    thanks for your tutorial
    i inherit product.template model in my module and add new field on it.
    and i want to show value of this new field in BoM & Structure report. i add column to report but i couldn't pass value in right position in table
    how can i pass value of this field to xml file and compute on it?

  • @abduljabbar8383
    @abduljabbar8383 3 года назад +2

    do you have any video create report through quires?

    • @OdooMates
      @OdooMates  3 года назад +1

      We haven't added yet

    • @abduljabbar8383
      @abduljabbar8383 3 года назад

      @@OdooMates please make video on that or if have material or link on that plz share

  • @malikkamil6596
    @malikkamil6596 2 года назад

    hi i inherit a report and want to call a python function so in python file what should be report name?

  • @sateeshmathapati5522
    @sateeshmathapati5522 3 года назад +1

    Hi @Odoo Mates
    Thank you for the explanation.
    How to download multiple pdf files from tree view ?? not in single pdf file
    Can you just help me out with any suggestion or reference link??

    • @OdooMates
      @OdooMates  3 года назад

      We haven't made a video on it, yet, but its easy, have you checked the working of sale/quotation report ?

  • @abduljabbar8383
    @abduljabbar8383 3 года назад +1

    how i can insert data from query. i am doing that.
    self.env.cr.execute("insert into scms_equ_count(equipment_catagory,tcount) values(select equipment_catagory,count(*) from scms_company_equipment group by equipment_catagory)")
    self.env.cr.commit()

    • @OdooMates
      @OdooMates  3 года назад +1

      INSERT INTO Customers (CustomerName, ContactName, Address, City, PostalCode, Country)
      VALUES ('Cardinal', 'Tom B. Erichsen', 'Skagen 21', 'Stavanger', '4006', 'Norway');

    • @OdooMates
      @OdooMates  3 года назад +1

      www.w3schools.com/sql/sql_insert.asp

  • @erpaltapete5567
    @erpaltapete5567 2 года назад +1

    hi how I can add the total amount in word in the exiting pdf invoice report

    • @OdooMates
      @OdooMates  2 года назад

      ruclips.net/video/l2tvrpfOR1E/видео.html

  • @IM_HUZAIFA-n3d
    @IM_HUZAIFA-n3d 3 года назад +1

    _get_report_values() function is not called when printing. please reply about the issue. I'm using odoo11. render_html() functinon is not working also

  • @alejandrobrun
    @alejandrobrun 5 лет назад +3

    Gracias por compartir tanto conocimiento. Me gustaría un tutorial en el cual se modifique el pos sale

    • @OdooMates
      @OdooMates  5 лет назад +1

      Gracias por los comentarios, seguro que lo agregaremos. Espero que te guste, suscríbete y apoya el canal

  • @abduljabbar8383
    @abduljabbar8383 3 года назад +1

    I want to calculate values against some field in report how i can do that.like i want add value of fields.
    Thanks

    • @OdooMates
      @OdooMates  3 года назад

      from the python function you can calculate and return the value to the template

    • @abduljabbar8383
      @abduljabbar8383 3 года назад

      @@OdooMates thanks. i am new on odoo.

    • @abduljabbar8383
      @abduljabbar8383 3 года назад +1

      How i can pass parameters to report. to filter. any video on that? Thanks.

  • @thanshidhap.p4743
    @thanshidhap.p4743 3 года назад +1

    Hiii odoomate... Thanks for your videos...
    Do you know how to print many2one field using this method... I coldn't get the values.

    • @OdooMates
      @OdooMates  3 года назад +1

      can i see how you tried

    • @thanshidhap.p4743
      @thanshidhap.p4743 3 года назад +1

      @@OdooMates classroom = self.env['class.room'].search([('subject_id','=',i.id)])
      print("classroom",classroom)
      class_lines =[]
      for name in classroom:
      vals={
      'student_name':name.student_name
      }
      class_lines.append(vals)
      print(name.student_name)
      print("classroom",classroom)
      print("class_lines",class_lines)

    • @thanshidhap.p4743
      @thanshidhap.p4743 3 года назад +1

      student_name is a many2one field

    • @OdooMates
      @OdooMates  3 года назад +1

      @@thanshidhap.p4743 use student_name.name

    • @OdooMates
      @OdooMates  3 года назад +1

      @@thanshidhap.p4743 then use student_name.name

  • @0039048
    @0039048 3 года назад +1

    Excuse me, i'm trying to follow your interesting tutorial but i'm not able to print messages on pycharm console. How can i do this? What i have to setup on pycharm and/or in odoo.conf? Thanks a lot

    • @OdooMates
      @OdooMates  3 года назад

      Are you running Odoo with pycharm itself ?

    • @OdooMates
      @OdooMates  3 года назад

      ruclips.net/video/p7SJW36lqVE/видео.html

    • @0039048
      @0039048 3 года назад +1

      @@OdooMates my console seemed to be frozen maybe because pycharm and the odoo service had been running for several days. i restarted pycharm and the project and now i see the messages. Thanks for your help

    • @OdooMates
      @OdooMates  3 года назад

      @@0039048 cool, happy that you have found the solution

  • @O.Salah1
    @O.Salah1 2 года назад +1

    It doesn't seem to work on Odoo 15

    • @OdooMates
      @OdooMates  2 года назад

      in odoo15 it is: _get_report_values

  • @javaidkhan7410
    @javaidkhan7410 2 года назад

    @odoo Mates
    can you have code for qweb report ,that when there is data missing in recored ,then a message display to user to fill the unfilled field

    • @OdooMates
      @OdooMates  2 года назад

      you mean to show some validation message without printing the report ?

  • @abduljabbar8383
    @abduljabbar8383 3 года назад +1

    my function is not calling while printing report.i am trying to print massage but its not coming. Please help. thanks

    • @OdooMates
      @OdooMates  3 года назад

      is the function is written properly ? like class name should be same as report template

    • @abduljabbar8383
      @abduljabbar8383 3 года назад

      @@OdooMates yes all written fine. but on report parameters are not coming

    • @abduljabbar8383
      @abduljabbar8383 3 года назад

      no data showing in report dont now what issue

    • @abduljabbar8383
      @abduljabbar8383 3 года назад

      from odoo import api, models, _
      class ReportPmService(models.AbstractModel):
      _name = 'report.scms.report_pmreport'
      _description = 'first PM Service Report'
      @api.model
      def _get_report_values(self, docids, data=None):
      docs = self.env['scms.company.pm'].browse(docids[0])
      equipments = self.env['scms.company.equipment'].search([('company_name','=',docids[0])])
      equipment_list = []
      for eqi in equipments:
      vals = {
      'name': eqi.company_name,
      'eqi_desc': eqi.equipment_desc,
      'eqi_spec': eqi.equipment_spec,
      }
      equipment_list.append(vals)
      return {
      'doc_ids': docids,
      'doc_model': 'scms.company.pm',
      'data': data,
      'equipment_list': equipment_list,
      }

  • @andresarevalo9312
    @andresarevalo9312 2 года назад

    Excellent content, when you upload a video on how to download a report from the website

  • @AntonyV14
    @AntonyV14 5 лет назад +2

    Good day, this video is helpful , kindly advise if Hospital management module can be shared ?

    • @OdooMates
      @OdooMates  5 лет назад +2

      github.com/odoomates/Development-Tutorials

    • @neilsenarnachellum166
      @neilsenarnachellum166 5 лет назад +1

      @@OdooMates can you please update the github with this new python file patient_card.py in reports folder thanks

    • @OdooMates
      @OdooMates  5 лет назад

      @@neilsenarnachellum166 Sure we will do it now

    • @OdooMates
      @OdooMates  5 лет назад +1

      @@neilsenarnachellum166 Done

    • @neilsenarnachellum166
      @neilsenarnachellum166 5 лет назад +1

      @@OdooMates Thanks

  • @edgarlepelblaires
    @edgarlepelblaires 2 года назад +1

    Hola!
    Saludos desde Paraguay!
    Soy nuevo en Odoo13
    No encuentro un tutorial bien detallado y claro de como imprimir en letras el total de la factura de cliente, impreso desde el POS.
    Tenes algo hecho o podrias hacerlo?
    Gracias!!!!

    • @OdooMates
      @OdooMates  2 года назад

      en el ticket de pos predeterminado o en el informe de la factura, odoo muestra el monto total de forma predeterminada, ¿verdad?

    • @edgarlepelblaires
      @edgarlepelblaires 2 года назад

      @@OdooMates Asi mismo, si lo muestra, el tema es que yo cree una factura personalizada y reemplaze todo codigo Qweb y en ese codigo no pude lograr imprimirlo en letras...
      Me seria de mucha ayuda si me das una mano con esto.

    • @OdooMates
      @OdooMates  2 года назад

      @@edgarlepelblaires www.odoo.com/forum/help-1/how-to-add-amount-in-words-text-to-printed-invoice-83347

    • @edgarlepelblaires
      @edgarlepelblaires 2 года назад

      @@OdooMates Gracias por tu buena predisposicion y tu respuesta, ese link ya lo mire una y otra vez, yo trato de solucionar a travez de las vistas Qweb especificamente report_invoice_document, incluso tengo la funcion en python num2word.py que recibe el numero y devuelve en letras, pero no halle en ninguna parte hay algo que explique como llamar desde la vista QWeb esta funcion... :( de manera detallada y simple.

  • @abduljabbar8383
    @abduljabbar8383 3 года назад +1

    how to use groupby in search_count plz help

    • @OdooMates
      @OdooMates  2 года назад

      Read_group will help ?

  • @paidykumar7197
    @paidykumar7197 4 года назад +2

    using this method loading issues coming ..plz do video on retrieving records using queries instead of ORM.

    • @OdooMates
      @OdooMates  4 года назад

      yes for better speed we can fetch data from table using the queries

    • @abduljabbar8383
      @abduljabbar8383 3 года назад

      @@OdooMates how to fatch data from queries?

  • @abduljabbar8383
    @abduljabbar8383 3 года назад +1

    i found error template not found what to do? plz help

    • @OdooMates
      @OdooMates  3 года назад

      check the given template name is given correctly and imported in manifest file

    • @abduljabbar8383
      @abduljabbar8383 3 года назад

      @@OdooMates thanks brother its working. thanks alote

  • @atchathomas1885
    @atchathomas1885 4 года назад

    hi Odoo Mates
    Please,
    what can we put in the data object

    • @OdooMates
      @OdooMates  4 года назад +1

      The data you need to get in the template, list, list of dict, character etc

  • @tommike2008
    @tommike2008 3 года назад +1

    how to do it in the 14 th version

    • @OdooMates
      @OdooMates  3 года назад

      see: ruclips.net/video/4uTmaruVEek/видео.html

  • @muhammadzulfirusdani1397
    @muhammadzulfirusdani1397 Год назад

    hello it very usefull thank you, but how to change the filename ?

  • @abduljabbar8383
    @abduljabbar8383 3 года назад +1

    I am getting an issues in list only last value is coming?

    • @OdooMates
      @OdooMates  3 года назад +1

      how you add value to list ?

    • @abduljabbar8383
      @abduljabbar8383 3 года назад +1

      @@OdooMates problem solved

    • @abduljabbar8383
      @abduljabbar8383 3 года назад +2

      @@OdooMates thanks. Can you help me i excute query and now want to create list and send data to report

    • @OdooMates
      @OdooMates  3 года назад +1

      @@abduljabbar8383 happy to know it

    • @OdooMates
      @OdooMates  3 года назад +1

      @@abduljabbar8383 what issues you face here ?

  • @sarim6424
    @sarim6424 3 года назад

    Hi.. really appreciate your efforts... Thanks
    I have installed odoo on my local system (windows 10)... I am having an issue... my pdf reports are not getting downloaded instead they get printed in html form and gives this pop-up message: "Unable to find Wkhtmltopdf on this system. The report will be shown in html.". Is there any way I can fix this? I have already installed "Wkhtmltopdf". Some online solutions say to add path in some conf file somewhere inside odoo directory... I have added path to installed Wkhtmltopdf in multiple config files but no success..Please help..

    • @OdooMates
      @OdooMates  3 года назад +1

      Hi, first of all we are not good in windows, still if you can find the odoo configuration file, there is something like setting the bin path

    • @wadhajable
      @wadhajable 3 года назад +2

      first of all be sure if any pdf editor is installed in your system, if not , install one (any pdf reader).
      second in your template: try to change in:


      i hope it help you

    • @OdooMates
      @OdooMates  3 года назад +2

      @@wadhajable thanks for helping

  • @abduljabbar8383
    @abduljabbar8383 3 года назад

    ValueError: External ID not found in the system: SCMS.report_pmreport, I am getting this error when running report. please help

    • @OdooMates
      @OdooMates  3 года назад

      is there a template/record with the name report_pmreport inside the module SCMS ?

  • @hamadakamal3881
    @hamadakamal3881 8 месяцев назад +1

    amazing

    • @OdooMates
      @OdooMates  7 месяцев назад +1

      Thank you! Cheers!