Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
3 Vastaukset
7814 Näkymät

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
Hylkää
Paras vastaus

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
Hylkää

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

}),

]

})

Paras vastaus

it's useful for me. many thanks.

Avatar
Hylkää
Paras vastaus

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
Hylkää

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.

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
huhtik. 24
1516
1
syysk. 21
3118
1
kesäk. 25
2129
1
tammik. 25
1002
6
syysk. 24
28960