Storyblok Base
by Mint System GmbH https://www.mint-system.ch/ , Sozialinfo https://www.mint-system.ch/
Odoo
Availability |
Odoo Online
Odoo.sh
On Premise
|
Lines of code | 270 |
Technical Name |
storyblok_base |
License | AGPL-3 |
Website | https://www.mint-system.ch/ |
Storyblok Base
Upload files to storyblok.
Configuration
Setup Storyblok API
Add Storyblok folder and connect with API and model
Once the asset field is updated, the file will be uploaded to Storyblok folder. The asset url and id are stored on the record as 'document_url' and storyblok_asset_id.
Usage
Inherit the Storyblok asset mixin in model with asset field:
class Partner(models.Model):
_name = "res.partner"
_inherit = ["res.partner", "storyblok.asset.mixin"]
Define an inverse method of the asset field:
image_1920 = fields.Image(inverse="_inverse_image_1920")
def _inverse_image_1920(self):
self.upload_asset(self.image_1920)
To prevent upload use storyblok_update context.
self.with_context(storyblok_upload=False).write({"image_1920": filepath})
Maintainer

This module is maintained by Mint System GmbH.
For support and more information, please visit our Website.
Please log in to comment on this module