Merge lp:~unifield-team/unifield-server/us-2367-2 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 4382
Proposed branch: lp:~unifield-team/unifield-server/us-2367-2
Merge into: lp:unifield-server
Diff against target: 153 lines (+39/-4) (has conflicts)
6 files modified
bin/addons/msf_cross_docking/cross_docking_view.xml (+1/-1)
bin/addons/msf_doc_import/wizard/wiz_common_import.py (+2/-0)
bin/addons/msf_printed_documents/report/report_reception.py (+4/-0)
bin/addons/stock/stock.py (+4/-0)
bin/addons/stock_override/stock.py (+24/-1)
bin/addons/stock_override/stock_view.xml (+4/-2)
Text conflict in bin/addons/msf_printed_documents/report/report_reception.py
To merge this branch: bzr merge lp:~unifield-team/unifield-server/us-2367-2
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+324387@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jeff Allen (jr.allen) :
Revision history for this message
jftempo (jfb-tempo-consulting) wrote :

Please also add the missing translations.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/msf_cross_docking/cross_docking_view.xml'
2--- bin/addons/msf_cross_docking/cross_docking_view.xml 2016-11-04 12:57:37 +0000
3+++ bin/addons/msf_cross_docking/cross_docking_view.xml 2017-05-22 11:38:53 +0000
4@@ -56,7 +56,7 @@
5 <field name="arch" type="xml">
6 <data>
7 <xpath expr="/form/notebook/page[@string='General Information']/field[@name='move_lines']" position="attributes" >
8- <attribute name="default_get">{'purchase_id': purchase_id, 'reason_type_id': reason_type_id, 'warehouse_id': warehouse_id, 'address_in_id': address_id, 'date_expected': min_date} </attribute>
9+ <attribute name="default_get">{'purchase_id': purchase_id, 'reason_type_id': reason_type_id, 'warehouse_id': warehouse_id, 'address_in_id': address_id, 'date_expected': min_date, 'ext_cu': ext_cu} </attribute>
10 </xpath>
11 </data>
12 </field>
13
14=== modified file 'bin/addons/msf_doc_import/wizard/wiz_common_import.py'
15--- bin/addons/msf_doc_import/wizard/wiz_common_import.py 2017-02-13 17:09:21 +0000
16+++ bin/addons/msf_doc_import/wizard/wiz_common_import.py 2017-05-22 11:38:53 +0000
17@@ -697,6 +697,8 @@
18
19 if picking.partner_id and picking.type == 'in':
20 location_id = picking.partner_id.property_stock_supplier.id
21+ elif picking.ext_cu and picking.type == 'in':
22+ location_id = picking.ext_cu.id
23 elif picking.type == 'in':
24 location_id = get_ref(cr, uid, 'stock', 'stock_location_suppliers')[1]
25 else:
26
27=== modified file 'bin/addons/msf_printed_documents/report/report_reception.py'
28--- bin/addons/msf_printed_documents/report/report_reception.py 2017-04-19 12:52:45 +0000
29+++ bin/addons/msf_printed_documents/report/report_reception.py 2017-05-22 11:38:53 +0000
30@@ -163,12 +163,16 @@
31 return False
32
33 def getPartnerName(self,o):
34+<<<<<<< TREE
35 if o.purchase_id:
36 return o.purchase_id and o.purchase_id.partner_id and o.purchase_id.partner_id.name or False
37 elif o.partner_id:
38 return o.partner_id.name
39 else:
40 return False
41+=======
42+ return o.purchase_id and o.purchase_id.partner_id and o.purchase_id.partner_id.name or (o.ext_cu and o.ext_cu.name)
43+>>>>>>> MERGE-SOURCE
44
45 def getPartnerAddress(self,o):
46 if o.purchase_id:
47
48=== modified file 'bin/addons/stock/stock.py'
49--- bin/addons/stock/stock.py 2017-03-22 09:52:17 +0000
50+++ bin/addons/stock/stock.py 2017-05-22 11:38:53 +0000
51@@ -1848,6 +1848,10 @@
52 """
53 if context is None:
54 context = {}
55+
56+ if context.get('ext_cu', False):
57+ return context['ext_cu']
58+
59 if context.get('move_line', []):
60 try:
61 return context['move_line'][0][2]['location_id']
62
63=== modified file 'bin/addons/stock_override/stock.py'
64--- bin/addons/stock_override/stock.py 2016-11-09 10:00:04 +0000
65+++ bin/addons/stock_override/stock.py 2017-05-22 11:38:53 +0000
66@@ -320,6 +320,7 @@
67 'from_yml_test': fields.boolean('Only used to pass addons unit test', readonly=True, help='Never set this field to true !'),
68 'address_id': fields.many2one('res.partner.address', 'Delivery address', help="Address of partner", readonly=False, states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}, domain="[('partner_id', '=', partner_id)]"),
69 'partner_id2': fields.many2one('res.partner', 'Partner', required=False),
70+ 'ext_cu': fields.many2one('stock.location', string='Ext. C.U.'),
71 'partner_type': fields.related(
72 'partner_id',
73 'partner_type',
74@@ -376,6 +377,18 @@
75 'company_id2': lambda s,c,u,ids,ctx=None: s.pool.get('res.users').browse(c,u,u).company_id.partner_id.id,
76 }
77
78+
79+ def on_change_ext_cu(self, cr, uid, ids, ext_cu, context=None):
80+ if self.pool.get('stock.move').search_exist(cr, uid, [('picking_id', 'in', ids)], context=context):
81+ return {
82+ 'warning': {
83+ 'title': _('Warning'),
84+ 'message': _('You are changing External Consumption Unit, please check that source location of your stock moves are still consistent'),
85+ }
86+ }
87+ return {}
88+
89+
90 def copy_data(self, cr, uid, id, default=None, context=None):
91 if default is None:
92 default = {}
93@@ -2065,7 +2078,7 @@
94 kwargs['move'] is the current move
95 '''
96 move = kwargs['move']
97- return move.location_id.usage == 'supplier'
98+ return move.location_id.usage == 'supplier' or (move.location_id.usage == 'customer' and move.location_id.location_category == 'consumption_unit')
99
100 def _hook_cancel_assign_batch(self, cr, uid, ids, context=None):
101 '''
102@@ -2575,6 +2588,15 @@
103 return [('id', 'in', ids)]
104 return []
105
106+ def _search_filter_cu_partner(self, cr, uid, ids, fields, arg, context=None):
107+ if not arg or not arg[0][2] or not isinstance(arg[0][2], list) or not len(arg[0][2]) == 2:
108+ return []
109+ if context is None:
110+ context = {}
111+ ext_cu = arg[0][2][0]
112+ partner_id = arg[0][2][1]
113+ # TODO: write here the filter
114+ return []
115
116 _columns = {
117 'chained_location_type': fields.selection([('none', 'None'), ('customer', 'Customer'), ('fixed', 'Fixed Location'), ('nomenclature', 'Nomenclature')],
118@@ -2586,6 +2608,7 @@
119 "\n* Fixed Location: The chained location is taken from the next field: Chained Location if Fixed." \
120 "\n* Nomenclature: The chained location is taken from the options field: Chained Location is according to the nomenclature level of product."\
121 ),
122+ 'filter_cu_partner': fields.function(_fake_get, method=True, type='boolean', string='Filter location by ext cu/partner', fnct_search=_search_filter_cu_partner),
123 'chained_options_ids': fields.one2many('stock.location.chained.options', 'location_id', string='Chained options'),
124 'optional_loc': fields.boolean(string='Is an optional location ?'),
125 'stock_real': fields.function(_product_value, method=True, type='float', string='Real Stock', multi="stock"),
126
127=== modified file 'bin/addons/stock_override/stock_view.xml'
128--- bin/addons/stock_override/stock_view.xml 2017-03-21 08:14:52 +0000
129+++ bin/addons/stock_override/stock_view.xml 2017-05-22 11:38:53 +0000
130@@ -559,11 +559,13 @@
131 </script>
132 </html>
133 </group>
134+ <field name="sale_id" invisible="1" />
135 <group colspan="4" col="6">
136 <group colspan="4" col="4">
137 <field name="name" readonly="1"/>
138 <field name="origin" attrs="{'readonly': [('state', 'not in', ['draft', 'auto', 'assigned', 'confirmed'])]}"/>
139- <field name="partner_id2" on_change="on_change_partner(partner_id2, address_id)" required="0" attrs="{'readonly': [('state', 'not in', ['draft', 'waiting', 'confirmed', 'assigned'])]}"/>
140+ <field name="partner_id2" on_change="on_change_partner(partner_id2, address_id)" required="0" attrs="{'readonly': ['|', ('state', 'not in', ['draft', 'waiting', 'confirmed', 'assigned']), ('ext_cu', '!=', False)]}"/>
141+ <field name="ext_cu" on_change="on_change_ext_cu(ext_cu)" attrs="{'readonly': ['|', '|', ('partner_id2', '!=', False), ('sale_id', '!=', False), ('purchase_id', '!=', False)]}" domain="[('location_category', '=', 'consumption_unit')]" />
142 <field name="address_id" invisible="1" />
143 <field name="backorder_id" readonly="1"/>
144 <field name="reason_type_id" widget="selection"
145@@ -664,7 +666,7 @@
146 <group colspan="2" col="2">
147 <separator string="Locations" colspan="2"/>
148 <field name="location_id"
149- domain="[('usage', '!=', 'view'), ('usage', '=', 'supplier'), ('id', '!=', location_dest_id)]"
150+ domain="[('filter_cu_partner', 'in', [parent.ext_cu, parent.partner_id2]), ('usage', '!=', 'view'), ('id', '!=', location_dest_id), '|', '&amp;', ('usage', '=', 'customer'), ('location_category', '=', 'consumption_unit'), ('usage', '=', 'supplier')]"
151 context="{'specific_rules_tree_view': True, 'prodlot_id': prodlot_id, 'product_id': product_id, 'compute_child': False}"
152 attrs="{'readonly': [('from_wkf_line', '=', True)]}"
153 />

Subscribers

People subscribed via source and target branches

to all changes: