fueggit
fueggit

Reputation: 1043

QWebException: "Expected singleton: supply.conditions(675, 676)" while evaluating

I have qweb template:

<tr t-foreach="company.supply_conditions_status" t-as="supply">
   <td>
      <span t-field="supply.vendor"/>
   </td>
</tr>

my field from *.py file:

supply_conditions_status = fields.One2many('supply.conditions', 'purchase_id', string='Order',copy=True)

Got an error:

QWebException: "Expected singleton: supply.conditions(675, 676)" while evaluating 'company.supply_conditions_status.vendor'

I understand that the problem is that I get tuple. I was trying to use loop but it doesn't work. What can it be solutions to get data from supply_conditions_status?

Upvotes: 1

Views: 271

Answers (2)

Charif DZ
Charif DZ

Reputation: 14751

The problem that vendor field is also a one2many that contains more than one record supply.conditions(675, 676)

<tr t-foreach="company.supply_conditions_status" t-as="supply">
   <td>
      <t t-foreach="supply.vendor" t-as="vendor">
        <span  t-field="vendor"/>,
     </t>
   </td>
</tr>

Upvotes: 2

dccdany
dccdany

Reputation: 836

The loop is fine, the problem is that you have company.supply_conditions_status.vendor somewhere else in the code, loop or remove it :)

Upvotes: 1

Related Questions