Merge lp:~unifield-team/unifield-server/us-2367 into lp:unifield-server
- us-2367
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 4382 |
Proposed branch: | lp:~unifield-team/unifield-server/us-2367 |
Merge into: | lp:unifield-server |
Diff against target: |
244 lines (+77/-6) (has conflicts) 7 files modified
bin/addons/msf_cross_docking/cross_docking_view.xml (+1/-1) bin/addons/msf_doc_import/wizard/wiz_common_import.py (+5/-1) bin/addons/msf_printed_documents/report/report_reception.py (+4/-0) bin/addons/msf_profile/i18n/fr_MF.po (+13/-0) bin/addons/stock/stock.py (+4/-0) bin/addons/stock_override/stock.py (+44/-1) bin/addons/stock_override/stock_view.xml (+6/-3) Text conflict in bin/addons/msf_printed_documents/report/report_reception.py Text conflict in bin/addons/msf_profile/i18n/fr_MF.po |
To merge this branch: | bzr merge lp:~unifield-team/unifield-server/us-2367 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+320810@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Jeff Allen (jr.allen) : | # |
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-24 07:13:20 +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-04-12 08:42:16 +0000 |
16 | +++ bin/addons/msf_doc_import/wizard/wiz_common_import.py 2017-05-24 07:13:20 +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 | @@ -721,7 +723,9 @@ |
27 | 'reason_type_id': picking.reason_type_id.id, |
28 | 'location_id': location_id, |
29 | 'location_dest_id': location_dest_id, |
30 | - 'name': p_data['name'],} |
31 | + 'name': p_data['name'], |
32 | + 'is_ext_cu': True if picking.ext_cu else False, |
33 | + } |
34 | |
35 | values.update(self.onchange_product_id(cr, uid, False, p_data['id'], location_id, location_dest_id, picking.address_id and picking.address_id.id or False, picking.type, False).get('value', {})) |
36 | |
37 | |
38 | === modified file 'bin/addons/msf_printed_documents/report/report_reception.py' |
39 | --- bin/addons/msf_printed_documents/report/report_reception.py 2017-04-19 12:52:45 +0000 |
40 | +++ bin/addons/msf_printed_documents/report/report_reception.py 2017-05-24 07:13:20 +0000 |
41 | @@ -163,12 +163,16 @@ |
42 | return False |
43 | |
44 | def getPartnerName(self,o): |
45 | +<<<<<<< TREE |
46 | if o.purchase_id: |
47 | return o.purchase_id and o.purchase_id.partner_id and o.purchase_id.partner_id.name or False |
48 | elif o.partner_id: |
49 | return o.partner_id.name |
50 | else: |
51 | return False |
52 | +======= |
53 | + 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) |
54 | +>>>>>>> MERGE-SOURCE |
55 | |
56 | def getPartnerAddress(self,o): |
57 | if o.purchase_id: |
58 | |
59 | === modified file 'bin/addons/msf_profile/i18n/fr_MF.po' |
60 | --- bin/addons/msf_profile/i18n/fr_MF.po 2017-05-22 16:04:34 +0000 |
61 | +++ bin/addons/msf_profile/i18n/fr_MF.po 2017-05-24 07:13:20 +0000 |
62 | @@ -98181,6 +98181,7 @@ |
63 | msgid "Article must be used only in a properly designed programme, need a more detailed description." |
64 | msgstr "L'article doit être uniquement utilisé dans un programme correctement construit, à besoin d'une description plus détaillée." |
65 | |
66 | +<<<<<<< TREE |
67 | #. module: sync_client |
68 | #: view:sync.client.update_received:0 |
69 | msgid "Updates Received" |
70 | @@ -98556,3 +98557,15 @@ |
71 | #, python-format |
72 | msgid "%s_template.xls" |
73 | msgstr "modèle_%s.xls" |
74 | +======= |
75 | +#. module: stock_override |
76 | +#: code:addons/stock_override/stock.py:386 |
77 | +#, python-format |
78 | +msgid "You are changing an External Consumption Unit, please check that source location of your stock moves are still consistent" |
79 | +msgstr "Vous avez changé d'unité de consommation externe, merci de vérifier que vos mouvements de stock sont toujours cohérents" |
80 | + |
81 | +#. module: stock_override |
82 | +#: field:stock.location,filter_partner_id2:0 |
83 | +msgid "Filter location by partner" |
84 | +msgstr "Filtrer l'emplacement de stock par partenaire" |
85 | +>>>>>>> MERGE-SOURCE |
86 | |
87 | === modified file 'bin/addons/stock/stock.py' |
88 | --- bin/addons/stock/stock.py 2017-05-22 16:04:34 +0000 |
89 | +++ bin/addons/stock/stock.py 2017-05-24 07:13:20 +0000 |
90 | @@ -1849,6 +1849,10 @@ |
91 | """ |
92 | if context is None: |
93 | context = {} |
94 | + |
95 | + if context.get('ext_cu', False): |
96 | + return context['ext_cu'] |
97 | + |
98 | if context.get('move_line', []): |
99 | try: |
100 | return context['move_line'][0][2]['location_id'] |
101 | |
102 | === modified file 'bin/addons/stock_override/stock.py' |
103 | --- bin/addons/stock_override/stock.py 2016-11-09 10:00:04 +0000 |
104 | +++ bin/addons/stock_override/stock.py 2017-05-24 07:13:20 +0000 |
105 | @@ -320,6 +320,7 @@ |
106 | 'from_yml_test': fields.boolean('Only used to pass addons unit test', readonly=True, help='Never set this field to true !'), |
107 | '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)]"), |
108 | 'partner_id2': fields.many2one('res.partner', 'Partner', required=False), |
109 | + 'ext_cu': fields.many2one('stock.location', string='Ext. C.U.'), |
110 | 'partner_type': fields.related( |
111 | 'partner_id', |
112 | 'partner_type', |
113 | @@ -376,6 +377,18 @@ |
114 | 'company_id2': lambda s,c,u,ids,ctx=None: s.pool.get('res.users').browse(c,u,u).company_id.partner_id.id, |
115 | } |
116 | |
117 | + |
118 | + def on_change_ext_cu(self, cr, uid, ids, ext_cu, context=None): |
119 | + if self.pool.get('stock.move').search_exist(cr, uid, [('picking_id', 'in', ids)], context=context): |
120 | + return { |
121 | + 'warning': { |
122 | + 'title': _('Warning'), |
123 | + 'message': _('You are changing an External Consumption Unit, please check that source location of your stock moves are still consistent'), |
124 | + } |
125 | + } |
126 | + return {} |
127 | + |
128 | + |
129 | def copy_data(self, cr, uid, id, default=None, context=None): |
130 | if default is None: |
131 | default = {} |
132 | @@ -1335,6 +1348,14 @@ |
133 | |
134 | return False |
135 | |
136 | + def _default_is_ext_cu(self, cr, uid, context=None): |
137 | + if not context: |
138 | + context = {} |
139 | + if context.get('ext_cu', False): |
140 | + return True |
141 | + return False |
142 | + |
143 | + |
144 | def _get_inactive_product(self, cr, uid, ids, field_name, args, context=None): |
145 | ''' |
146 | Fill the error message if the product of the line is inactive |
147 | @@ -1418,6 +1439,7 @@ |
148 | 'from_dpo': fields.function(_get_from_dpo, fnct_search=_search_from_dpo, type='boolean', method=True, store=False, string='From DPO ?'), |
149 | 'sync_dpo': fields.boolean(string='Sync. DPO'), |
150 | 'from_wkf_line': fields.related('picking_id', 'from_wkf', type='boolean', string='Internal use: from wkf'), |
151 | + 'is_ext_cu': fields.boolean(string='Ext. CU'), |
152 | 'fake_state': fields.related('state', type='char', store=False, string="Internal use"), |
153 | 'processed_stock_move': fields.boolean(string='Processed Stock Move'), |
154 | 'inactive_product': fields.function(_get_inactive_product, method=True, type='boolean', string='Product is inactive', store=False, multi='inactive'), |
155 | @@ -1442,6 +1464,7 @@ |
156 | 'inactive_product': False, |
157 | 'inactive_error': lambda *a: '', |
158 | 'has_to_be_resourced': False, |
159 | + 'is_ext_cu': _default_is_ext_cu, |
160 | } |
161 | |
162 | @check_rw_warning |
163 | @@ -2065,7 +2088,7 @@ |
164 | kwargs['move'] is the current move |
165 | ''' |
166 | move = kwargs['move'] |
167 | - return move.location_id.usage == 'supplier' |
168 | + return move.location_id.usage == 'supplier' or (move.location_id.usage == 'customer' and move.location_id.location_category == 'consumption_unit') |
169 | |
170 | def _hook_cancel_assign_batch(self, cr, uid, ids, context=None): |
171 | ''' |
172 | @@ -2575,6 +2598,25 @@ |
173 | return [('id', 'in', ids)] |
174 | return [] |
175 | |
176 | + def _search_filter_partner_ext_cu(self, cr, uid, ids, fields, arg, context=None): |
177 | + if not arg or not arg[0][2] or not isinstance(arg[0][2], list) or not len(arg[0][2]) == 2: |
178 | + return [] |
179 | + if context is None: |
180 | + context = {} |
181 | + |
182 | + partner_id2 = arg[0][2][0] |
183 | + ext_cu = arg[0][2][1] |
184 | + |
185 | + domain = [] |
186 | + if not partner_id2 and not ext_cu: |
187 | + domain = [] |
188 | + elif partner_id2: |
189 | + domain = [('usage', '=', 'supplier')] |
190 | + else: # ext_cu |
191 | + domain = [('usage', '=', 'customer'), ('location_category', '=', 'consumption_unit')] |
192 | + |
193 | + return domain |
194 | + |
195 | |
196 | _columns = { |
197 | 'chained_location_type': fields.selection([('none', 'None'), ('customer', 'Customer'), ('fixed', 'Fixed Location'), ('nomenclature', 'Nomenclature')], |
198 | @@ -2586,6 +2628,7 @@ |
199 | "\n* Fixed Location: The chained location is taken from the next field: Chained Location if Fixed." \ |
200 | "\n* Nomenclature: The chained location is taken from the options field: Chained Location is according to the nomenclature level of product."\ |
201 | ), |
202 | + 'filter_partner_ext_cu': fields.function(_fake_get, method=True, type='boolean', string='Filter location by partner', fnct_search=_search_filter_partner_ext_cu), |
203 | 'chained_options_ids': fields.one2many('stock.location.chained.options', 'location_id', string='Chained options'), |
204 | 'optional_loc': fields.boolean(string='Is an optional location ?'), |
205 | 'stock_real': fields.function(_product_value, method=True, type='float', string='Real Stock', multi="stock"), |
206 | |
207 | === modified file 'bin/addons/stock_override/stock_view.xml' |
208 | --- bin/addons/stock_override/stock_view.xml 2017-05-10 12:47:14 +0000 |
209 | +++ bin/addons/stock_override/stock_view.xml 2017-05-24 07:13:20 +0000 |
210 | @@ -561,11 +561,13 @@ |
211 | </script> |
212 | </html> |
213 | </group> |
214 | + <field name="sale_id" invisible="1" /> |
215 | <group colspan="4" col="6"> |
216 | <group colspan="4" col="4"> |
217 | <field name="name" readonly="1"/> |
218 | <field name="origin" attrs="{'readonly': [('state', 'not in', ['draft', 'auto', 'assigned', 'confirmed'])]}"/> |
219 | - <field name="partner_id2" on_change="on_change_partner(partner_id2, address_id)" required="0" attrs="{'readonly': [('state', 'not in', ['draft', 'waiting', 'confirmed', 'assigned'])]}"/> |
220 | + <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)]}"/> |
221 | + <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')]" /> |
222 | <field name="address_id" invisible="1" /> |
223 | <field name="backorder_id" readonly="1"/> |
224 | <field name="reason_type_id" widget="selection" |
225 | @@ -637,6 +639,7 @@ |
226 | <group colspan="2" col="4"> |
227 | <separator colspan="4" string="Move Information"/> |
228 | <field name="from_wkf_line" invisible="1" /> |
229 | + <field name="is_ext_cu" invisible="1" /> |
230 | <field name="name" invisible="1" colspan="4"/> |
231 | <field name="product_id" |
232 | context="{'location': location_id, 'prodlot_id': prodlot_id, 'compute_child': True, 'available_for_restriction': 'picking', 'search_default_not_restricted': 1}" |
233 | @@ -666,9 +669,9 @@ |
234 | <group colspan="2" col="2"> |
235 | <separator string="Locations" colspan="2"/> |
236 | <field name="location_id" |
237 | - domain="[('usage', '!=', 'view'), ('usage', '=', 'supplier'), ('id', '!=', location_dest_id)]" |
238 | + domain="[('filter_partner_ext_cu', 'in', [parent.partner_id2, parent.ext_cu]), ('usage', '!=', 'view'), ('id', '!=', location_dest_id), '|', '&', ('usage', '=', 'customer'), ('location_category', '=', 'consumption_unit'), ('usage', '=', 'supplier')]" |
239 | context="{'specific_rules_tree_view': True, 'prodlot_id': prodlot_id, 'product_id': product_id, 'compute_child': False}" |
240 | - attrs="{'readonly': [('from_wkf_line', '=', True)]}" |
241 | + attrs="{'readonly': ['|', ('from_wkf_line', '=', True), ('is_ext_cu', '=', True)]}" |
242 | /> |
243 | <field name="product_type" invisible="1"/> |
244 | <field name="location_dest_id" |