Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
7835 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit

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

}),

]

})

Nejlepší odpověď

it's useful for me. many thanks.

Avatar
Zrušit
Nejlepší odpověď

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
Zrušit

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 Odpovědi Zobrazení Aktivita
1
dub 24
1533
1
zář 21
3167
1
čvn 25
2137
1
led 25
1021
6
zář 24
28983