I'm using Odoo 14, I added in my project.task:
facture = fields.Many2many('account.move', string='Situation', domain = [('move_type', 'in', ('out_invoice', 'out_refund'))])
So, that every task could have one or multiple invoice (the invoice could be already created, or the user could create one from the form view of project.task
).
I don't want it to be a timesheet invoice, I want the user could create the invoice as from invoice menu.
I added on my form view of tasks this:
<page name="situation" string="Situation">
<field name="facture">
<tree editable="top" create="true">
<field name="name" />
<field name="campaign_id" string="Source"/>
<field name="invoice_partner_display_name" string="Client"/>
<field name="invoice_date" string="Date"/>
<field name="amount_total_signed" string="Total"/>
<field name="amount_residual_signed" string="Reste" />
<field name="payment_state" string="Statut"/>
</tree>
</field>
</page>
Everything works fine until now.
and I got this:
when I click on add a line I got
But when I select, an invoice I got:
and if I click on create instead of select I got:
Instead I want a normal form view of an invoice.
I tried to do
facture = fields.Many2many('account.invoice', string='Situation')
instead of
facture = fields.Many2many('account.move', string='Situation', domain = [('move_type', 'in', ('out_invoice', 'out_refund'))])
But it doesn't work.