How To Override Create Function in Odoo

Поделиться
HTML-код
  • Опубликовано: 19 авг 2019
  • #overridecreatemethod #supermethodinodoo #odootutorials
    Steps for overriding the create function/method in Odoo12. How to override the create method in Odoo.
    Email: odoomates@gmail.com
  • НаукаНаука

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

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

    please make detailed video on self.env.create() self.env.write(). Please

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

    Hello! How can I overwrite the WRITE() method in the original module with a custom module using inheritance?

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

      Yes may I know the case for you need to do so ? It's possible we have to copy the original write function and rewrite it as per the need

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

    help: how can create a button in a custom module that generates an invoice. thanks

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

      You can refer how the invoice is created from sales module. Refer the function named _create_invoice in sale.order model

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

    How can I overide create button method in tree to open other for model?

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

      you may have to use automated action for this

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

    I am trying to override
    _compute_amount in custom one2many for calculation
    (class SalesEstimateLine(models.Model):
    _name = 'sales.estimate.line') this is the calls where one2many line
    price_subtotal = fields.Monetary(compute='_compute_amount', string='Subtotal', readonly=True, store=True)
    this is the override
    class SaleOrderInhert(models.Model):
    _inherit = 'sale.order'
    def _compute_amount(self):
    res = super(SaleOrderInhert, self)._compute_amount()
    return res

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

    hello odoo Mates please i need a help how i can create access rights management in odoo 12

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

      we have released video about it already: ruclips.net/video/mzg3EGD_6Gw/видео.html

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

    Hello odoomates,
    Please do the videos on odoo JavaScript, odoo pos JavaScript...

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

    How to override create function to create a user in odoo 12?

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

      simply you can call the create function of the other model like this: ruclips.net/video/Jssb15ADeyg/видео.html

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

    Hello! Why do we need to override a method? Could you please explain the purpose of overriding?

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

      a sample case where we need to override create method is shown here: ruclips.net/video/7gP9GBYj-qY/видео.html

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

      @@OdooMates Thank you so much! Do you have a tutorial for mass mailing?

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

    Help. How to override create function in odoo 13. Thanks

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

      You can follow the same steps as of 12

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

      @@OdooMates I did but it's not calling the create function. I even put print function to test if the overriding works, but it's not printing.

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

      @@kevinmarvincalda6929 Make sure the python file is called in the init file

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

      @@OdooMates hello sir, the override is now working. It's weird because, I'm pretty sure the code that I just wrote this morning is the same last night, but when I woke up, boot up my laptop again and wrote the code, it works. Maybe I missed something on my code or have something to do with the OS that I'm using(Windows)? Anyways, thank you so much for your help sir, I really appreciate it. I am one of your subscriber and I hope that this channel will grow. :) God bless

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

      Hi, have been trying to override a required field in a form to false. Have tried two of your methods and I dnt seem to get it to work. Most of the time the server stops responding. Kindly help