0

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:

screenshot, everything's OK

when I click on add a line I got

it's also OK,

But when I select, an invoice I got:

Here appears a problem

and if I click on create instead of select I got:

i don't want this

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.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

1 Answers1

0

Odoo will hide the invoice lines tab when the move type is set to entry which is the default value

The following error:

Error: While parsing modifiers for field invoice_date: for modifier "readonly": Unknown field state in domain

Is shown when Odoo evaluates the field modifiers (One2many field, editable set).

The invoice_date uses the state field in the states attribute. To fix the error, add the state field inside the tree

Kenly
  • 24,317
  • 7
  • 44
  • 60