Merge lp:~camptocamp/stock-logistic-warehouse/7.0-port-base_product_merge into lp:stock-logistic-warehouse
- 7.0-port-base_product_merge
- Merge into 7.0
Status: | Work in progress |
---|---|
Proposed branch: | lp:~camptocamp/stock-logistic-warehouse/7.0-port-base_product_merge |
Merge into: | lp:stock-logistic-warehouse |
Diff against target: |
391 lines (+154/-125) 4 files modified
base_product_merge/__init__.py (+2/-0) base_product_merge/__openerp__.py (+34/-40) base_product_merge/wizard/base_product_merge.py (+80/-49) base_product_merge/wizard/base_product_merge_view.xml (+38/-36) |
To merge this branch: | bzr merge lp:~camptocamp/stock-logistic-warehouse/7.0-port-base_product_merge |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexandre Fayolle - camptocamp | Needs Resubmitting | ||
Review via email: mp+162121@code.launchpad.net |
Commit message
Description of the change
- 34. By Yannick Vaucher @ Camptocamp
-
[FIX] wrong call to super
- 35. By Alexandre Fayolle - camptocamp
-
[REF] fix spacing
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote : | # |
- 36. By Yannick Vaucher @ Camptocamp
-
[FIX] base_product_merge - add missing import of osv.osv for raising exception
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote : | # |
No idea why _columns are filled it comes from the port from OpenERP
About the update it updates the relation for all one2many but those fields:
MERGE_SKIP_FIELDS = ['product_tmpl_id', 'product_image']
There is no WHERE filtering in the execution of update so nothing is targeted.
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote : | # |
I set it in work in progress as it certainly needs some refactoring
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote : | # |
The source code management for this project has been moved to https:/
Could you resubmit this MP on the new site?
Unmerged revisions
- 36. By Yannick Vaucher @ Camptocamp
-
[FIX] base_product_merge - add missing import of osv.osv for raising exception
- 35. By Alexandre Fayolle - camptocamp
-
[REF] fix spacing
- 34. By Yannick Vaucher @ Camptocamp
-
[FIX] wrong call to super
- 33. By Yannick Vaucher @ Camptocamp
-
[IMP] base_product_merge - retab xml view
- 32. By Yannick Vaucher @ Camptocamp
-
[IMP] base_product_merge - Update license to AGPL
- 31. By Yannick Vaucher @ Camptocamp
-
[IMP] base_product_merge - use orm.TransientModel instead of osv_memory alias
- 30. By Yannick Vaucher @ Camptocamp
-
[MIG] portage of base_product_merge by OpenERP
Preview Diff
1 | === modified file 'base_product_merge/__init__.py' | |||
2 | --- base_product_merge/__init__.py 2011-08-12 12:53:16 +0000 | |||
3 | +++ base_product_merge/__init__.py 2013-05-13 08:54:24 +0000 | |||
4 | @@ -1,1 +1,3 @@ | |||
5 | 1 | import wizard | 1 | import wizard |
6 | 2 | |||
7 | 3 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
8 | 2 | \ No newline at end of file | 4 | \ No newline at end of file |
9 | 3 | 5 | ||
10 | === modified file 'base_product_merge/__openerp__.py' | |||
11 | --- base_product_merge/__openerp__.py 2013-02-13 08:46:41 +0000 | |||
12 | +++ base_product_merge/__openerp__.py 2013-05-13 08:54:24 +0000 | |||
13 | @@ -1,41 +1,30 @@ | |||
14 | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
15 | 2 | ############################################################################## | 2 | ############################################################################## |
16 | 3 | # | 3 | # |
42 | 4 | # Copyright (c) 2011 Camptocamp SA (http://www.camptocamp.com) | 4 | # Author: Guewen Baconnier |
43 | 5 | # All Right Reserved | 5 | # Copyright 2011 Camptocamp SA |
44 | 6 | # | 6 | # |
45 | 7 | # Author : Guewen Baconnier (Camptocamp) | 7 | # This program is free software: you can redistribute it and/or modify |
46 | 8 | # | 8 | # it under the terms of the GNU Affero General Public License as |
47 | 9 | # WARNING: This program as such is intended to be used by professional | 9 | # published by the Free Software Foundation, either version 3 of the |
48 | 10 | # programmers who take the whole responsability of assessing all potential | 10 | # License, or (at your option) any later version. |
49 | 11 | # consequences resulting from its eventual inadequacies and bugs | 11 | # |
50 | 12 | # End users who are looking for a ready-to-use solution with commercial | 12 | # This program is distributed in the hope that it will be useful, |
51 | 13 | # garantees and support are strongly adviced to contract a Free Software | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
52 | 14 | # Service Company | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
53 | 15 | # | 15 | # GNU Affero General Public License for more details. |
54 | 16 | # This program is Free Software; you can redistribute it and/or | 16 | # |
55 | 17 | # modify it under the terms of the GNU General Public License | 17 | # You should have received a copy of the GNU Affero General Public License |
56 | 18 | # as published by the Free Software Foundation; either version 2 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
32 | 19 | # of the License, or (at your option) any later version. | ||
33 | 20 | # | ||
34 | 21 | # This program is distributed in the hope that it will be useful, | ||
35 | 22 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
36 | 23 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
37 | 24 | # GNU General Public License for more details. | ||
38 | 25 | # | ||
39 | 26 | # You should have received a copy of the GNU General Public License | ||
40 | 27 | # along with this program; if not, write to the Free Software | ||
41 | 28 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
57 | 29 | # | 19 | # |
58 | 30 | ############################################################################## | 20 | ############################################################################## |
59 | 31 | 21 | ||
60 | 32 | { | 22 | { |
67 | 33 | "name" : "Base Products Merge", | 23 | 'name' : 'Base Products Merge', |
68 | 34 | "version" : "1.0", | 24 | 'version' : '1.0', |
69 | 35 | "author" : "Camptocamp", | 25 | 'category' : 'Generic Modules/Base', |
70 | 36 | "category" : "Generic Modules/Base", | 26 | 'description':''' |
71 | 37 | "description":""" | 27 | To merge 2 products, select them in the list view and execute the Action 'Merge Products'. |
66 | 38 | To merge 2 products, select them in the list view and execute the Action "Merge Products". | ||
72 | 39 | 28 | ||
73 | 40 | The selected products are deactivated and a new one is created with : | 29 | The selected products are deactivated and a new one is created with : |
74 | 41 | - When a value is the same on each resources : the value | 30 | - When a value is the same on each resources : the value |
75 | @@ -44,14 +33,19 @@ | |||
76 | 44 | - All many2many relations of the 2 resources are created on the new resource. | 33 | - All many2many relations of the 2 resources are created on the new resource. |
77 | 45 | - All the one2many relations (invoices, sale_orders, ...) are updated in order to link to the new resource. | 34 | - All the one2many relations (invoices, sale_orders, ...) are updated in order to link to the new resource. |
78 | 46 | 35 | ||
86 | 47 | """, | 36 | ''', |
87 | 48 | "website": "http://camptocamp.com", | 37 | 'author' : 'Camptocamp', |
88 | 49 | "depends" : ['product'], | 38 | 'website': 'http://camptocamp.com', |
89 | 50 | "init_xml" : [], | 39 | 'depends' : ['product', 'purchase'], |
90 | 51 | "demo_xml" : [], | 40 | 'data' : [ |
91 | 52 | "update_xml" : [ | 41 | 'wizard/base_product_merge_view.xml', |
85 | 53 | "wizard/base_product_merge_view.xml", | ||
92 | 54 | ], | 42 | ], |
95 | 55 | "active": False, | 43 | 'demo' : [], |
96 | 56 | "installable": False | 44 | 'test' : [], |
97 | 45 | 'installable': True, | ||
98 | 46 | 'auto_install' : False, | ||
99 | 47 | 'application' : False, | ||
100 | 48 | |||
101 | 57 | } | 49 | } |
102 | 50 | |||
103 | 51 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
104 | 58 | 52 | ||
105 | === modified file 'base_product_merge/wizard/base_product_merge.py' | |||
106 | --- base_product_merge/wizard/base_product_merge.py 2011-08-12 12:53:16 +0000 | |||
107 | +++ base_product_merge/wizard/base_product_merge.py 2013-05-13 08:54:24 +0000 | |||
108 | @@ -1,59 +1,78 @@ | |||
109 | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
110 | 2 | # -*- coding: utf-8 -*- | ||
111 | 3 | ############################################################################## | 2 | ############################################################################## |
112 | 4 | # | 3 | # |
137 | 5 | # Copyright (c) 2011 Camptocamp SA | 4 | # Author: Guewen Baconnier |
138 | 6 | # @author Guewen Baconnier | 5 | # Copyright 2011 Camptocamp SA |
139 | 7 | # Original code from module base_partner_merge by Tiny and Camptocamp | 6 | # |
140 | 8 | # | 7 | # This program is free software: you can redistribute it and/or modify |
141 | 9 | # WARNING: This program as such is intended to be used by professional | 8 | # it under the terms of the GNU Affero General Public License as |
142 | 10 | # programmers who take the whole responsability of assessing all potential | 9 | # published by the Free Software Foundation, either version 3 of the |
143 | 11 | # consequences resulting from its eventual inadequacies and bugs | 10 | # License, or (at your option) any later version. |
144 | 12 | # End users who are looking for a ready-to-use solution with commercial | 11 | # |
145 | 13 | # garantees and support are strongly adviced to contract a Free Software | 12 | # This program is distributed in the hope that it will be useful, |
146 | 14 | # Service Company | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
147 | 15 | # | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
148 | 16 | # This program is Free Software; you can redistribute it and/or | 15 | # GNU Affero General Public License for more details. |
149 | 17 | # modify it under the terms of the GNU General Public License | 16 | # |
150 | 18 | # as published by the Free Software Foundation; either version 2 | 17 | # You should have received a copy of the GNU Affero General Public License |
151 | 19 | # of the License, or (at your option) any later version. | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
128 | 20 | # | ||
129 | 21 | # This program is distributed in the hope that it will be useful, | ||
130 | 22 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
131 | 23 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
132 | 24 | # GNU General Public License for more details. | ||
133 | 25 | # | ||
134 | 26 | # You should have received a copy of the GNU General Public License | ||
135 | 27 | # along with this program; if not, write to the Free Software | ||
136 | 28 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
152 | 29 | # | 19 | # |
153 | 30 | ############################################################################## | 20 | ############################################################################## |
154 | 31 | 21 | ||
155 | 32 | # TODO : create a base_merge module to provide abstractions for merges ? | 22 | # TODO : create a base_merge module to provide abstractions for merges ? |
156 | 33 | 23 | ||
158 | 34 | from osv import fields, osv | 24 | from openerp.osv import orm, fields, osv |
159 | 35 | from tools.translate import _ | 25 | from tools.translate import _ |
160 | 36 | import tools | 26 | import tools |
167 | 37 | 27 | from osv.orm import browse_record | |
168 | 38 | 28 | ||
169 | 39 | class base_product_merge(osv.osv_memory): | 29 | class BaseProductMerge(orm.TransientModel): |
170 | 40 | """ | 30 | """ Merges two products """ |
165 | 41 | Merges two products | ||
166 | 42 | """ | ||
171 | 43 | _name = 'base.product.merge' | 31 | _name = 'base.product.merge' |
173 | 44 | _description = 'Merges two products' | 32 | _description = 'Merges Two Products' |
174 | 45 | 33 | ||
175 | 46 | _columns = { | 34 | _columns = { |
178 | 47 | } | 35 | 'uom_po_id': fields.selection([('', '')], 'Purchase Unit of Measure',), |
179 | 48 | 36 | 'seller_id': fields.selection([('', '')], 'Seller',), | |
180 | 37 | 'seller_info_id': fields.selection([('', '')], 'SellerInfo'), | ||
181 | 38 | 'supply_method': fields.selection([('', '')], 'Supply method',), | ||
182 | 39 | 'seller_delay': fields.selection([('', '')], 'Supplier Lead Time',), | ||
183 | 40 | 'type': fields.selection([('', '')], 'Product Type',), | ||
184 | 41 | 'uom_id': fields.selection ([('', '')], 'Default Unit Of Measure',), | ||
185 | 42 | 'list_price': fields.selection ([('', '')], 'Sale Price',), | ||
186 | 43 | 'standard_price': fields.selection ([('', '')], 'Cost Price',), | ||
187 | 44 | 'name': fields.selection ([('', '')], 'Name' ,), | ||
188 | 45 | 'procure_method': fields.selection ([('', '')], 'Procurement Method',), | ||
189 | 46 | 'sale_delay': fields.selection ([('', '')], 'Customer Lead Time'), | ||
190 | 47 | 'categ_id': fields.selection ([('', '')], 'Category',), | ||
191 | 48 | 'code': fields.selection ([('', '')], 'Reference' ,), | ||
192 | 49 | 'default_code': fields.selection ([('', '')], 'Reference',), | ||
193 | 50 | 'name_template': fields.selection ([('', '')], 'Name',), | ||
194 | 51 | 'partner_ref': fields.selection ([('', '')], 'Customer',), | ||
195 | 52 | 'lst_price': fields.selection ([('', '')], 'Public Price',), | ||
196 | 53 | 'warranty': fields.selection ([('', '')], 'Warranty',), | ||
197 | 54 | 'produce_delay': fields.selection ([('', '')], 'Manufacturing Lead Time',), | ||
198 | 55 | 'product_manager': fields.selection ([('', '')], 'Product Manager',), | ||
199 | 56 | 'state': fields.selection ([('', '')], 'Status',), | ||
200 | 57 | 'loc_rack': fields.selection ([('', '')], 'Rack',), | ||
201 | 58 | 'loc_row': fields.selection ([('', '')], 'Row',), | ||
202 | 59 | 'loc_case': fields.selection ([('', '')], 'Case',), | ||
203 | 60 | 'description': fields.selection ([('', '')], 'Description',), | ||
204 | 61 | 'description_sale': fields.selection ([('', '')], 'Sale Description',), | ||
205 | 62 | 'description_purchase': fields.selection ([('', '')], 'Purchase Description',) | ||
206 | 63 | } | ||
207 | 64 | |||
208 | 49 | _values = {} | 65 | _values = {} |
209 | 50 | 66 | ||
211 | 51 | MERGE_SKIP_FIELDS = ['product_tmpl_id'] | 67 | MERGE_SKIP_FIELDS = ['product_tmpl_id', 'product_image'] |
212 | 52 | 68 | ||
213 | 53 | def _build_form(self, cr, uid, field_datas, value1, value2): | 69 | def _build_form(self, cr, uid, field_datas, value1, value2): |
214 | 54 | formxml = '''<?xml version="1.0"?> | 70 | formxml = '''<?xml version="1.0"?> |
217 | 55 | <form string="%s"> | 71 | <form string="%s" version="7.0"> |
218 | 56 | <separator colspan="4" string="Select datas for new record"/>''' % _('Merge') | 72 | <separator colspan="4" string="Select datas for new record"/> |
219 | 73 | <group> | ||
220 | 74 | ''' % _('Merge') | ||
221 | 75 | |||
222 | 57 | update_values = {} | 76 | update_values = {} |
223 | 58 | update_fields = {} | 77 | update_fields = {} |
224 | 59 | columns = {} | 78 | columns = {} |
225 | @@ -61,7 +80,6 @@ | |||
226 | 61 | for fid, fname, fdescription, ttype, required, relation, readonly in field_datas: | 80 | for fid, fname, fdescription, ttype, required, relation, readonly in field_datas: |
227 | 62 | if fname in self.MERGE_SKIP_FIELDS: | 81 | if fname in self.MERGE_SKIP_FIELDS: |
228 | 63 | continue | 82 | continue |
229 | 64 | |||
230 | 65 | val1 = value1[fname] | 83 | val1 = value1[fname] |
231 | 66 | val2 = value2[fname] | 84 | val2 = value2[fname] |
232 | 67 | my_selection = [] | 85 | my_selection = [] |
233 | @@ -82,8 +100,16 @@ | |||
234 | 82 | if ttype in ('float', 'integer'): | 100 | if ttype in ('float', 'integer'): |
235 | 83 | my_selection = [(str(val1), str(val1)), (str(val2), str(val2))] | 101 | my_selection = [(str(val1), str(val1)), (str(val2), str(val2))] |
236 | 84 | if ttype in ('many2one'): | 102 | if ttype in ('many2one'): |
239 | 85 | my_selection = [(str(val1.id), val1.name), | 103 | val1_name = val1.name |
240 | 86 | (str(val2.id), val2.name)] | 104 | val2_name = val2.name |
241 | 105 | |||
242 | 106 | if isinstance(val1_name, browse_record): | ||
243 | 107 | val1_name = val1_name.name | ||
244 | 108 | if isinstance(val2_name, browse_record): | ||
245 | 109 | val2_name = val2_name.name | ||
246 | 110 | |||
247 | 111 | my_selection = [(str(val1.id), val1_name), | ||
248 | 112 | (str(val2.id), val2_name)] | ||
249 | 87 | if ttype in ('many2many'): | 113 | if ttype in ('many2many'): |
250 | 88 | update_values.update({fname: [(6, 0, list(set(map(lambda x: x.id, val1 + val2))))]}) | 114 | update_values.update({fname: [(6, 0, list(set(map(lambda x: x.id, val1 + val2))))]}) |
251 | 89 | if my_selection: | 115 | if my_selection: |
252 | @@ -104,11 +130,14 @@ | |||
253 | 104 | update_values.update({fname: val1 or val2}) | 130 | update_values.update({fname: val1 or val2}) |
254 | 105 | 131 | ||
255 | 106 | formxml += """ | 132 | formxml += """ |
256 | 133 | </group> | ||
257 | 107 | <separator colspan="4"/> | 134 | <separator colspan="4"/> |
258 | 108 | <group col="4" colspan="4"> | 135 | <group col="4" colspan="4"> |
259 | 109 | <label string="" colspan="2"/> | 136 | <label string="" colspan="2"/> |
262 | 110 | <button special="cancel" string="Cancel" icon="gtk-cancel"/> | 137 | <footer> |
263 | 111 | <button name="action_merge" string="Merge" type="object" icon="gtk-ok"/> | 138 | <button special="cancel" string="Cancel" icon="gtk-cancel"/> |
264 | 139 | <button name="action_merge" string="Merge" type="object" icon="gtk-ok"/> | ||
265 | 140 | </footer> | ||
266 | 112 | </group> | 141 | </group> |
267 | 113 | </form>""" | 142 | </form>""" |
268 | 114 | return formxml, update_fields, update_values, columns | 143 | return formxml, update_fields, update_values, columns |
269 | @@ -122,10 +151,13 @@ | |||
270 | 122 | return True | 151 | return True |
271 | 123 | 152 | ||
272 | 124 | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): | 153 | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): |
274 | 125 | res = super(base_product_merge, self).fields_view_get(cr, uid, view_id, view_type, context=context, toolbar=toolbar, submenu=submenu) | 154 | if context is None: |
275 | 155 | context = {} | ||
276 | 156 | res = super(BaseProductMerge, self).fields_view_get(cr, uid, view_id, view_type, context=context, toolbar=toolbar, submenu=submenu) | ||
277 | 126 | resource_ids = context.get('active_ids') or [] | 157 | resource_ids = context.get('active_ids') or [] |
278 | 127 | 158 | ||
280 | 128 | self.check_resources_to_merge(cr, uid, resource_ids, context) | 159 | if resource_ids: |
281 | 160 | self.check_resources_to_merge(cr, uid, resource_ids, context) | ||
282 | 129 | 161 | ||
283 | 130 | if not len(resource_ids) == 2: | 162 | if not len(resource_ids) == 2: |
284 | 131 | return res | 163 | return res |
285 | @@ -161,7 +193,7 @@ | |||
286 | 161 | @param ids: id of the wizard | 193 | @param ids: id of the wizard |
287 | 162 | @param context: A standard dictionary for contextual values | 194 | @param context: A standard dictionary for contextual values |
288 | 163 | 195 | ||
290 | 164 | @return : dict to open the new product in a view | 196 | @return: dict to open the new product in a view |
291 | 165 | """ | 197 | """ |
292 | 166 | record_id = context and context.get('active_id', False) or False | 198 | record_id = context and context.get('active_id', False) or False |
293 | 167 | pool = self.pool | 199 | pool = self.pool |
294 | @@ -171,7 +203,7 @@ | |||
295 | 171 | 203 | ||
296 | 172 | res.update(self._values) | 204 | res.update(self._values) |
297 | 173 | resource_ids = context.get('active_ids') or [] | 205 | resource_ids = context.get('active_ids') or [] |
299 | 174 | 206 | ||
300 | 175 | self.check_resources_to_merge(cr, uid, resource_ids, context) | 207 | self.check_resources_to_merge(cr, uid, resource_ids, context) |
301 | 176 | 208 | ||
302 | 177 | resource1 = resource_ids[0] | 209 | resource1 = resource_ids[0] |
303 | @@ -238,5 +270,4 @@ | |||
304 | 238 | """ | 270 | """ |
305 | 239 | pass | 271 | pass |
306 | 240 | 272 | ||
309 | 241 | base_product_merge() | 273 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
308 | 242 | |||
310 | 243 | 274 | ||
311 | === modified file 'base_product_merge/wizard/base_product_merge_view.xml' | |||
312 | --- base_product_merge/wizard/base_product_merge_view.xml 2011-11-07 14:29:04 +0000 | |||
313 | +++ base_product_merge/wizard/base_product_merge_view.xml 2013-05-13 08:54:24 +0000 | |||
314 | @@ -1,39 +1,41 @@ | |||
315 | 1 | <?xml version="1.0"?> | 1 | <?xml version="1.0"?> |
316 | 2 | <openerp> | 2 | <openerp> |
353 | 3 | <data> | 3 | <data> |
354 | 4 | 4 | ||
355 | 5 | <record model="ir.ui.view" id="view_base_product_merge_form"> | 5 | <record model="ir.ui.view" id="view_base_product_merge_form"> |
356 | 6 | <field name="name">base.product.merge.form</field> | 6 | <field name="name">base.product.merge.form</field> |
357 | 7 | <field name="model">base.product.merge</field> | 7 | <field name="model">base.product.merge</field> |
358 | 8 | <field name="type">form</field> | 8 | <field name="arch" type="xml"> |
359 | 9 | <field name="arch" type="xml"> | 9 | <form string="Merge Products" version="7.0"> |
360 | 10 | <form string="Merge Products"> | 10 | <group> |
361 | 11 | <label string="Merge Products"/> | 11 | <label string="Merge Products"/> |
362 | 12 | <button special="cancel" string="Cancel" icon="gtk-cancel"/> | 12 | </group> |
363 | 13 | </form> | 13 | <footer> |
364 | 14 | </field> | 14 | <button special="cancel" string="Cancel" icon="gtk-cancel"/> |
365 | 15 | </record> | 15 | </footer> |
366 | 16 | 16 | </form> | |
367 | 17 | 17 | </field> | |
368 | 18 | <record id="action_base_product_merge_form" model="ir.actions.act_window"> | 18 | </record> |
369 | 19 | <field name="name">Merge Products</field> | 19 | |
370 | 20 | <field name="type">ir.actions.act_window</field> | 20 | <record id="action_base_product_merge" model="ir.actions.act_window"> |
371 | 21 | <field name="res_model">base.product.merge</field> | 21 | <field name="name">Merge Products</field> |
372 | 22 | <field name="view_type">form</field> | 22 | <field name="type">ir.actions.act_window</field> |
373 | 23 | <field name="view_mode">form</field> | 23 | <field name="res_model">base.product.merge</field> |
374 | 24 | <field name="view_id" ref="view_base_product_merge_form"/> | 24 | <field name="view_type">form</field> |
375 | 25 | <field name="target">new</field> | 25 | <field name="view_mode">form</field> |
376 | 26 | </record> | 26 | <field name="view_id" ref="view_base_product_merge_form"/> |
377 | 27 | 27 | <field name="target">new</field> | |
378 | 28 | <record id="ir_val_base_product_merge_form" model="ir.values"> | 28 | </record> |
379 | 29 | <field name="model_id" ref="product.model_product_product" /> | 29 | |
380 | 30 | <field name="object" eval="1" /> | 30 | <record id="action_base_product_merge_form" model="ir.values"> |
381 | 31 | <field name="name">Merge Products</field> | 31 | <field name="model_id" ref="product.model_product_product" /> |
382 | 32 | <field name="key2">client_action_multi</field> | 32 | <field name="object" eval="1" /> |
383 | 33 | <field name="value" eval="'ir.actions.act_window,' + str(ref('action_base_product_merge_form'))"/> | 33 | <field name="name">Merge Products</field> |
384 | 34 | <field name="key">action</field> | 34 | <field name="key2">client_action_multi</field> |
385 | 35 | <field name="model">product.product</field> | 35 | <field name="value" eval="'ir.actions.act_window,' + str(ref('action_base_product_merge'))"/> |
386 | 36 | </record> | 36 | <field name="key">action</field> |
387 | 37 | 37 | <field name="model">product.product</field> | |
388 | 38 | </data> | 38 | </record> |
389 | 39 | |||
390 | 40 | </data> | ||
391 | 39 | </openerp> | 41 | </openerp> |
just curious: why do we need the _columns in BaseProductMerge for 7.0 and not in the original code?
More importantly: are we sure about this:
"""All the one2many relations (invoices, sale_orders, ...) are updated in order to link to the new resource."""
It sounds very very dangerous to me. Or maybe this is only for some of the targeted invoices and sale orders?