Hi guys,
I created a model "Appointment" with "To invoice" button on the form.
How to create a new invoice from this button using a specific service already exist in the Odoo Products/Services please?
Thanks
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi guys,
I created a model "Appointment" with "To invoice" button on the form.
How to create a new invoice from this button using a specific service already exist in the Odoo Products/Services please?
Thanks
Hi,
You can create a new invoice on button click. For that search the service product and store it in a variable using search method.Then create corresponding invoice by adding that product.
For creating invoice you will have to pass values to the fields which are required for an invoice.
Example
invoice = self.env['account.move'].create({
'move_type': 'out_invoice',
'invoice_date': fields.Date.today(),
'partner_id': self.customer_id.id,
'l10n_in_gst_treatment': self.customer_id.l10n_in_gst_treatment,
'currency_id': self.currency_id.id,
'invoice_line_ids': [(0, 0, {
'product_id': self.product_id })],
})
Regards
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
2
thg 8 22
|
3693 | ||
|
1
thg 4 22
|
2828 | ||
|
1
thg 3 22
|
2044 | ||
|
1
thg 2 22
|
2073 | ||
|
0
thg 2 22
|
1892 |