Skip to Content
Menú
This question has been flagged
3 Respostes
7904 Vistes

i have used this  method to create customer invoice but  the view appeared is  the journal not customer  invoice 

def create_task_invoice(self):
return {
'name': 'Invoice',
'res_model': 'account.move',
'type': 'ir.actions.act_window',
'view_mode': 'form',
'target': 'new',
'view_id': self.env.ref('account.view_move_form').id,
'context': {
'default_type': 'out_invoice',
'default_state': 'draft',
'default_partner_id': self.partner_id.id,
'default_invoice_line_ids': [(0, 0, {
'product_id': self.design_product_id.id
})],
},
}

Avatar
Descartar
Best Answer

Hi,

For creating invoice from code, see:  https://pastebin.ubuntu.com/p/dctnMk8RgD/

For Creating record from code:  https://www.youtube.com/watch?v=Jssb15ADeyg

Thanks

Avatar
Descartar

Code:

move = self.env['account.move'].create({

'move_type': 'in_invoice',

'date': '2017-01-01',

'partner_id': self.partner_a.id,

'invoice_date': fields.Date.from_string('2017-01-01'),

'currency_id': self.currency_data['currency'].id,

'invoice_payment_term_id': self.pay_terms_a.id,

'invoice_line_ids': [

(0, None, {

'name': self.product_line_vals_1['name'],

'product_id': self.product_line_vals_1['product_id'],

'product_uom_id': self.product_line_vals_1['product_uom_id'],

'quantity': self.product_line_vals_1['quantity'],

'price_unit': self.product_line_vals_1['price_unit'],

'tax_ids': self.product_line_vals_1['tax_ids'],

}),

(0, None, {

'name': self.product_line_vals_2['name'],

'product_id': self.product_line_vals_2['product_id'],

'product_uom_id': self.product_line_vals_2['product_uom_id'],

'quantity': self.product_line_vals_2['quantity'],

'price_unit': self.product_line_vals_2['price_unit'],

'tax_ids': self.product_line_vals_2['tax_ids'],

}),

]

})

Best Answer

it's useful for me. many thanks.

Avatar
Descartar
Best Answer

You can upload invoices straight from the system by clicking on the UPLOAD button. In order to create new customer invoices, select the CREATE button. A new Invoice window will appear on the screen. Here, you will have to enter the details of the new invoice.

Avatar
Descartar

You can upload invoices straight from the system by clicking on the UPLOAD button. In order to create new customer invoices, https://gbplus.net/download-gbwhatsapp-apk/ select the CREATE button. A new Invoice window will appear on the screen. Here, you will have to enter the details of the new invoice.

Related Posts Respostes Vistes Activitat
1
d’abr. 24
1591
1
de set. 21
3187
1
de juny 25
2197
1
de gen. 25
1047
6
de set. 24
29090