Skip to content

Commit

Permalink
[FIX] force compute of the field at creation
Browse files Browse the repository at this point in the history
  • Loading branch information
bguillot committed Dec 2, 2024
1 parent 3c9aa38 commit 74268a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion shopinvader_schema_sale/models/sale_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# @author Sébastien BEAU <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models
from odoo import api, fields, models


class SaleOrderLine(models.Model):
Expand All @@ -16,6 +16,7 @@ def _is_visible_in_shopinvader_api(self):
self.ensure_one()
return True

@api.depends("product_id")
def _compute_visible_in_shopinvader_api(self):
for record in self:
record.visible_in_shopinvader_api = record._is_visible_in_shopinvader_api()

0 comments on commit 74268a5

Please sign in to comment.