Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0] functions fields in tests are not computed with new api #12254

Closed
JulioSerna opened this issue Jun 1, 2016 · 2 comments
Closed

[8.0] functions fields in tests are not computed with new api #12254

JulioSerna opened this issue Jun 1, 2016 · 2 comments
Assignees

Comments

@JulioSerna
Copy link
Contributor

JulioSerna commented Jun 1, 2016

After this commit some of our tests that are validating the distinct values of the functions fields into process are failing

Impacted versions:

  • 8.0

Steps to reproduce:

  • Create functions field with new api like this invioced2
  • Create tests to validate value for this field before and after the pay invoice

Current behavior:

  • The function fields only is calculated the first time, the second time is not calculated

Expected behavior:

  • The field function must be calculated in all test

Video/Screenshot link (optional):
https://youtu.be/KgHeE3rVXs8

I create this module to test,
https://github.com/JulioSerna/module_test

@rim-odoo
Copy link
Contributor

rim-odoo commented Jun 1, 2016

@rco-odoo Can you have a look at this issue?

@rim-odoo rim-odoo added the OE the report is linked to a support ticket (opw-...) label Jun 1, 2016
moylop260 added a commit to vauxoo-dev/addons-vauxoo that referenced this issue Jun 7, 2016
Currently odoo has the issue odoo/odoo#12254
just for test case.
TODO: Revert this commit when is fix it.

Signed-off-by: Moisés López <moylop260@vauxoo.com>
moylop260 added a commit to vauxoo-dev/addons-vauxoo that referenced this issue Jun 7, 2016
Currently odoo has the issue odoo/odoo#12254
just for test case.
TODO: Revert this commit when is fix it.
nhomar pushed a commit to Vauxoo/addons-vauxoo that referenced this issue Jun 7, 2016
Currently odoo has the issue odoo/odoo#12254
just for test case.
TODO: Revert this commit when is fix it.
@nim-odoo nim-odoo self-assigned this Jun 14, 2016
@nim-odoo
Copy link
Contributor

Hello,

Your field is not correctly defined. For a computed field, you should define the dependencies thanks to @api.depends. In your case, this should probably be the solution:

@api.depends('state', 'invoice_ids')
def _invoiced2(self):
....

Please read https://www.odoo.com/documentation/9.0/reference/orm.html#computed-fields

Regards,

@antonylesuisse antonylesuisse removed the OE the report is linked to a support ticket (opw-...) label Jun 14, 2016
GavyMG pushed a commit to vauxoo-dev/addons-vauxoo that referenced this issue May 19, 2020
Currently odoo has the issue odoo/odoo#12254
just for test case.
TODO: Revert this commit when is fix it.
GavyMG pushed a commit to vauxoo-dev/addons-vauxoo that referenced this issue May 19, 2020
Currently odoo has the issue odoo/odoo#12254
just for test case.
TODO: Revert this commit when is fix it.
GavyMG pushed a commit to vauxoo-dev/addons-vauxoo that referenced this issue Jun 24, 2020
Currently odoo has the issue odoo/odoo#12254
just for test case.
TODO: Revert this commit when is fix it.
GavyMG pushed a commit to vauxoo-dev/product-attribute that referenced this issue Sep 28, 2020
Currently odoo has the issue odoo/odoo#12254
just for test case.
TODO: Revert this commit when is fix it.
GavyMG pushed a commit to vauxoo-dev/product-attribute that referenced this issue Sep 28, 2020
Currently odoo has the issue odoo/odoo#12254
just for test case.
TODO: Revert this commit when is fix it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants