Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
7912 Vistas

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
Mejor respuesta

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'],

}),

]

})

Mejor respuesta

it's useful for me. many thanks.

Avatar
Descartar
Mejor respuesta

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.

Publicaciones relacionadas Respuestas Vistas Actividad
1
abr 24
1604
1
sept 21
3192
1
jun 25
2207
1
ene 25
1057
6
sept 24
29096