Merge lp:~dorian-kemps/unifield-server/US-3015 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 4917
Proposed branch: lp:~dorian-kemps/unifield-server/US-3015
Merge into: lp:unifield-server
Diff against target: 69 lines (+29/-1) (has conflicts)
3 files modified
bin/addons/msf_profile/data/patches.xml (+4/-0)
bin/addons/msf_profile/msf_profile.py (+18/-1)
bin/addons/product_nomenclature/product_nomenclature.py (+7/-0)
Text conflict in bin/addons/msf_profile/msf_profile.py
To merge this branch: bzr merge lp:~dorian-kemps/unifield-server/US-3015
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+345651@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/msf_profile/data/patches.xml'
2--- bin/addons/msf_profile/data/patches.xml 2018-04-27 09:58:55 +0000
3+++ bin/addons/msf_profile/data/patches.xml 2018-05-16 09:13:40 +0000
4@@ -20,6 +20,10 @@
5 <field name="method">us_4430_set_puf_to_reversal</field>
6 </record>
7
8+ <record id="us_3015_remove_whitespaces_product_description" model="patch.scripts">
9+ <field name="method">us_3015_remove_whitespaces_product_description</field>
10+ </record>
11+
12 <!-- UF8.0 -->
13 <record id="set_sequence_main_nomen" model="patch.scripts">
14 <field name="method">set_sequence_main_nomen</field>
15
16=== modified file 'bin/addons/msf_profile/msf_profile.py'
17--- bin/addons/msf_profile/msf_profile.py 2018-04-27 09:58:55 +0000
18+++ bin/addons/msf_profile/msf_profile.py 2018-05-16 09:13:40 +0000
19@@ -296,7 +296,24 @@
20 cr.execute(update_ji)
21 self._logger.warn('%s JI updated.' % (cr.rowcount,))
22
23-
24+<<<<<<< TREE
25+
26+=======
27+ def us_3015_remove_whitespaces_product_description(self, cr, uid, *a, **b):
28+ # Checking product's description
29+ cr.execute('''SELECT id, name FROM product_template WHERE name LIKE ' %' or name LIKE '% ' ''')
30+ for x in cr.fetchall():
31+ cr.execute('''UPDATE product_template SET name = %s WHERE id = %s''', (x[1].strip(), x[0]))
32+
33+ # Checking product's description in the translations
34+ cr.execute('''SELECT id, value FROM ir_translation
35+ WHERE name = 'product.template,name' AND value LIKE ' %' or value LIKE '% ' ''')
36+ for x in cr.fetchall():
37+ cr.execute('''UPDATE ir_translation SET value = %s WHERE id = %s''', (x[1].strip(), x[0]))
38+
39+ return True
40+
41+>>>>>>> MERGE-SOURCE
42 # UF8.0
43 def set_sequence_main_nomen(self, cr, uid, *a, **b):
44 nom = ['MED', 'LOG', 'LIB', 'SRV']
45
46=== modified file 'bin/addons/product_nomenclature/product_nomenclature.py'
47--- bin/addons/product_nomenclature/product_nomenclature.py 2018-03-05 13:48:00 +0000
48+++ bin/addons/product_nomenclature/product_nomenclature.py 2018-05-16 09:13:40 +0000
49@@ -750,6 +750,10 @@
50 else:
51 raise osv.except_osv(_('Error'), _('No Product Category found for %s. Please contact an accounting member to create a new one for this family.')
52 % vals['nomenclature_description'])
53+
54+ if vals.get('name'):
55+ vals['name'] = vals['name'].strip()
56+
57 return super(product_template, self).create(cr, uid, vals, context)
58
59 def write(self, cr, uid, ids, vals, context=None):
60@@ -760,6 +764,9 @@
61 return True
62 if vals.get('nomen_manda_2'):
63 vals['categ_id'] = self.pool.get('product.nomenclature').browse(cr, uid, vals['nomen_manda_2'], context=context).category_id.id
64+ if vals.get('name'):
65+ vals['name'] = vals['name'].strip()
66+
67 return super(product_template, self).write(cr, uid, ids, vals, context)
68
69 product_template()

Subscribers

People subscribed via source and target branches