Odoo Help

0

0
1 Answer
1
Avatar

Ray Carnes

--Ray Carnes--
2737
| 5 2 8
Beaumont, United States
--Ray Carnes--

Business Analyst - Custom Projects

https://www.linkedin.com/in/raycarnes

Ray Carnes
15/05/19 22.14

Create a Server Action (attached to the Purchase Order model) that incorporates the following basic code:

invoice = env['account.invoice'].create({            
          'type': 'in_invoice',
'purchase_id': record.id,
          'partner_id': record.partner_id.id,
})
invoice.purchase_order_change()
You will end up with a DRAFT Vendor Bill in the same way as if you had clicked CREATE (to make a new Vendor Bill) and selected a Purchase Order (to have the received lines at the PO line cost added to that Bill).
Ask a Question
Keep Informed
1 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now