{"id":476,"date":"2019-12-14T07:52:23","date_gmt":"2019-12-14T07:52:23","guid":{"rendered":"https:\/\/mellowhost.com\/blog\/?p=476"},"modified":"2019-12-14T07:52:23","modified_gmt":"2019-12-14T07:52:23","slug":"how-to-validate-odoo-invoice-automatically","status":"publish","type":"post","link":"https:\/\/mellowhost.com\/blog\/how-to-validate-odoo-invoice-automatically.html","title":{"rendered":"How to Validate Odoo Invoice Automatically"},"content":{"rendered":"\n<p>You might want to validate your odoo invoices automatically, without bothering your users to go to each vendor\/customer bill and validate them, instead triggering based on certain conditions. It&#8217;s a 4 step code:<\/p>\n\n\n\n<p>First, we get the invoice:<\/p>\n\n\n\n<p><code>invoice_id = self.env['account.invoice'].browse(your_invoice_id)<\/code><\/p>\n\n\n\n<p>Assign the date to it:<\/p>\n\n\n\n<p><code>invoice_id.action_date_assign()<\/code><\/p>\n\n\n\n<p>Create the invoice moves:<\/p>\n\n\n\n<p><code>invoice_id.action_move_create()<\/code><\/p>\n\n\n\n<p>Now you can validate the invoice:<\/p>\n\n\n\n<p><code>invoice_id.invoice_validate()<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You might want to validate your odoo invoices automatically, without bothering your users to go to each vendor\/customer bill and validate them, instead triggering based on certain conditions. It&#8217;s a 4 step code: First, we get the invoice: invoice_id = self.env[&#8216;account.invoice&#8217;].browse(your_invoice_id) Assign the date to it: invoice_id.action_date_assign() Create the invoice moves: invoice_id.action_move_create() Now you can &hellip; <a href=\"https:\/\/mellowhost.com\/blog\/how-to-validate-odoo-invoice-automatically.html\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Validate Odoo Invoice Automatically&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[292,271,293],"tags":[],"_links":{"self":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/476"}],"collection":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/comments?post=476"}],"version-history":[{"count":1,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/476\/revisions"}],"predecessor-version":[{"id":477,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/476\/revisions\/477"}],"wp:attachment":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/media?parent=476"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/categories?post=476"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/tags?post=476"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}