Merge lp:~openerp-dev/openobject-client/6.1-opw-573333-ado into lp:openobject-client/6.1

Proposed by Amit Dodiya (OpenERP)
Status: Merged
Approved by: Naresh(OpenERP)
Approved revision: 2075
Merged at revision: 2075
Proposed branch: lp:~openerp-dev/openobject-client/6.1-opw-573333-ado
Merge into: lp:openobject-client/6.1
Diff against target: 10 lines (+1/-0)
1 file modified
bin/widget/view/form_gtk/image.py (+1/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-client/6.1-opw-573333-ado
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Amit Dodiya (OpenERP) (community) Needs Resubmitting
Xavier ALT Pending
Review via email: mp+100075@code.launchpad.net

Description of the change

Hello,

"[FIX] Set filename when uploading an image is broken on 6.1"

Steps:
1). Goto : Settings/Customization/User Interface/Views
2). Open product.normal.form
3). Add "<field name="product_image" widget="image" nolabel="1" filename="default_code"/>" instead of "<field name="product_image" widget="image" nolabel="1"/>"
4). Try to upload image in product.

After adding filename tag "reference" is fill with the name but the field "product_images" is empty.

Thanks,
Amit

To post a comment you must log in.
2058. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2059. By nel

[MERGE]

2060. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2061. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2062. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2063. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2064. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2065. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2066. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2067. By Naresh(OpenERP)

[MERGE]:Fix for OPW:576734

2068. By Naresh(OpenERP)

[MERGE]:OPW:573451

2069. By Naresh(OpenERP)

[MERGE]:OPW:575612

2070. By Naresh(OpenERP)

[MERGE]:OPW:576731

2071. By Naresh(OpenERP)

[MERGE]:OPW:576763

Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello Amit,

The issue is due to lack of setting the fields value in the model field while adding new image ! your fix will just bypass the root cause. It should be something like:
nch@Naresh:~/workspace/OpenERP2012/6.1/client/bin$ bzr diff
=== modified file 'bin/widget/view/form_gtk/image.py'
--- bin/widget/view/form_gtk/image.py 2011-09-26 12:53:49 +0000
+++ bin/widget/view/form_gtk/image.py 2012-07-17 11:06:16 +0000
@@ -114,9 +114,11 @@
         if filename:
             self._value = encodestring(file(filename, 'rb').read())
             self.update_img()
+ self.set_value(self._view.model, self._view.model.mgroup.mfields[self.attrs['name']])
             if self.has_filename and self.has_filename in self._view.model.mgroup.mfields:
                 self._view.model.set({self.has_filename: os.path.basename(filename)}, modified=True)

can you please test this and update your MP accordingly ?

Thanks,
Naresh

review: Needs Fixing
2072. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

2073. By Naresh(OpenERP)

[MERGE]:OPW:576895

2074. By Naresh(OpenERP)

[MERGE]:OPW:576759

2075. By Amit Dodiya<email address hidden>

[FIX] Set filename when uploading an image is broken on 6.1

Revision history for this message
Amit Dodiya (OpenERP) (ado-openerp) wrote :

Hello,

Thanks for the suggestion.

I have check this and updated the code.

Regards,
Amit

review: Needs Resubmitting
Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/widget/view/form_gtk/image.py'
2--- bin/widget/view/form_gtk/image.py 2011-09-26 12:53:49 +0000
3+++ bin/widget/view/form_gtk/image.py 2012-07-19 12:29:18 +0000
4@@ -114,6 +114,7 @@
5 if filename:
6 self._value = encodestring(file(filename, 'rb').read())
7 self.update_img()
8+ self.set_value(self._view.model, self._view.model.mgroup.mfields[self.attrs['name']])
9 if self.has_filename and self.has_filename in self._view.model.mgroup.mfields:
10 self._view.model.set({self.has_filename: os.path.basename(filename)}, modified=True)
11

Subscribers

People subscribed via source and target branches