Hi,
I've the following yaml snippets, first is meant to create an invoice, and the second checks if the amount_total is correct or not.
Code:
!record {model: account.invoice, id: euplaza_invoice0}:
account_id: account.a_recv
address_contact_id: base.res_partner_address_3000
address_invoice_id: base.res_partner_address_3000
company_id: base.main_company
currency_id: base.EUR
invoice_line:
- account_id: account.a_sale
name: '[PC1] Basic PC'
price_unit: 400.0
quantity: 1.0
product_id: commission_product
uos_id: product.product_uom_unit
journal_id: account.bank_journal
partner_id: base.res_partner_desertic_hispafuentes
user_id: base.user_root
and
Code:
!python {model: account.invoice}: |
inv = self.browse(cr, uid, ref("euplaza_invoice0"))
assert inv.amount_total == 500
Quote:
ref("euplaza_invoice0")
gives
Quote:
ValueError: No references to base.euplaza_invoice0
I've already checked the yaml_import code, and tried adding forcecreate to !record, but it did not help much either. What do I miss with yaml files?