Merge lp:~unifield-team/unifield-server/uf40-little-fixes into lp:unifield-server

Proposed by jftempo
Status: Rejected
Rejected by: jftempo
Proposed branch: lp:~unifield-team/unifield-server/uf40-little-fixes
Merge into: lp:unifield-server
Diff against target: 86 lines (+29/-4)
3 files modified
bin/addons/msf_partner/partner.py (+27/-2)
bin/addons/stock_override/report/report_stock_move_view.xml (+1/-1)
bin/addons/tender_flow/tender_flow_view.xml (+1/-1)
To merge this branch: bzr merge lp:~unifield-team/unifield-server/uf40-little-fixes
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+316872@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

4188. By Quentin THEURET @Amaris

US-1716 [FIX] FIx issue with NoneType context

4187. By Quentin THEURET @Amaris

US-1716 [FIX] Fix creation of empty address on partner during the synchornization and de-activate existing empty address if there is used in an other document

4186. By Quentin THEURET @Amaris

US-2288 [FIX] Remove let me fix error when a user tries to add a Notes in a Confirmed (Waiting) PO

4185. By Quentin THEURET @Amaris

US-2393 [FIX] display partner list on 'Moves analysis' report

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/msf_partner/partner.py'
2--- bin/addons/msf_partner/partner.py 2017-01-20 14:37:30 +0000
3+++ bin/addons/msf_partner/partner.py 2017-02-09 16:28:10 +0000
4@@ -626,6 +626,8 @@
5 return super(res_partner, self).write(cr, uid, ids, vals, context=context)
6
7 def create(self, cr, uid, vals, context=None):
8+ if context is None:
9+ context = {}
10 vals = self.check_pricelists_vals(cr, uid, vals, context=context)
11 if 'partner_type' in vals and vals['partner_type'] in ('internal', 'section', 'esc', 'intermission'):
12 msf_customer = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'stock_location_internal_customers')
13@@ -645,7 +647,7 @@
14 elif pl.type == 'purchase':
15 vals['property_product_pricelist_purchase'] = pl.id
16
17- if not vals.get('address'):
18+ if not context.get('sync_update_execution') and not vals.get('address'):
19 vals['address'] = [(0, 0, {'function': False, 'city': False, 'fax': False, 'name': False, 'zip': False, 'title': False, 'mobile': False, 'street2': False, 'country_id': False, 'phone': False, 'street': False, 'active': True, 'state_id': False, 'type': False, 'email': False})]
20
21 if vals.get('name'):
22@@ -873,6 +875,26 @@
23 '''
24 Remove empty addresses if exist and create the new one
25 '''
26+ def src_addr_link(addresses):
27+ cr.execute("""
28+ SELECT ccu.constraint_name
29+ FROM information_schema.constraint_column_usage ccu
30+ WHERE ccu.table_name = %s AND ccu.table_catalog = %s""", (self._table, cr.dbname))
31+ constraints = cr.fetchall()
32+ cr.execute("""
33+ SELECT kcu.column_name, kcu.table_name
34+ FROM information_schema.key_column_usage kcu
35+ WHERE kcu.table_catalog = %s AND kcu.constraint_name IN %s""", (cr.dbname, tuple([x[0] for x in constraints])))
36+ for column, table in cr.fetchall():
37+ if table == self._table:
38+ continue
39+ cr.execute("""SELECT count(id) FROM %s WHERE %s IN %%s""" % (table, column), (tuple(addresses),))
40+ res = cr.fetchall()
41+ if res[0][0]:
42+ return True
43+
44+ return False
45+
46 if vals.get('partner_id'):
47 domain_dict = {
48 'partner_id': vals.get('partner_id'),
49@@ -894,7 +916,10 @@
50 }
51 domain = [(k, '=', v) for k, v in domain_dict.iteritems()]
52 addr_ids = self.search(cr, uid, domain, context=context)
53- self.unlink(cr, uid, addr_ids, context=context)
54+ if addr_ids and not src_addr_link(addr_ids):
55+ self.unlink(cr, uid, addr_ids, context=context)
56+ elif addr_ids:
57+ self.write(cr, uid, addr_ids, {'active': False}, context=context)
58
59 return super(res_partner_address, self).create(cr, uid, vals, context=context)
60
61
62=== modified file 'bin/addons/stock_override/report/report_stock_move_view.xml'
63--- bin/addons/stock_override/report/report_stock_move_view.xml 2016-12-14 08:13:13 +0000
64+++ bin/addons/stock_override/report/report_stock_move_view.xml 2017-02-09 16:28:10 +0000
65@@ -76,7 +76,7 @@
66 <filter icon="terp-go-home" name="out" string="Outgoing" domain="[('type','=','out')]"/>
67 <separator orientation="vertical"/>
68 <field name="product_id" default_focus="1"/>
69- <field name="partner_id" context="{'contact_display':'partner'}"/>
70+ <field name="partner_id" />
71 <field name="order_type" />
72 <field name="reason_type_id" widget="selection"/>
73 <newline />
74
75=== modified file 'bin/addons/tender_flow/tender_flow_view.xml'
76--- bin/addons/tender_flow/tender_flow_view.xml 2017-01-16 14:20:41 +0000
77+++ bin/addons/tender_flow/tender_flow_view.xml 2017-02-09 16:28:10 +0000
78@@ -210,7 +210,7 @@
79 <data>
80 <field name="details" position="after">
81 <newline />
82- <field name="valid_till" attrs="{'invisible': [('rfq_ok', '=', False)],'readonly': [('state', 'in', ['sourced', 'split', 'rfq_updated', 'draft', 'done', 'cancel', 'confirmed', 'approved', 'except_picking', 'except_invoice'])]}" />
83+ <field name="valid_till" attrs="{'invisible': [('rfq_ok', '=', False)],'readonly': [('state', 'in', ['sourced', 'split', 'rfq_updated', 'draft', 'done', 'cancel', 'confirmed', 'confirmed_wait', 'approved', 'except_picking', 'except_invoice'])]}" />
84 <field name="tender_id" attrs="{'invisible': [('rfq_ok', '=', False)],'readonly': [('state', 'in', ['sourced', 'split', 'rfq_updated', 'done', 'cancel', 'confirmed', 'approved', 'except_picking', 'except_invoice'])]}" />
85 <field name="rfq_ok" invisible="1" />
86 <field

Subscribers

People subscribed via source and target branches

to all changes: