Anyone has an example of how to create an invoice with lines and customer data using python for the accountability module?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Hello adfe,
In Odoo you could create Invoice using python as given below :
// Code In Comment
I Hope this information proves helpful to you. Thanks & Regards, Email: odoo@aktivsoftware.com Skype: kalpeshmaheshwari |
// Code
invoice_line_ids = []
line_ids.append(
(
0,
0,
{
"account_id": account.id,
"debit": amount,
"amount_currency": amount,
"quantity": 1,
"credit": 0.0,
"partner_id": partner_id,
"currency_id": self.env.user.company_id.currency_id.id,
"company_currency_id": self.env.user.company_id.currency_id.id,
},
)
)
line_ids.append(
(
0,
0,
{
"name": product_id.name,
"account_id": account_id.id,
"product_id": product_id.id,
"quantity": 1,
"debit": 0.0,
"amount_currency": -amount,
"credit": amount,
"partner_id": partner_id,
"currency_id": self.env.user.company_id.currency_id.id,
"company_currency_id": self.env.user.company_id.currency_id.id,
},
)
)
invoice = self.env["account.move"].create(
{
"partner_id": partner_id,
"commercial_partner_id": partner_id,
"date": datetime.now(),
"journal_id": journal.id,
"move_type": "out_invoice",
"currency_id": currency.id,
"line_ids": line_ids,
"auto_post": False,
}
)
Thank you Jainesh Shah! i really appreciate it, king regards!
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
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ý