I am creating a custom app and want to display product images already stored in the MRP app, within my custom app. Is there a way to add some sort of link or do I have to pull the binary data for the image across somehow to display it in my own Binary or Image field?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
Hi,
You can use related field. So it won't be saved in the db.
image_field = fields.Image('Image', related="product_id.image_variant_1920")
(considering it's from product.product).
And give xml ->
<field name="image_field" widget="image"/>
Regards
Thanks for your reply. I am not understanding how I match the image in the MRP Module with my custom module. Would you be able to explain how 'related' works across different modules?
In my module I am storing the Manufacturing Order for a product thats defined in MRP module - the id starting WH/MO/.... and I had hoped to use this to find the relevant image stored in products.
In the related bit of your example you have product_id - is this a field called 'product_id', or is it the 'id' field in the product model?
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
1
gru 22
|
5062 | ||
|
2
gru 23
|
6827 | ||
|
3
lip 20
|
8910 | ||
|
4
gru 15
|
11848 | ||
|
1
mar 15
|
9103 |