Merge lp:~dorian-kemps/unifield-server/US-5894 into lp:unifield-server
- US-5894
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 5533 |
Proposed branch: | lp:~dorian-kemps/unifield-server/US-5894 |
Merge into: | lp:unifield-server |
Diff against target: |
243 lines (+60/-16) 8 files modified
bin/addons/msf_profile/i18n/fr_MF.po (+7/-4) bin/addons/purchase/__init__.py (+0/-1) bin/addons/purchase/purchase_order.py (+2/-2) bin/addons/purchase/purchase_order_line.py (+1/-1) bin/addons/purchase_override/purchase.py (+1/-1) bin/addons/tender_flow/__init__.py (+15/-0) bin/addons/tender_flow/tender_flow.py (+32/-6) bin/addons/tender_flow/tender_flow_view.xml (+2/-1) |
To merge this branch: | bzr merge lp:~dorian-kemps/unifield-server/US-5894 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email:
|
Commit message
Description of the change
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/i18n/fr_MF.po' | |||
2 | --- bin/addons/msf_profile/i18n/fr_MF.po 2019-10-15 16:08:57 +0000 | |||
3 | +++ bin/addons/msf_profile/i18n/fr_MF.po 2019-10-17 13:49:09 +0000 | |||
4 | @@ -8931,12 +8931,14 @@ | |||
5 | 8931 | msgid "! - Requires national export license" | 8931 | msgid "! - Requires national export license" |
6 | 8932 | msgstr "! - Nécessite une licence d'exportation nationale" | 8932 | msgstr "! - Nécessite une licence d'exportation nationale" |
7 | 8933 | 8933 | ||
9 | 8934 | #. modules: purchase, purchase_override, sale | 8934 | #. modules: purchase, purchase_override, sale, tender_flow |
10 | 8935 | #: selection:purchase.order.line,state:0 | 8935 | #: selection:purchase.order.line,state:0 |
11 | 8936 | #: selection:purchase.order.merged.line,state:0 | 8936 | #: selection:purchase.order.merged.line,state:0 |
12 | 8937 | #: selection:sale.order.line,state:0 | 8937 | #: selection:sale.order.line,state:0 |
13 | 8938 | #: selection:purchase.order.line,state_to_display:0 | 8938 | #: selection:purchase.order.line,state_to_display:0 |
14 | 8939 | #: selection:sale.order.line,state_to_display:0 | 8939 | #: selection:sale.order.line,state_to_display:0 |
15 | 8940 | #: selection:purchase.order.line,rfq_line_state_to_display:0 | ||
16 | 8941 | #: selection:purchase.order.merged.line,rfq_line_state_to_display:0 | ||
17 | 8940 | msgid "Cancelled-r" | 8942 | msgid "Cancelled-r" |
18 | 8941 | msgstr "Annulée-r" | 8943 | msgstr "Annulée-r" |
19 | 8942 | 8944 | ||
20 | @@ -29966,7 +29968,7 @@ | |||
21 | 29966 | msgid "Certificate attached ?" | 29968 | msgid "Certificate attached ?" |
22 | 29967 | msgstr "Certificat attaché ?" | 29969 | msgstr "Certificat attaché ?" |
23 | 29968 | 29970 | ||
25 | 29969 | #. modules: msf_supply_doc_export, sourcing, consumption_calculation, sale, sales_followup, msf_supply_doc_export, purchase, account_override, account, register_accounting, stock_override | 29971 | #. modules: msf_supply_doc_export, sourcing, consumption_calculation, sale, sales_followup, msf_supply_doc_export, purchase, account_override, account, register_accounting, stock_override, purchase_override, tender_flow |
26 | 29970 | #: field:po.follow.up,closed_ok:0 | 29972 | #: field:po.follow.up,closed_ok:0 |
27 | 29971 | #: selection:real.average.consumption,state:0 | 29973 | #: selection:real.average.consumption,state:0 |
28 | 29972 | #: selection:po.follow.up,state:0 | 29974 | #: selection:po.follow.up,state:0 |
29 | @@ -46585,7 +46587,7 @@ | |||
30 | 46585 | msgid "Europe/Ulyanovsk" | 46587 | msgid "Europe/Ulyanovsk" |
31 | 46586 | msgstr "Europe/Ulyanovsk" | 46588 | msgstr "Europe/Ulyanovsk" |
32 | 46587 | 46589 | ||
34 | 46588 | #. modules: purchase, sync_client, sales_followup, msf_homere_interface, tender_flow, stock_forecast, mission_stock, msf_profile | 46590 | #. modules: purchase, sync_client, sales_followup, msf_homere_interface, tender_flow, stock_forecast, mission_stock, msf_profile, purchase_override |
35 | 46589 | #: field:stock.mission.report.line,updated:0 | 46591 | #: field:stock.mission.report.line,updated:0 |
36 | 46590 | #: field:hr.payroll.import.confirmation,updated:0 | 46592 | #: field:hr.payroll.import.confirmation,updated:0 |
37 | 46591 | #: selection:purchase.report,state:0 | 46593 | #: selection:purchase.report,state:0 |
38 | @@ -47148,7 +47150,7 @@ | |||
39 | 47148 | msgid "Illinois" | 47150 | msgid "Illinois" |
40 | 47149 | msgstr "Illinois" | 47151 | msgstr "Illinois" |
41 | 47150 | 47152 | ||
43 | 47151 | #. modules: stock_forecast, purchase, tender_flow, sales_followup | 47153 | #. modules: stock_forecast, purchase, tender_flow, sales_followup, purchase_override |
44 | 47152 | #: selection:purchase.report,state:0 | 47154 | #: selection:purchase.report,state:0 |
45 | 47153 | #: selection:purchase.order.line,po_state:0 | 47155 | #: selection:purchase.order.line,po_state:0 |
46 | 47154 | #: selection:purchase.order.line,order_state:0 | 47156 | #: selection:purchase.order.line,order_state:0 |
47 | @@ -82474,6 +82476,7 @@ | |||
48 | 82474 | #: report:addons/msf_supply_doc_export/report/report_internal_request_xls.mako:65 | 82476 | #: report:addons/msf_supply_doc_export/report/report_internal_request_xls.mako:65 |
49 | 82475 | #: report:addons/msf_supply_doc_export/report/report_purchase_order_xls.mako:83 | 82477 | #: report:addons/msf_supply_doc_export/report/report_purchase_order_xls.mako:83 |
50 | 82476 | #: report:addons/msf_supply_doc_export/report/report_sale_order_xls.mako:82 | 82478 | #: report:addons/msf_supply_doc_export/report/report_sale_order_xls.mako:82 |
51 | 82479 | #: field:purchase.order.line,rfq_line_state_to_display:0 | ||
52 | 82477 | #, python-format | 82480 | #, python-format |
53 | 82478 | msgid "State" | 82481 | msgid "State" |
54 | 82479 | msgstr "Statut" | 82482 | msgstr "Statut" |
55 | 82480 | 82483 | ||
56 | === modified file 'bin/addons/purchase/__init__.py' | |||
57 | --- bin/addons/purchase/__init__.py 2019-07-22 12:08:20 +0000 | |||
58 | +++ bin/addons/purchase/__init__.py 2019-10-17 13:49:09 +0000 | |||
59 | @@ -56,7 +56,6 @@ | |||
60 | 56 | ('resourced_d', 'Resourced-d'), | 56 | ('resourced_d', 'Resourced-d'), |
61 | 57 | ] | 57 | ] |
62 | 58 | 58 | ||
63 | 59 | |||
64 | 60 | PURCHASE_ORDER_STATE_SELECTION = [ | 59 | PURCHASE_ORDER_STATE_SELECTION = [ |
65 | 61 | ('draft', 'Draft'), | 60 | ('draft', 'Draft'), |
66 | 62 | ('draft_p', 'Draft-p'), | 61 | ('draft_p', 'Draft-p'), |
67 | 63 | 62 | ||
68 | === modified file 'bin/addons/purchase/purchase_order.py' | |||
69 | --- bin/addons/purchase/purchase_order.py 2019-09-12 10:02:53 +0000 | |||
70 | +++ bin/addons/purchase/purchase_order.py 2019-10-17 13:49:09 +0000 | |||
71 | @@ -2601,9 +2601,9 @@ | |||
72 | 2601 | # set cross_docking_ok: | 2601 | # set cross_docking_ok: |
73 | 2602 | cross_docking_ok = False | 2602 | cross_docking_ok = False |
74 | 2603 | for rfq_line in rfq.order_line: | 2603 | for rfq_line in rfq.order_line: |
76 | 2604 | if rfq_line.linked_sol_id and not rfq_line.linked_sol_id.order_id.procurement_request or \ | 2604 | if rfq_line.linked_sol_id and (not rfq_line.linked_sol_id.order_id.procurement_request or \ |
77 | 2605 | (rfq_line.linked_sol_id.order_id.procurement_request and | 2605 | (rfq_line.linked_sol_id.order_id.procurement_request and |
79 | 2606 | rfq_line.linked_sol_id.order_id.location_requestor_id.usage == 'customer'): | 2606 | rfq_line.linked_sol_id.order_id.location_requestor_id.usage == 'customer')): |
80 | 2607 | cross_docking_ok = True | 2607 | cross_docking_ok = True |
81 | 2608 | break | 2608 | break |
82 | 2609 | self.write(cr, uid, [new_po_id], {'cross_docking_ok': cross_docking_ok}, context=context) | 2609 | self.write(cr, uid, [new_po_id], {'cross_docking_ok': cross_docking_ok}, context=context) |
83 | 2610 | 2610 | ||
84 | === modified file 'bin/addons/purchase/purchase_order_line.py' | |||
85 | --- bin/addons/purchase/purchase_order_line.py 2019-10-01 09:09:50 +0000 | |||
86 | +++ bin/addons/purchase/purchase_order_line.py 2019-10-17 13:49:09 +0000 | |||
87 | @@ -1265,7 +1265,7 @@ | |||
88 | 1265 | 1265 | ||
89 | 1266 | # from RfQ line to PO line: grab the linked sol if has: | 1266 | # from RfQ line to PO line: grab the linked sol if has: |
90 | 1267 | if pol.order_id.rfq_ok and context.get('generate_po_from_rfq', False): | 1267 | if pol.order_id.rfq_ok and context.get('generate_po_from_rfq', False): |
92 | 1268 | default.update({'linked_sol_id': pol.linked_sol_id.id}) | 1268 | default.update({'linked_sol_id': pol.linked_sol_id and pol.linked_sol_id.id or False}) |
93 | 1269 | 1269 | ||
94 | 1270 | if not context.get('keepDateAndDistrib'): | 1270 | if not context.get('keepDateAndDistrib'): |
95 | 1271 | if 'confirmed_delivery_date' not in default: | 1271 | if 'confirmed_delivery_date' not in default: |
96 | 1272 | 1272 | ||
97 | === modified file 'bin/addons/purchase_override/purchase.py' | |||
98 | --- bin/addons/purchase_override/purchase.py 2019-08-23 14:56:06 +0000 | |||
99 | +++ bin/addons/purchase_override/purchase.py 2019-10-17 13:49:09 +0000 | |||
100 | @@ -382,7 +382,7 @@ | |||
101 | 382 | 382 | ||
102 | 383 | # cancel all non-confirmed lines: | 383 | # cancel all non-confirmed lines: |
103 | 384 | if po.rfq_ok: | 384 | if po.rfq_ok: |
105 | 385 | self.pool.get('purchase.order').cancel_rfq(cr, uid, [po.id], context=context) | 385 | self.pool.get('purchase.order').cancel_rfq(cr, uid, [po.id], context=context, resource=resource) |
106 | 386 | else: | 386 | else: |
107 | 387 | for pol in po.order_line: | 387 | for pol in po.order_line: |
108 | 388 | if (pol.order_id.partner_type in ('external', 'esc') and pol.state in ('draft', 'validated', 'validated_n'))\ | 388 | if (pol.order_id.partner_type in ('external', 'esc') and pol.state in ('draft', 'validated', 'validated_n'))\ |
109 | 389 | 389 | ||
110 | === modified file 'bin/addons/tender_flow/__init__.py' | |||
111 | --- bin/addons/tender_flow/__init__.py 2012-05-15 11:47:19 +0000 | |||
112 | +++ bin/addons/tender_flow/__init__.py 2019-10-17 13:49:09 +0000 | |||
113 | @@ -18,6 +18,21 @@ | |||
114 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
115 | 19 | # | 19 | # |
116 | 20 | ############################################################################## | 20 | ############################################################################## |
117 | 21 | |||
118 | 22 | from tools.translate import _ | ||
119 | 23 | |||
120 | 24 | RFQ_STATE_SELECTION = [ | ||
121 | 25 | ('draft', 'Draft'), | ||
122 | 26 | ('sent', 'Sent'), | ||
123 | 27 | ('updated', 'Updated'), | ||
124 | 28 | ('done', 'Closed'), | ||
125 | 29 | ('cancel', 'Cancelled'), | ||
126 | 30 | ] | ||
127 | 31 | |||
128 | 32 | RFQ_LINE_STATE_DISPLAY_SELECTION = RFQ_STATE_SELECTION + [ | ||
129 | 33 | ('cancel_r', 'Cancelled-r'), | ||
130 | 34 | ] | ||
131 | 35 | |||
132 | 21 | import tender_flow | 36 | import tender_flow |
133 | 22 | import wizard | 37 | import wizard |
134 | 23 | import report | 38 | import report |
135 | 24 | 39 | ||
136 | === modified file 'bin/addons/tender_flow/tender_flow.py' | |||
137 | --- bin/addons/tender_flow/tender_flow.py 2019-08-14 09:17:27 +0000 | |||
138 | +++ bin/addons/tender_flow/tender_flow.py 2019-10-17 13:49:09 +0000 | |||
139 | @@ -30,6 +30,8 @@ | |||
140 | 30 | import tools | 30 | import tools |
141 | 31 | 31 | ||
142 | 32 | from purchase import PURCHASE_ORDER_STATE_SELECTION | 32 | from purchase import PURCHASE_ORDER_STATE_SELECTION |
143 | 33 | from . import RFQ_STATE_SELECTION | ||
144 | 34 | from . import RFQ_LINE_STATE_DISPLAY_SELECTION | ||
145 | 33 | 35 | ||
146 | 34 | class tender(osv.osv): | 36 | class tender(osv.osv): |
147 | 35 | ''' | 37 | ''' |
148 | @@ -722,7 +724,7 @@ | |||
149 | 722 | # search for the rfqs | 724 | # search for the rfqs |
150 | 723 | rfq_ids = po_obj.search(cr, uid, [('tender_id', '=', tender.id), ('rfq_ok', '=', True)], context=context) | 725 | rfq_ids = po_obj.search(cr, uid, [('tender_id', '=', tender.id), ('rfq_ok', '=', True)], context=context) |
151 | 724 | # trigger all related rfqs | 726 | # trigger all related rfqs |
153 | 725 | po_obj.cancel_rfq(cr, uid, rfq_ids, context=context) | 727 | po_obj.cancel_rfq(cr, uid, rfq_ids, context=context, resource=False) |
154 | 726 | 728 | ||
155 | 727 | for line in tender.tender_line_ids: | 729 | for line in tender.tender_line_ids: |
156 | 728 | t_line_obj.cancel_sourcing(cr, uid, [line.id], context=context) | 730 | t_line_obj.cancel_sourcing(cr, uid, [line.id], context=context) |
157 | @@ -1623,7 +1625,7 @@ | |||
158 | 1623 | 'valid_till': fields.date(string='Valid Till', internal="purchase_order"), | 1625 | 'valid_till': fields.date(string='Valid Till', internal="purchase_order"), |
159 | 1624 | # add readonly when state is Done | 1626 | # add readonly when state is Done |
160 | 1625 | 'sale_order_id': fields.many2one('sale.order', string='Link between RfQ and FO', readonly=True, internal="purchase_order"), | 1627 | 'sale_order_id': fields.many2one('sale.order', string='Link between RfQ and FO', readonly=True, internal="purchase_order"), |
162 | 1626 | 'rfq_state': fields.selection([('draft', 'Draft'), ('sent', 'Sent'), ('updated', 'Updated'), ('done', 'Closed'), ('cancel', 'Cancelled')], 'Order state', required=True, readonly=True, internal="purchase_order"), | 1628 | 'rfq_state': fields.selection(RFQ_STATE_SELECTION, 'Order state', required=True, readonly=True, internal="purchase_order"), |
163 | 1627 | } | 1629 | } |
164 | 1628 | 1630 | ||
165 | 1629 | _defaults = { | 1631 | _defaults = { |
166 | @@ -1669,8 +1671,7 @@ | |||
167 | 1669 | 1671 | ||
168 | 1670 | return super(purchase_order, self).create(cr, uid, vals, context=context) | 1672 | return super(purchase_order, self).create(cr, uid, vals, context=context) |
169 | 1671 | 1673 | ||
172 | 1672 | 1674 | def cancel_rfq(self, cr, uid, ids, context=None, resource=False): | |
171 | 1673 | def cancel_rfq(self, cr, uid, ids, context=None): | ||
173 | 1674 | ''' | 1675 | ''' |
174 | 1675 | method to cancel a RfQ and its lines | 1676 | method to cancel a RfQ and its lines |
175 | 1676 | ''' | 1677 | ''' |
176 | @@ -1686,7 +1687,10 @@ | |||
177 | 1686 | for rfq_line in rfq.order_line: | 1687 | for rfq_line in rfq.order_line: |
178 | 1687 | if (rfq_line.order_id.partner_type in ('external', 'esc') and rfq_line.state in ('draft', 'validated', 'validated_n'))\ | 1688 | if (rfq_line.order_id.partner_type in ('external', 'esc') and rfq_line.state in ('draft', 'validated', 'validated_n'))\ |
179 | 1688 | or (rfq_line.order_id.partner_type not in ('external', 'esc') and rfq_line.state == 'draft'): | 1689 | or (rfq_line.order_id.partner_type not in ('external', 'esc') and rfq_line.state == 'draft'): |
181 | 1689 | wf_service.trg_validate(uid, 'purchase.order.line', rfq_line.id, 'cancel', cr) | 1690 | signal = 'cancel' |
182 | 1691 | if resource and rfq_line.linked_sol_id: | ||
183 | 1692 | signal = 'cancel_r' | ||
184 | 1693 | wf_service.trg_validate(uid, 'purchase.order.line', rfq_line.id, signal, cr) | ||
185 | 1690 | 1694 | ||
186 | 1691 | self.write(cr, uid, [rfq.id], {'rfq_state': 'cancel'}, context=context) | 1695 | self.write(cr, uid, [rfq.id], {'rfq_state': 'cancel'}, context=context) |
187 | 1692 | 1696 | ||
188 | @@ -1914,10 +1918,32 @@ | |||
189 | 1914 | add a tender_id related field | 1918 | add a tender_id related field |
190 | 1915 | ''' | 1919 | ''' |
191 | 1916 | _inherit = 'purchase.order.line' | 1920 | _inherit = 'purchase.order.line' |
192 | 1921 | |||
193 | 1922 | def _get_rfq_line_state_to_display(self, cr, uid, ids, field_name, args, context=None): | ||
194 | 1923 | ''' | ||
195 | 1924 | return the state to display for RfQ lines | ||
196 | 1925 | ''' | ||
197 | 1926 | if context is None: | ||
198 | 1927 | context = {} | ||
199 | 1928 | if isinstance(ids, (int,long)): | ||
200 | 1929 | ids = [ids] | ||
201 | 1930 | |||
202 | 1931 | res = {} | ||
203 | 1932 | for pol in self.browse(cr, uid, ids, context=context): | ||
204 | 1933 | if pol.order_id.rfq_ok and pol.state not in ['cancel', 'cancel_r']: | ||
205 | 1934 | res[pol.id] = pol.order_id.rfq_state | ||
206 | 1935 | else: | ||
207 | 1936 | res[pol.id] = pol.state_to_display | ||
208 | 1937 | |||
209 | 1938 | return res | ||
210 | 1939 | |||
211 | 1917 | _columns = {'tender_id': fields.related('order_id', 'tender_id', type='many2one', relation='tender', string='Tender',), | 1940 | _columns = {'tender_id': fields.related('order_id', 'tender_id', type='many2one', relation='tender', string='Tender',), |
212 | 1918 | 'tender_line_id': fields.many2one('tender.line', string='Tender Line'), | 1941 | 'tender_line_id': fields.many2one('tender.line', string='Tender Line'), |
213 | 1919 | 'rfq_ok': fields.related('order_id', 'rfq_ok', type='boolean', string='RfQ ?'), | 1942 | 'rfq_ok': fields.related('order_id', 'rfq_ok', type='boolean', string='RfQ ?'), |
214 | 1920 | 'sale_order_line_id': fields.many2one('sale.order.line', string='FO line', readonly=True), | 1943 | 'sale_order_line_id': fields.many2one('sale.order.line', string='FO line', readonly=True), |
215 | 1944 | 'rfq_line_state_to_display': fields.function(_get_rfq_line_state_to_display, string='State', | ||
216 | 1945 | type='selection', selection=RFQ_LINE_STATE_DISPLAY_SELECTION, | ||
217 | 1946 | method=True, readonly=True) | ||
218 | 1921 | } | 1947 | } |
219 | 1922 | 1948 | ||
220 | 1923 | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): | 1949 | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): |
221 | @@ -2118,7 +2144,7 @@ | |||
222 | 2118 | 2144 | ||
223 | 2119 | line_obj.fake_unlink(cr, uid, line_ids, context=context) | 2145 | line_obj.fake_unlink(cr, uid, line_ids, context=context) |
224 | 2120 | 2146 | ||
226 | 2121 | self.pool.get('purchase.order').cancel_rfq(cr, uid, rfq_ids, context=context) | 2147 | self.pool.get('purchase.order').cancel_rfq(cr, uid, rfq_ids, context=context, resource=False) |
227 | 2122 | 2148 | ||
228 | 2123 | for tender in tender_ids: | 2149 | for tender in tender_ids: |
229 | 2124 | wf_service.trg_validate(uid, 'tender', tender, 'tender_cancel', cr) | 2150 | wf_service.trg_validate(uid, 'tender', tender, 'tender_cancel', cr) |
230 | 2125 | 2151 | ||
231 | === modified file 'bin/addons/tender_flow/tender_flow_view.xml' | |||
232 | --- bin/addons/tender_flow/tender_flow_view.xml 2019-06-11 12:11:22 +0000 | |||
233 | +++ bin/addons/tender_flow/tender_flow_view.xml 2019-10-17 13:49:09 +0000 | |||
234 | @@ -328,7 +328,8 @@ | |||
235 | 328 | <field name="currency_id"/> | 328 | <field name="currency_id"/> |
236 | 329 | <field name="tender_line_id" invisible="1" /> | 329 | <field name="tender_line_id" invisible="1" /> |
237 | 330 | <field name="fake_state" invisible="1"/> | 330 | <field name="fake_state" invisible="1"/> |
239 | 331 | <button string="Cancel" icon="gtk-del" type="object" name="ask_unlink" attrs="{'invisible': [('fake_state', 'in', ['cancel', 'cancel_r', 'done'])]}" /> | 331 | <field name="rfq_line_state_to_display"/> |
240 | 332 | <button string="Cancel" icon="gtk-del" type="object" name="ask_unlink" attrs="{'invisible': ['|', ('fake_state', 'in', ['cancel', 'cancel_r', 'done']), ('rfq_state', 'in', ['updated', 'done', 'cancel'])]}" /> | ||
241 | 332 | </tree> | 333 | </tree> |
242 | 333 | </field> | 334 | </field> |
243 | 334 | </page> | 335 | </page> |