I fiddled around with the form view, as I wanted to add a second image to the product basic form.
Therefore, I first created the field:
- Settings - Databse Structure - Models
- searched for product.template
- Edited this model by adding a new field called "x_secondpicture" of type binary
Then, I activated the developer mode and wanted to edit the form view:
- Sales - Products - selected Form View - > "Manage Views"
- Selected "product.template.common.form" and clicked "edit"
- Found the node for the first image and clicked on "+" to insert a new node.
But now, I have two problems:
- For the second field, the widget "image" is not available - in fact no other widget except "manytomanyattendee" is available
- I inadvertently messed around with the original image node, and now I only have a download link available - I can't edit anything anymore.
Who can help?
Could you post your module code to a public repository so that others can take a look? I've been working on another module to add multiple product images to product.template with the help of another developer that may be of interest to you:
If you are trying to add an image directly next to the other image widget on the product.template I think you will need to first check that you have your field inside product.template and then you will need to inherit the product_template_form_view and use xpath to insert your custom field directly after the following line:
<field name="image_medium" widget="image" class="oe_avatar oe_left"/>
I've built a very basic module to achieve what you've described above here:
just do a:
sudo git clone https://github.com/lukebranch/product_images/tree/master
in your /addons folder and install it and you should be good to go.
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 12/10/14, 9:06 AM|
|Seen: 1180 times|
|Last updated: 3/16/15, 8:10 AM|