Merge lp:~unifield-team/unifield-server/us-3478 into lp:~jfb-tempo-consulting/unifield-server/partial
- us-3478
- Merge into partial
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 4665 |
Proposed branch: | lp:~unifield-team/unifield-server/us-3478 |
Merge into: | lp:~jfb-tempo-consulting/unifield-server/partial |
Diff against target: |
375 lines (+123/-14) 15 files modified
bin/addons/msf_sync_data_server/data/sync_server.message_rule.csv (+1/-1) bin/addons/procurement_request/procurement_request.py (+23/-0) bin/addons/procurement_request/procurement_request_view.xml (+1/-0) bin/addons/purchase/purchase_line.py (+32/-4) bin/addons/purchase/purchase_view.xml (+11/-1) bin/addons/purchase/purchase_workflow.py (+19/-0) bin/addons/purchase_override/purchase.py (+0/-1) bin/addons/purchase_override/wizard/split_order_line.py (+1/-1) bin/addons/sale/sale_order.py (+5/-0) bin/addons/sale/sale_view.xml (+1/-0) bin/addons/sale/sale_workflow.py (+5/-2) bin/addons/sale/wizard/split_order_line.py (+1/-1) bin/addons/sourcing/procurement_order.py (+4/-0) bin/addons/sourcing/sale_order_line.py (+18/-2) bin/addons/sync_so/purchase.py (+1/-1) |
To merge this branch: | bzr merge lp:~unifield-team/unifield-server/us-3478 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
jftempo | Pending | ||
Review via email: mp+331725@code.launchpad.net |
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_sync_data_server/data/sync_server.message_rule.csv' | |||
2 | --- bin/addons/msf_sync_data_server/data/sync_server.message_rule.csv 2017-09-14 08:41:12 +0000 | |||
3 | +++ bin/addons/msf_sync_data_server/data/sync_server.message_rule.csv 2017-10-03 16:52:18 +0000 | |||
4 | @@ -6,7 +6,7 @@ | |||
5 | 6 | msf_sync_data_server.fo_updates_po_ref,TRUE,TRUE,"['name','state','client_order_ref']","['&','&','&',('partner_type','!=','external'),('client_order_ref','!=',False),('split_type_sale_order','=','original_sale_order'),'!',('client_order_ref', 'like', 'invalid_by_recovery')]",partner_id,MISSION,purchase.order.update_fo_ref,sale.order,FO updates PO ref,9,Valid | 6 | msf_sync_data_server.fo_updates_po_ref,TRUE,TRUE,"['name','state','client_order_ref']","['&','&','&',('partner_type','!=','external'),('client_order_ref','!=',False),('split_type_sale_order','=','original_sale_order'),'!',('client_order_ref', 'like', 'invalid_by_recovery')]",partner_id,MISSION,purchase.order.update_fo_ref,sale.order,FO updates PO ref,9,Valid |
6 | 7 | msf_sync_data_server.update_in_ref,TRUE,TRUE,"['name','shipment_ref']","['&',('shipment_ref','!=',False),'!',('shipment_ref', 'like', 'invalid_by_recovery')]",partner_id,MISSION,stock.picking.update_in_ref,stock.picking,IN updates ref to OUT SHIP,10,Valid | 7 | msf_sync_data_server.update_in_ref,TRUE,TRUE,"['name','shipment_ref']","['&',('shipment_ref','!=',False),'!',('shipment_ref', 'like', 'invalid_by_recovery')]",partner_id,MISSION,stock.picking.update_in_ref,stock.picking,IN updates ref to OUT SHIP,10,Valid |
7 | 8 | msf_sync_data_server.pol_create_sol,TRUE,TRUE,"['sync_local_id', 'order_id/name','product_id/id', 'product_id/name', 'name', 'state', 'product_qty', 'product_uom', 'price_unit', 'analytic_distribution_id/id','comment','have_analytic_distribution_from_header','line_number', 'nomen_manda_0/id','nomen_manda_1/id','nomen_manda_2/id','nomen_manda_3/id', 'nomenclature_description','notes','default_name','default_code','is_line_split','date_planned', 'stock_take_date']","[('sync_linked_sol', '=', False), ('order_id.partner_type', 'not in',['external','esc']), ('state', 'in', ['validated', 'confirmed', 'done']), ('order_id.state', 'not in', ['draft', 'cancel'])]",partner_id,MISSION,sale.order.line.create_so_line,purchase.order.line,PO line creates FO line,11,Valid | 8 | msf_sync_data_server.pol_create_sol,TRUE,TRUE,"['sync_local_id', 'order_id/name','product_id/id', 'product_id/name', 'name', 'state', 'product_qty', 'product_uom', 'price_unit', 'analytic_distribution_id/id','comment','have_analytic_distribution_from_header','line_number', 'nomen_manda_0/id','nomen_manda_1/id','nomen_manda_2/id','nomen_manda_3/id', 'nomenclature_description','notes','default_name','default_code','is_line_split','date_planned', 'stock_take_date']","[('sync_linked_sol', '=', False), ('order_id.partner_type', 'not in',['external','esc']), ('state', 'in', ['validated', 'confirmed', 'done']), ('order_id.state', 'not in', ['draft', 'cancel'])]",partner_id,MISSION,sale.order.line.create_so_line,purchase.order.line,PO line creates FO line,11,Valid |
9 | 9 | msf_sync_data_server.sol_updates_pol,TRUE,TRUE,"['resourced_original_line/id', 'resourced_original_remote_line','sync_sourced_origin', 'sync_local_id', 'sync_linked_pol', 'order_id/name', 'product_id/id', 'product_id/name', 'name', 'state','product_uom_qty', 'product_uom', 'price_unit', 'analytic_distribution_id/id','comment','have_analytic_distribution_from_header','line_number', 'nomen_manda_0/id','nomen_manda_1/id','nomen_manda_2/id','nomen_manda_3/id', 'nomenclature_description','notes','default_name','default_code','date_planned','is_line_split', 'original_line_id/id', 'confirmed_delivery_date', 'stock_take_date', 'cancel_split_ok']","[('order_id.partner_type', '!=', 'external'), ('state', '!=', 'draft')]",partner_id,MISSION,purchase.order.line.sol_update_original_pol,sale.order.line,FO line updates PO line,12,Valid | 9 | msf_sync_data_server.sol_updates_pol,TRUE,TRUE,"['resourced_original_line/id', 'resourced_original_remote_line','sync_sourced_origin', 'sync_local_id', 'sync_linked_pol', 'order_id/name', 'product_id/id', 'product_id/name', 'name', 'state','product_uom_qty', 'product_uom', 'price_unit', 'analytic_distribution_id/id','comment','have_analytic_distribution_from_header','line_number', 'nomen_manda_0/id','nomen_manda_1/id','nomen_manda_2/id','nomen_manda_3/id', 'nomenclature_description','notes','default_name','default_code','date_planned','is_line_split', 'original_line_id/id', 'confirmed_delivery_date', 'stock_take_date', 'cancel_split_ok', 'modification_comment']","[('order_id.partner_type', '!=', 'external'), ('state', '!=', 'draft')]",partner_id,MISSION,purchase.order.line.sol_update_original_pol,sale.order.line,FO line updates PO line,12,Valid |
10 | 10 | msf_sync_data_server.partial_shipped_coordo_updates_in_at_project,TRUE,TRUE,"['name', 'state', 'origin', 'partner_type_stock_picking', 'shipment_id/name', 'min_date', 'note', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/prodlot_id/id','move_lines/prodlot_id/name','move_lines/prodlot_id/life_date', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/usage', 'move_lines/comment']","['&','&','&','&','&','&',('partner_type_stock_picking', '!=', 'external'), ('type', '=', 'out'), ('subtype', 'in', ['standard', 'packing']), ('state', '=', 'done'), ('already_shipped', '=', True), ('do_not_sync', '=', False), ('claim', '=', False)]",partner_id,MISSION,stock.picking.partial_shipped_fo_updates_in_po,stock.picking,Partial shipped at Coordo updates IN at Project,19,Valid | 10 | msf_sync_data_server.partial_shipped_coordo_updates_in_at_project,TRUE,TRUE,"['name', 'state', 'origin', 'partner_type_stock_picking', 'shipment_id/name', 'min_date', 'note', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/prodlot_id/id','move_lines/prodlot_id/name','move_lines/prodlot_id/life_date', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/usage', 'move_lines/comment']","['&','&','&','&','&','&',('partner_type_stock_picking', '!=', 'external'), ('type', '=', 'out'), ('subtype', 'in', ['standard', 'packing']), ('state', '=', 'done'), ('already_shipped', '=', True), ('do_not_sync', '=', False), ('claim', '=', False)]",partner_id,MISSION,stock.picking.partial_shipped_fo_updates_in_po,stock.picking,Partial shipped at Coordo updates IN at Project,19,Valid |
11 | 11 | msf_sync_data_server.moves_from_dpo_closed_coordo_updates_in_at_project,TRUE,TRUE,"['name', 'state', 'origin', 'subtype', 'partner_type_stock_picking', 'shipment_id/name', 'min_date', 'note', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/prodlot_id/id','move_lines/prodlot_id/name','move_lines/prodlot_id/life_date', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/dpo_line_id', 'move_lines/comment']","['&', '&', '&', ('partner_type_stock_picking', '!=', 'external'), ('type', '=', 'out'), ('subtype', 'in', ['picking', 'standard']), ('dpo_out', '=', True)]",partner_id,MISSION,stock.picking.partial_shippped_dpo_updates_in_po,stock.picking,Moves from DPO closed at Coordo updates IN at Project,20,Valid | 11 | msf_sync_data_server.moves_from_dpo_closed_coordo_updates_in_at_project,TRUE,TRUE,"['name', 'state', 'origin', 'subtype', 'partner_type_stock_picking', 'shipment_id/name', 'min_date', 'note', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_qty', 'move_lines/prodlot_id/id','move_lines/prodlot_id/name','move_lines/prodlot_id/life_date', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/dpo_line_id', 'move_lines/comment']","['&', '&', '&', ('partner_type_stock_picking', '!=', 'external'), ('type', '=', 'out'), ('subtype', 'in', ['picking', 'standard']), ('dpo_out', '=', True)]",partner_id,MISSION,stock.picking.partial_shippped_dpo_updates_in_po,stock.picking,Moves from DPO closed at Coordo updates IN at Project,20,Valid |
12 | 12 | msf_sync_data_server.dpo_service_lines_update_in_at_project,FALSE,TRUE,"['order_id/name', 'order_id/delivery_confirmed_date', 'sync_local_id', 'origin', 'confirmed_delivery_date', 'name', 'product_uom/id', 'product_uom/name', 'link_sol_id/line_number', 'notes', 'product_qty', 'product_id/name', 'product_id/id', 'comment']","[('dest_partner_id.partner_type', '=', 'internal'), ('order_id.order_type', '=', 'direct'), ('order_id.state', 'in', ['approved', 'done']), ('product_id.type', 'in', ['service', 'service_recep'])]",dest_partner_id,MISSION,purchase.order.line.confirmed_dpo_service_lines_update_in_po,purchase.order.line,DPO service lines update IN at Project,21,Valid | 12 | msf_sync_data_server.dpo_service_lines_update_in_at_project,FALSE,TRUE,"['order_id/name', 'order_id/delivery_confirmed_date', 'sync_local_id', 'origin', 'confirmed_delivery_date', 'name', 'product_uom/id', 'product_uom/name', 'link_sol_id/line_number', 'notes', 'product_qty', 'product_id/name', 'product_id/id', 'comment']","[('dest_partner_id.partner_type', '=', 'internal'), ('order_id.order_type', '=', 'direct'), ('order_id.state', 'in', ['approved', 'done']), ('product_id.type', 'in', ['service', 'service_recep'])]",dest_partner_id,MISSION,purchase.order.line.confirmed_dpo_service_lines_update_in_po,purchase.order.line,DPO service lines update IN at Project,21,Valid |
13 | 13 | 13 | ||
14 | === modified file 'bin/addons/procurement_request/procurement_request.py' | |||
15 | --- bin/addons/procurement_request/procurement_request.py 2017-09-14 08:41:12 +0000 | |||
16 | +++ bin/addons/procurement_request/procurement_request.py 2017-10-03 16:52:18 +0000 | |||
17 | @@ -684,6 +684,25 @@ | |||
18 | 684 | res[pol['id']] = False | 684 | res[pol['id']] = False |
19 | 685 | return res | 685 | return res |
20 | 686 | 686 | ||
21 | 687 | def _check_changed(self, cr, uid, ids, name, arg, context=None): | ||
22 | 688 | ''' | ||
23 | 689 | Check if an original value has been changed | ||
24 | 690 | ''' | ||
25 | 691 | if context is None: | ||
26 | 692 | context = {} | ||
27 | 693 | res = {} | ||
28 | 694 | |||
29 | 695 | for line in self.browse(cr, uid, ids, context=context): | ||
30 | 696 | changed = False | ||
31 | 697 | if line.modification_comment or (line.original_qty and line.original_price and line.original_uom): | ||
32 | 698 | if line.modification_comment or line.product_uom_qty != line.original_qty \ | ||
33 | 699 | or line.price_unit != line.original_price or line.product_uom != line.original_uom: | ||
34 | 700 | changed = True | ||
35 | 701 | |||
36 | 702 | res[line.id] = changed | ||
37 | 703 | |||
38 | 704 | return res | ||
39 | 705 | |||
40 | 687 | _columns = { | 706 | _columns = { |
41 | 688 | 'cost_price': fields.float(string='Cost price', digits_compute=dp.get_precision('Sale Price Computation')), | 707 | 'cost_price': fields.float(string='Cost price', digits_compute=dp.get_precision('Sale Price Computation')), |
42 | 689 | 'procurement_request': fields.boolean(string='Internal Request', readonly=True), | 708 | 'procurement_request': fields.boolean(string='Internal Request', readonly=True), |
43 | @@ -696,6 +715,10 @@ | |||
44 | 696 | 'product_id_ok': fields.function(_get_product_id_ok, type="boolean", method=True, string='Product defined?', help='for if true the button "configurator" is hidden'), | 715 | 'product_id_ok': fields.function(_get_product_id_ok, type="boolean", method=True, string='Product defined?', help='for if true the button "configurator" is hidden'), |
45 | 697 | 'product_ok': fields.boolean('Product selected'), | 716 | 'product_ok': fields.boolean('Product selected'), |
46 | 698 | 'comment_ok': fields.boolean('Comment written'), | 717 | 'comment_ok': fields.boolean('Comment written'), |
47 | 718 | 'original_qty': fields.float('Original Qty'), | ||
48 | 719 | 'original_price': fields.float('Original Price'), | ||
49 | 720 | 'original_uom': fields.many2one('product.uom', 'Original UOM'), | ||
50 | 721 | 'original_changed': fields.function(_check_changed, method=True, string='Changed', type='boolean'), | ||
51 | 699 | } | 722 | } |
52 | 700 | 723 | ||
53 | 701 | def _get_planned_date(self, cr, uid, c=None): | 724 | def _get_planned_date(self, cr, uid, c=None): |
54 | 702 | 725 | ||
55 | === modified file 'bin/addons/procurement_request/procurement_request_view.xml' | |||
56 | --- bin/addons/procurement_request/procurement_request_view.xml 2017-10-02 12:27:20 +0000 | |||
57 | +++ bin/addons/procurement_request/procurement_request_view.xml 2017-10-03 16:52:18 +0000 | |||
58 | @@ -90,6 +90,7 @@ | |||
59 | 90 | attrs="{'invisible': ['|', ('product_id_ok', '=', True), ('state', 'not in', ['draft', 'draft_p', 'validated', 'validated_p'])]}" | 90 | attrs="{'invisible': ['|', ('product_id_ok', '=', True), ('state', 'not in', ['draft', 'draft_p', 'validated', 'validated_p'])]}" |
60 | 91 | icon="terp-go-week" /> | 91 | icon="terp-go-week" /> |
61 | 92 | <field name="product_uom_qty" on_change="onchange_uom(product_id, product_uom, product_uom_qty)" /> | 92 | <field name="product_uom_qty" on_change="onchange_uom(product_id, product_uom, product_uom_qty)" /> |
62 | 93 | <field name="original_changed" readonly="1"/> | ||
63 | 93 | <field name="price_unit"/> | 94 | <field name="price_unit"/> |
64 | 94 | <field name="notes" /> | 95 | <field name="notes" /> |
65 | 95 | <field name="display_resourced_orig_line" /> | 96 | <field name="display_resourced_orig_line" /> |
66 | 96 | 97 | ||
67 | === modified file 'bin/addons/purchase/purchase_line.py' | |||
68 | --- bin/addons/purchase/purchase_line.py 2017-10-02 07:09:09 +0000 | |||
69 | +++ bin/addons/purchase/purchase_line.py 2017-10-03 16:52:18 +0000 | |||
70 | @@ -203,6 +203,29 @@ | |||
71 | 203 | 203 | ||
72 | 204 | return res | 204 | return res |
73 | 205 | 205 | ||
74 | 206 | def _check_changed(self, cr, uid, ids, name, arg, context=None): | ||
75 | 207 | ''' | ||
76 | 208 | Check if an original value has been changed | ||
77 | 209 | ''' | ||
78 | 210 | if context is None: | ||
79 | 211 | context = {} | ||
80 | 212 | res = {} | ||
81 | 213 | |||
82 | 214 | for line in self.browse(cr, uid, ids, context=context): | ||
83 | 215 | changed = False | ||
84 | 216 | if line.modification_comment\ | ||
85 | 217 | or (line.original_qty and line.original_price and line.original_uom and line.original_currency_id): | ||
86 | 218 | if line.modification_comment or line.product_qty != line.original_qty \ | ||
87 | 219 | or line.price_unit != line.original_price or line.product_uom != line.original_uom\ | ||
88 | 220 | or line.currency_id != line.original_currency_id: | ||
89 | 221 | changed = True | ||
90 | 222 | elif line.original_qty and line.original_uom and not line.original_price: # From IR | ||
91 | 223 | if line.original_qty != line.product_qty or line.original_uom.id != line.product_uom.id: | ||
92 | 224 | changed = True | ||
93 | 225 | |||
94 | 226 | res[line.id] = changed | ||
95 | 227 | |||
96 | 228 | return res | ||
97 | 206 | 229 | ||
98 | 207 | _columns = { | 230 | _columns = { |
99 | 208 | 'set_as_sourced_n': fields.boolean(string='Set as Sourced-n', help='Line has been created further and has to be created back in preceding documents'), | 231 | 'set_as_sourced_n': fields.boolean(string='Set as Sourced-n', help='Line has been created further and has to be created back in preceding documents'), |
100 | @@ -288,6 +311,12 @@ | |||
101 | 288 | 'partner_id': fields.related('order_id','partner_id',string='Partner',readonly=True,type="many2one", relation="res.partner", store=True), | 311 | 'partner_id': fields.related('order_id','partner_id',string='Partner',readonly=True,type="many2one", relation="res.partner", store=True), |
102 | 289 | 'date_order': fields.related('order_id','date_order',string='Order Date',readonly=True,type="date"), | 312 | 'date_order': fields.related('order_id','date_order',string='Order Date',readonly=True,type="date"), |
103 | 290 | 'stock_take_date': fields.date(string='Date of Stock Take', required=False), | 313 | 'stock_take_date': fields.date(string='Date of Stock Take', required=False), |
104 | 314 | 'original_qty': fields.float('Original Qty'), | ||
105 | 315 | 'original_price': fields.float('Original Price'), | ||
106 | 316 | 'original_uom': fields.many2one('product.uom', 'Original UOM'), | ||
107 | 317 | 'original_currency_id': fields.many2one('res.currency', 'Original Currency'), | ||
108 | 318 | 'modification_comment': fields.char('Modification Comment', size=1024), | ||
109 | 319 | 'original_changed': fields.function(_check_changed, method=True, string='Changed', type='boolean'), | ||
110 | 291 | } | 320 | } |
111 | 292 | _defaults = { | 321 | _defaults = { |
112 | 293 | 'set_as_sourced_n': lambda *a: False, | 322 | 'set_as_sourced_n': lambda *a: False, |
113 | @@ -896,11 +925,10 @@ | |||
114 | 896 | default = {} | 925 | default = {} |
115 | 897 | 926 | ||
116 | 898 | default.update({'state': 'draft', 'move_ids': [], 'invoiced': 0, 'invoice_lines': []}) | 927 | default.update({'state': 'draft', 'move_ids': [], 'invoiced': 0, 'invoice_lines': []}) |
117 | 899 | if 'origin' not in default: | ||
118 | 900 | default.update({'origin': False}) | ||
119 | 901 | 928 | ||
122 | 902 | if 'move_dest_id' not in default: | 929 | for field in ['origin', 'move_dest_id', 'original_qty', 'original_price', 'original_uom', 'original_currency_id', 'modification_comment']: |
123 | 903 | default.update({'move_dest_id': False}) | 930 | if field not in default: |
124 | 931 | default[field]= False | ||
125 | 904 | 932 | ||
126 | 905 | default.update({'sync_order_line_db_id': False, 'set_as_sourced_n': False, 'set_as_validated_n': False, 'linked_sol_id': False}) | 933 | default.update({'sync_order_line_db_id': False, 'set_as_sourced_n': False, 'set_as_validated_n': False, 'linked_sol_id': False}) |
127 | 906 | return super(purchase_order_line, self).copy_data(cr, uid, p_id, default=default, context=context) | 934 | return super(purchase_order_line, self).copy_data(cr, uid, p_id, default=default, context=context) |
128 | 907 | 935 | ||
129 | === modified file 'bin/addons/purchase/purchase_view.xml' | |||
130 | --- bin/addons/purchase/purchase_view.xml 2017-10-02 12:27:20 +0000 | |||
131 | +++ bin/addons/purchase/purchase_view.xml 2017-10-03 16:52:18 +0000 | |||
132 | @@ -205,6 +205,7 @@ | |||
133 | 205 | <field name="date_planned"/> | 205 | <field name="date_planned"/> |
134 | 206 | <field name="name"/> | 206 | <field name="name"/> |
135 | 207 | <field name="product_qty"/> | 207 | <field name="product_qty"/> |
136 | 208 | <field name="original_changed" readonly="1"/> | ||
137 | 208 | <field name="product_uom"/> | 209 | <field name="product_uom"/> |
138 | 209 | <field name="price_unit"/> | 210 | <field name="price_unit"/> |
139 | 210 | <field name="price_subtotal"/> | 211 | <field name="price_subtotal"/> |
140 | @@ -539,8 +540,17 @@ | |||
141 | 539 | <label string=" " /> | 540 | <label string=" " /> |
142 | 540 | <field name="account_4_distribution" invisible="1"/> | 541 | <field name="account_4_distribution" invisible="1"/> |
143 | 541 | </group> | 542 | </group> |
144 | 543 | <group colspan="4"> | ||
145 | 544 | <group colspan="2"> | ||
146 | 545 | <field name="original_qty" colspan="1" readonly="1"/> | ||
147 | 546 | <field name="original_price" colspan="1" readonly="1"/> | ||
148 | 547 | <field name="original_uom" colspan="1" readonly="1"/> | ||
149 | 548 | <field name="original_currency_id" colspan="1" readonly="1"/> | ||
150 | 549 | </group> | ||
151 | 550 | <field name="modification_comment" colspan="2"/> | ||
152 | 551 | </group> | ||
153 | 542 | <field name="vat_ok" invisible="1" /> | 552 | <field name="vat_ok" invisible="1" /> |
155 | 543 | <group colspan="4" col="4" groups="base.group_extended" attrs="{'invisible': [('vat_ok', '=', False)]}"> | 553 | <group colspan="4" col="4" attrs="{'invisible': [('vat_ok', '=', False)]}"> |
156 | 544 | <separator colspan="4" string="Taxes"/> | 554 | <separator colspan="4" string="Taxes"/> |
157 | 545 | <field colspan="4" nolabel="1" name="taxes_id" | 555 | <field colspan="4" nolabel="1" name="taxes_id" |
158 | 546 | domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/> | 556 | domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/> |
159 | 547 | 557 | ||
160 | === modified file 'bin/addons/purchase/purchase_workflow.py' | |||
161 | --- bin/addons/purchase/purchase_workflow.py 2017-10-02 07:11:25 +0000 | |||
162 | +++ bin/addons/purchase/purchase_workflow.py 2017-10-03 16:52:18 +0000 | |||
163 | @@ -107,6 +107,11 @@ | |||
164 | 107 | 'sync_sourced_origin': pol.instance_sync_order_ref and pol.instance_sync_order_ref.name or False, | 107 | 'sync_sourced_origin': pol.instance_sync_order_ref and pol.instance_sync_order_ref.name or False, |
165 | 108 | 'type': 'make_to_order', | 108 | 'type': 'make_to_order', |
166 | 109 | } | 109 | } |
167 | 110 | |||
168 | 111 | # update modification comment if it is set | ||
169 | 112 | if pol.modification_comment: | ||
170 | 113 | sol_values['modification_comment'] = pol.modification_comment | ||
171 | 114 | |||
172 | 110 | if create_line: | 115 | if create_line: |
173 | 111 | sol_values.update({ | 116 | sol_values.update({ |
174 | 112 | 'order_id': so_id, | 117 | 'order_id': so_id, |
175 | @@ -284,6 +289,20 @@ | |||
176 | 284 | po_to_check[pol.order_id.id] = True | 289 | po_to_check[pol.order_id.id] = True |
177 | 285 | if pol.linked_sol_id: | 290 | if pol.linked_sol_id: |
178 | 286 | wf_service.trg_validate(uid, 'sale.order.line', pol.linked_sol_id.id, 'sourced_v', cr) | 291 | wf_service.trg_validate(uid, 'sale.order.line', pol.linked_sol_id.id, 'sourced_v', cr) |
179 | 292 | # update original qty, unit price, uom and currency on line level | ||
180 | 293 | # doesn't update original qty and uom if already set (from IR) | ||
181 | 294 | line_update = { | ||
182 | 295 | 'original_price': pol.price_unit, | ||
183 | 296 | 'original_currency_id': pol.currency_id.id | ||
184 | 297 | } | ||
185 | 298 | if not pol.original_qty: | ||
186 | 299 | line_update['original_qty'] = pol.product_qty | ||
187 | 300 | |||
188 | 301 | if not pol.original_uom: | ||
189 | 302 | line_update['original_uom'] = pol.product_uom.id | ||
190 | 303 | |||
191 | 304 | self.write(cr, uid, pol.id, line_update, context=context) | ||
192 | 305 | |||
193 | 287 | 306 | ||
194 | 288 | if po_to_check: | 307 | if po_to_check: |
195 | 289 | self.pool.get('purchase.order').check_if_stock_take_date_with_esc_partner(cr, uid, po_to_check.keys(), context=context) | 308 | self.pool.get('purchase.order').check_if_stock_take_date_with_esc_partner(cr, uid, po_to_check.keys(), context=context) |
196 | 290 | 309 | ||
197 | === modified file 'bin/addons/purchase_override/purchase.py' | |||
198 | --- bin/addons/purchase_override/purchase.py 2017-09-14 08:41:12 +0000 | |||
199 | +++ bin/addons/purchase_override/purchase.py 2017-10-03 16:52:18 +0000 | |||
200 | @@ -159,7 +159,6 @@ | |||
201 | 159 | 159 | ||
202 | 160 | purchase_order_merged_line() | 160 | purchase_order_merged_line() |
203 | 161 | 161 | ||
204 | 162 | |||
205 | 163 | class purchase_order_group(osv.osv_memory): | 162 | class purchase_order_group(osv.osv_memory): |
206 | 164 | _name = "purchase.order.group" | 163 | _name = "purchase.order.group" |
207 | 165 | _inherit = "purchase.order.group" | 164 | _inherit = "purchase.order.group" |
208 | 166 | 165 | ||
209 | === modified file 'bin/addons/purchase_override/wizard/split_order_line.py' | |||
210 | --- bin/addons/purchase_override/wizard/split_order_line.py 2017-08-29 12:55:18 +0000 | |||
211 | +++ bin/addons/purchase_override/wizard/split_order_line.py 2017-10-03 16:52:18 +0000 | |||
212 | @@ -51,7 +51,7 @@ | |||
213 | 51 | 51 | ||
214 | 52 | _columns = { | 52 | _columns = { |
215 | 53 | 'purchase_line_id': fields.many2one('purchase.order.line', string='Line Id', readonly=True), | 53 | 'purchase_line_id': fields.many2one('purchase.order.line', string='Line Id', readonly=True), |
217 | 54 | 'original_qty': fields.float(digits=(16,2), string='Original Quantity', readonly=True), | 54 | 'original_qty': fields.float(string='Original Quantity', readonly=True), |
218 | 55 | 'old_line_qty': fields.float(digits=(16,2), string='Old line quantity', readonly=True), | 55 | 'old_line_qty': fields.float(digits=(16,2), string='Old line quantity', readonly=True), |
219 | 56 | 'new_line_qty': fields.float(digits=(16,2), string='New line quantity', required=True), | 56 | 'new_line_qty': fields.float(digits=(16,2), string='New line quantity', required=True), |
220 | 57 | 'impact_so_split_po_line_wizard': fields.boolean('Impact Field Order', help='Impact corresponding Field Order by creating a corresponding Field Order line.'), | 57 | 'impact_so_split_po_line_wizard': fields.boolean('Impact Field Order', help='Impact corresponding Field Order by creating a corresponding Field Order line.'), |
221 | 58 | 58 | ||
222 | === modified file 'bin/addons/sale/sale_order.py' | |||
223 | --- bin/addons/sale/sale_order.py 2017-10-02 12:27:20 +0000 | |||
224 | +++ bin/addons/sale/sale_order.py 2017-10-03 16:52:18 +0000 | |||
225 | @@ -1936,6 +1936,7 @@ | |||
226 | 1936 | 'vat_ok': fields.function(_get_vat_ok, method=True, type='boolean', string='VAT OK', store=False, readonly=True), | 1936 | 'vat_ok': fields.function(_get_vat_ok, method=True, type='boolean', string='VAT OK', store=False, readonly=True), |
227 | 1937 | 'soq_updated': fields.boolean(string='SoQ updated', readonly=True), | 1937 | 'soq_updated': fields.boolean(string='SoQ updated', readonly=True), |
228 | 1938 | 'set_as_sourced_n': fields.boolean(string='Sourced-n line', help='Line created in a further PO, so we have to create it back in the flow'), # used for wkf transition | 1938 | 'set_as_sourced_n': fields.boolean(string='Sourced-n line', help='Line created in a further PO, so we have to create it back in the flow'), # used for wkf transition |
229 | 1939 | 'modification_comment': fields.char('Modification Comment', size=1024), | ||
230 | 1939 | } | 1940 | } |
231 | 1940 | _order = 'sequence, id desc' | 1941 | _order = 'sequence, id desc' |
232 | 1941 | _defaults = { | 1942 | _defaults = { |
233 | @@ -2060,6 +2061,10 @@ | |||
234 | 2060 | 'set_as_sourced_n': False, | 2061 | 'set_as_sourced_n': False, |
235 | 2061 | }) | 2062 | }) |
236 | 2062 | 2063 | ||
237 | 2064 | for x in ['modification_comment', 'original_qty', 'original_price', 'original_uom']: | ||
238 | 2065 | if x not in default: | ||
239 | 2066 | default[x] = False | ||
240 | 2067 | |||
241 | 2063 | return super(sale_order_line, self).copy_data(cr, uid, id, default, context=context) | 2068 | return super(sale_order_line, self).copy_data(cr, uid, id, default, context=context) |
242 | 2064 | 2069 | ||
243 | 2065 | def product_id_change_orig(self, cr, uid, ids, pricelist, product, qty=0, | 2070 | def product_id_change_orig(self, cr, uid, ids, pricelist, product, qty=0, |
244 | 2066 | 2071 | ||
245 | === modified file 'bin/addons/sale/sale_view.xml' | |||
246 | --- bin/addons/sale/sale_view.xml 2017-10-02 17:36:43 +0000 | |||
247 | +++ bin/addons/sale/sale_view.xml 2017-10-03 16:52:18 +0000 | |||
248 | @@ -179,6 +179,7 @@ | |||
249 | 179 | <field name="type" groups="base.group_extended"/> | 179 | <field name="type" groups="base.group_extended"/> |
250 | 180 | <field name="delay" groups="base.group_extended"/> | 180 | <field name="delay" groups="base.group_extended"/> |
251 | 181 | <field name="display_resourced_orig_line"/> | 181 | <field name="display_resourced_orig_line"/> |
252 | 182 | <field name="modification_comment"/> | ||
253 | 182 | <newline/> | 183 | <newline/> |
254 | 183 | <separator colspan="5" string="Taxes"/> | 184 | <separator colspan="5" string="Taxes"/> |
255 | 184 | <field colspan="4" name="tax_id" nolabel="1" domain="[('parent_id','=',False),('type_tax_use','<>','purchase')]"/> | 185 | <field colspan="4" name="tax_id" nolabel="1" domain="[('parent_id','=',False),('type_tax_use','<>','purchase')]"/> |
256 | 185 | 186 | ||
257 | === modified file 'bin/addons/sale/sale_workflow.py' | |||
258 | --- bin/addons/sale/sale_workflow.py 2017-09-29 11:06:54 +0000 | |||
259 | +++ bin/addons/sale/sale_workflow.py 2017-10-03 16:52:18 +0000 | |||
260 | @@ -327,8 +327,11 @@ | |||
261 | 327 | if sol.order_id.order_type in ['loan', 'donation_st', 'donation_exp'] and sol.type != 'make_to_stock': | 327 | if sol.order_id.order_type in ['loan', 'donation_st', 'donation_exp'] and sol.type != 'make_to_stock': |
262 | 328 | to_write['type'] = 'make_to_stock' | 328 | to_write['type'] = 'make_to_stock' |
263 | 329 | 329 | ||
266 | 330 | elif sol.procurement_request: # in case of IR | 330 | elif sol.procurement_request: # in case of IR |
267 | 331 | pass #TODO | 331 | to_write['original_qty'] = sol.product_uom_qty |
268 | 332 | to_write['original_price'] = sol.price_unit | ||
269 | 333 | to_write['original_uom'] = sol.product_uom.id | ||
270 | 334 | # pass #TODO | ||
271 | 332 | 335 | ||
272 | 333 | if to_write: | 336 | if to_write: |
273 | 334 | self.write(cr, uid, sol.id, to_write, context=context) | 337 | self.write(cr, uid, sol.id, to_write, context=context) |
274 | 335 | 338 | ||
275 | === modified file 'bin/addons/sale/wizard/split_order_line.py' | |||
276 | --- bin/addons/sale/wizard/split_order_line.py 2017-09-05 12:48:12 +0000 | |||
277 | +++ bin/addons/sale/wizard/split_order_line.py 2017-10-03 16:52:18 +0000 | |||
278 | @@ -32,7 +32,7 @@ | |||
279 | 32 | 32 | ||
280 | 33 | _columns = { | 33 | _columns = { |
281 | 34 | 'sale_line_id': fields.many2one('sale.order.line', string='Line Id', readonly=True), | 34 | 'sale_line_id': fields.many2one('sale.order.line', string='Line Id', readonly=True), |
283 | 35 | 'original_qty': fields.float(digits=(16,2), string='Original Quantity', readonly=True), | 35 | 'original_qty': fields.float(string='Original Quantity', readonly=True), |
284 | 36 | 'old_line_qty': fields.float(digits=(16,2), string='Old line quantity', readonly=True), | 36 | 'old_line_qty': fields.float(digits=(16,2), string='Old line quantity', readonly=True), |
285 | 37 | 'new_line_qty': fields.float(digits=(16,2), string='New line quantity', required=True), | 37 | 'new_line_qty': fields.float(digits=(16,2), string='New line quantity', required=True), |
286 | 38 | } | 38 | } |
287 | 39 | 39 | ||
288 | === removed directory 'bin/addons/sale_override' | |||
289 | === removed directory 'bin/addons/sale_override/wizard' | |||
290 | === modified file 'bin/addons/sourcing/procurement_order.py' | |||
291 | --- bin/addons/sourcing/procurement_order.py 2017-08-03 15:16:40 +0000 | |||
292 | +++ bin/addons/sourcing/procurement_order.py 2017-10-03 16:52:18 +0000 | |||
293 | @@ -114,6 +114,10 @@ | |||
294 | 114 | line.update({'origin': origin_line.order_id.name}) | 114 | line.update({'origin': origin_line.order_id.name}) |
295 | 115 | if origin_line.stock_take_date: | 115 | if origin_line.stock_take_date: |
296 | 116 | line.update({'stock_take_date': origin_line.stock_take_date}) | 116 | line.update({'stock_take_date': origin_line.stock_take_date}) |
297 | 117 | if origin_line.original_qty: | ||
298 | 118 | line.update({'original_qty': origin_line.original_qty}) | ||
299 | 119 | if origin_line.original_uom: | ||
300 | 120 | line.update({'original_uom': origin_line.original_uom.id}) | ||
301 | 117 | else: | 121 | else: |
302 | 118 | # Update the link to the original FO to create new line on it at PO confirmation | 122 | # Update the link to the original FO to create new line on it at PO confirmation |
303 | 119 | procurement = kwargs['procurement'] | 123 | procurement = kwargs['procurement'] |
304 | 120 | 124 | ||
305 | === modified file 'bin/addons/sourcing/sale_order_line.py' | |||
306 | --- bin/addons/sourcing/sale_order_line.py 2017-09-25 08:50:10 +0000 | |||
307 | +++ bin/addons/sourcing/sale_order_line.py 2017-10-03 16:52:18 +0000 | |||
308 | @@ -1617,6 +1617,11 @@ | |||
309 | 1617 | 'analytic_distribution_id': anal_dist, | 1617 | 'analytic_distribution_id': anal_dist, |
310 | 1618 | 'link_so_id': sourcing_line.order_id.id, | 1618 | 'link_so_id': sourcing_line.order_id.id, |
311 | 1619 | } | 1619 | } |
312 | 1620 | if sourcing_line.procurement_request: | ||
313 | 1621 | pol_values.update({ | ||
314 | 1622 | 'original_qty': sourcing_line.original_qty, | ||
315 | 1623 | 'original_uom': sourcing_line.original_uom.id, | ||
316 | 1624 | }) | ||
317 | 1620 | self.pool.get('purchase.order.line').create(cr, uid, pol_values, context=context) | 1625 | self.pool.get('purchase.order.line').create(cr, uid, pol_values, context=context) |
318 | 1621 | self.pool.get('purchase.order').write(cr, uid, po_to_use, {'dest_partner_ids': [(4, sourcing_line.order_id.partner_id.id, 0)]}, context=context) | 1626 | self.pool.get('purchase.order').write(cr, uid, po_to_use, {'dest_partner_ids': [(4, sourcing_line.order_id.partner_id.id, 0)]}, context=context) |
319 | 1622 | 1627 | ||
320 | @@ -1645,6 +1650,11 @@ | |||
321 | 1645 | 'analytic_distribution_id': anal_dist, | 1650 | 'analytic_distribution_id': anal_dist, |
322 | 1646 | 'link_so_id': sourcing_line.order_id.id, | 1651 | 'link_so_id': sourcing_line.order_id.id, |
323 | 1647 | } | 1652 | } |
324 | 1653 | if sourcing_line.procurement_request: | ||
325 | 1654 | rfq_line_values.update({ | ||
326 | 1655 | 'original_qty': sourcing_line.original_qty, | ||
327 | 1656 | 'original_uom': sourcing_line.original_uom.id, | ||
328 | 1657 | }) | ||
329 | 1648 | self.pool.get('purchase.order.line').create(cr, uid, rfq_line_values, context=context) | 1658 | self.pool.get('purchase.order.line').create(cr, uid, rfq_line_values, context=context) |
330 | 1649 | 1659 | ||
331 | 1650 | elif sourcing_line.po_cft == 'cft': | 1660 | elif sourcing_line.po_cft == 'cft': |
332 | @@ -1658,7 +1668,7 @@ | |||
333 | 1658 | # attach tender line: | 1668 | # attach tender line: |
334 | 1659 | proc_location_id = self.pool.get('stock.location').search(cr, uid, [('usage', '=', 'procurement')], context=context) | 1669 | proc_location_id = self.pool.get('stock.location').search(cr, uid, [('usage', '=', 'procurement')], context=context) |
335 | 1660 | proc_location_id = proc_location_id[0] if proc_location_id else False | 1670 | proc_location_id = proc_location_id[0] if proc_location_id else False |
337 | 1661 | self.pool.get('tender.line').create(cr, uid, { | 1671 | tender_values = { |
338 | 1662 | 'product_id': sourcing_line.product_id.id, | 1672 | 'product_id': sourcing_line.product_id.id, |
339 | 1663 | 'comment': sourcing_line.comment, | 1673 | 'comment': sourcing_line.comment, |
340 | 1664 | 'qty': sourcing_line.product_uom_qty, | 1674 | 'qty': sourcing_line.product_uom_qty, |
341 | @@ -1666,7 +1676,13 @@ | |||
342 | 1666 | 'tender_id': tender_to_use, | 1676 | 'tender_id': tender_to_use, |
343 | 1667 | 'sale_order_line_id': sourcing_line.id, | 1677 | 'sale_order_line_id': sourcing_line.id, |
344 | 1668 | 'location_id': proc_location_id, | 1678 | 'location_id': proc_location_id, |
346 | 1669 | }, context=context) | 1679 | } |
347 | 1680 | if sourcing_line.procurement_request: | ||
348 | 1681 | tender_values.update({ | ||
349 | 1682 | 'original_qty': sourcing_line.original_qty, | ||
350 | 1683 | 'original_uom': sourcing_line.original_uom.id, | ||
351 | 1684 | }) | ||
352 | 1685 | self.pool.get('tender.line').create(cr, uid, tender_values, context=context) | ||
353 | 1670 | 1686 | ||
354 | 1671 | wf_service.trg_validate(uid, 'sale.order.line', sourcing_line.id, 'sourced', cr) | 1687 | wf_service.trg_validate(uid, 'sale.order.line', sourcing_line.id, 'sourced', cr) |
355 | 1672 | 1688 | ||
356 | 1673 | 1689 | ||
357 | === modified file 'bin/addons/sync_so/purchase.py' | |||
358 | --- bin/addons/sync_so/purchase.py 2017-09-20 15:04:19 +0000 | |||
359 | +++ bin/addons/sync_so/purchase.py 2017-10-03 16:52:18 +0000 | |||
360 | @@ -74,6 +74,7 @@ | |||
361 | 74 | order_name = sol_dict['order_id']['name'] | 74 | order_name = sol_dict['order_id']['name'] |
362 | 75 | pol_values['order_id'] = po_ids[0] | 75 | pol_values['order_id'] = po_ids[0] |
363 | 76 | pol_values['sync_linked_sol'] = sol_dict['sync_local_id'] | 76 | pol_values['sync_linked_sol'] = sol_dict['sync_local_id'] |
364 | 77 | pol_values['modification_comment'] = sol_dict.get('modification_comment', False) | ||
365 | 77 | if 'line_number' in pol_values: | 78 | if 'line_number' in pol_values: |
366 | 78 | del(pol_values['line_number']) | 79 | del(pol_values['line_number']) |
367 | 79 | 80 | ||
368 | @@ -210,7 +211,6 @@ | |||
369 | 210 | ondelete='cascade', | 211 | ondelete='cascade', |
370 | 211 | ), | 212 | ), |
371 | 212 | 'original_qty': fields.float( | 213 | 'original_qty': fields.float( |
372 | 213 | digits=(16,2), | ||
373 | 214 | string='Original qty', | 214 | string='Original qty', |
374 | 215 | required=False, | 215 | required=False, |
375 | 216 | readonly=True, | 216 | readonly=True, |