port(14.0): env.flush_all() -> env['base'].flush() (Odoo 14 flush API)
Odoo 14 Environment has no flush_all() (added in Odoo 15+). Use the Odoo 14 global flush via a recordset .flush(). This was raising AttributeError mid-generation, failing ~10 tests + their downstream "no blog.post created" assertions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
6635313f58
commit
8f15037c2c
1 changed files with 2 additions and 2 deletions
|
|
@ -244,7 +244,7 @@ class BlogSchedule(models.Model):
|
|||
'platform_mastodon': enabled_platforms.get('mastodon', True),
|
||||
'platform_linkedin': enabled_platforms.get('linkedin', True),
|
||||
})
|
||||
self.env.flush_all() # persist 'running' log before the API call
|
||||
self.env['base'].flush() # persist 'running' log before the API call
|
||||
|
||||
start = time.monotonic()
|
||||
blog_post = None
|
||||
|
|
@ -323,7 +323,7 @@ class BlogSchedule(models.Model):
|
|||
'error_message': error_msg,
|
||||
'duration_seconds': elapsed,
|
||||
})
|
||||
self.env.flush_all()
|
||||
self.env['base'].flush()
|
||||
raise
|
||||
|
||||
return blog_post
|
||||
|
|
|
|||
Loading…
Reference in a new issue