콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
2428 화면

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

아바타
취소
관련 게시물 답글 화면 활동
2
8월 22
3772
1
4월 22
2875
1
3월 22
2094
1
2월 22
2117
0
2월 22
1939