Merge lp:~unifield-team/unifield-server/us-3478 into lp:~jfb-tempo-consulting/unifield-server/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
Reviewer Review Type Date Requested Status
jftempo Pending
Review via email: mp+331725@code.launchpad.net
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
=== modified file 'bin/addons/msf_sync_data_server/data/sync_server.message_rule.csv'
--- bin/addons/msf_sync_data_server/data/sync_server.message_rule.csv 2017-09-14 08:41:12 +0000
+++ bin/addons/msf_sync_data_server/data/sync_server.message_rule.csv 2017-10-03 16:52:18 +0000
@@ -6,7 +6,7 @@
6msf_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,Valid6msf_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
7msf_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,Valid7msf_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
8msf_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,Valid8msf_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
9msf_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,Valid9msf_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
10msf_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,Valid10msf_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
11msf_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,Valid11msf_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
12msf_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,Valid12msf_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
1313
=== modified file 'bin/addons/procurement_request/procurement_request.py'
--- bin/addons/procurement_request/procurement_request.py 2017-09-14 08:41:12 +0000
+++ bin/addons/procurement_request/procurement_request.py 2017-10-03 16:52:18 +0000
@@ -684,6 +684,25 @@
684 res[pol['id']] = False684 res[pol['id']] = False
685 return res685 return res
686686
687 def _check_changed(self, cr, uid, ids, name, arg, context=None):
688 '''
689 Check if an original value has been changed
690 '''
691 if context is None:
692 context = {}
693 res = {}
694
695 for line in self.browse(cr, uid, ids, context=context):
696 changed = False
697 if line.modification_comment or (line.original_qty and line.original_price and line.original_uom):
698 if line.modification_comment or line.product_uom_qty != line.original_qty \
699 or line.price_unit != line.original_price or line.product_uom != line.original_uom:
700 changed = True
701
702 res[line.id] = changed
703
704 return res
705
687 _columns = {706 _columns = {
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')),
689 'procurement_request': fields.boolean(string='Internal Request', readonly=True),708 'procurement_request': fields.boolean(string='Internal Request', readonly=True),
@@ -696,6 +715,10 @@
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'),
697 'product_ok': fields.boolean('Product selected'),716 'product_ok': fields.boolean('Product selected'),
698 'comment_ok': fields.boolean('Comment written'),717 'comment_ok': fields.boolean('Comment written'),
718 'original_qty': fields.float('Original Qty'),
719 'original_price': fields.float('Original Price'),
720 'original_uom': fields.many2one('product.uom', 'Original UOM'),
721 'original_changed': fields.function(_check_changed, method=True, string='Changed', type='boolean'),
699 }722 }
700723
701 def _get_planned_date(self, cr, uid, c=None):724 def _get_planned_date(self, cr, uid, c=None):
702725
=== modified file 'bin/addons/procurement_request/procurement_request_view.xml'
--- bin/addons/procurement_request/procurement_request_view.xml 2017-10-02 12:27:20 +0000
+++ bin/addons/procurement_request/procurement_request_view.xml 2017-10-03 16:52:18 +0000
@@ -90,6 +90,7 @@
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'])]}"
91 icon="terp-go-week" />91 icon="terp-go-week" />
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)" />
93 <field name="original_changed" readonly="1"/>
93 <field name="price_unit"/>94 <field name="price_unit"/>
94 <field name="notes" />95 <field name="notes" />
95 <field name="display_resourced_orig_line" />96 <field name="display_resourced_orig_line" />
9697
=== modified file 'bin/addons/purchase/purchase_line.py'
--- bin/addons/purchase/purchase_line.py 2017-10-02 07:09:09 +0000
+++ bin/addons/purchase/purchase_line.py 2017-10-03 16:52:18 +0000
@@ -203,6 +203,29 @@
203203
204 return res204 return res
205205
206 def _check_changed(self, cr, uid, ids, name, arg, context=None):
207 '''
208 Check if an original value has been changed
209 '''
210 if context is None:
211 context = {}
212 res = {}
213
214 for line in self.browse(cr, uid, ids, context=context):
215 changed = False
216 if line.modification_comment\
217 or (line.original_qty and line.original_price and line.original_uom and line.original_currency_id):
218 if line.modification_comment or line.product_qty != line.original_qty \
219 or line.price_unit != line.original_price or line.product_uom != line.original_uom\
220 or line.currency_id != line.original_currency_id:
221 changed = True
222 elif line.original_qty and line.original_uom and not line.original_price: # From IR
223 if line.original_qty != line.product_qty or line.original_uom.id != line.product_uom.id:
224 changed = True
225
226 res[line.id] = changed
227
228 return res
206229
207 _columns = {230 _columns = {
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'),
@@ -288,6 +311,12 @@
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),
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"),
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),
314 'original_qty': fields.float('Original Qty'),
315 'original_price': fields.float('Original Price'),
316 'original_uom': fields.many2one('product.uom', 'Original UOM'),
317 'original_currency_id': fields.many2one('res.currency', 'Original Currency'),
318 'modification_comment': fields.char('Modification Comment', size=1024),
319 'original_changed': fields.function(_check_changed, method=True, string='Changed', type='boolean'),
291 }320 }
292 _defaults = {321 _defaults = {
293 'set_as_sourced_n': lambda *a: False,322 'set_as_sourced_n': lambda *a: False,
@@ -896,11 +925,10 @@
896 default = {}925 default = {}
897926
898 default.update({'state': 'draft', 'move_ids': [], 'invoiced': 0, 'invoice_lines': []})927 default.update({'state': 'draft', 'move_ids': [], 'invoiced': 0, 'invoice_lines': []})
899 if 'origin' not in default:
900 default.update({'origin': False})
901928
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']:
903 default.update({'move_dest_id': False})930 if field not in default:
931 default[field]= False
904932
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})
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)
907935
=== modified file 'bin/addons/purchase/purchase_view.xml'
--- bin/addons/purchase/purchase_view.xml 2017-10-02 12:27:20 +0000
+++ bin/addons/purchase/purchase_view.xml 2017-10-03 16:52:18 +0000
@@ -205,6 +205,7 @@
205 <field name="date_planned"/>205 <field name="date_planned"/>
206 <field name="name"/>206 <field name="name"/>
207 <field name="product_qty"/>207 <field name="product_qty"/>
208 <field name="original_changed" readonly="1"/>
208 <field name="product_uom"/>209 <field name="product_uom"/>
209 <field name="price_unit"/>210 <field name="price_unit"/>
210 <field name="price_subtotal"/>211 <field name="price_subtotal"/>
@@ -539,8 +540,17 @@
539 <label string=" " />540 <label string=" " />
540 <field name="account_4_distribution" invisible="1"/>541 <field name="account_4_distribution" invisible="1"/>
541 </group>542 </group>
543 <group colspan="4">
544 <group colspan="2">
545 <field name="original_qty" colspan="1" readonly="1"/>
546 <field name="original_price" colspan="1" readonly="1"/>
547 <field name="original_uom" colspan="1" readonly="1"/>
548 <field name="original_currency_id" colspan="1" readonly="1"/>
549 </group>
550 <field name="modification_comment" colspan="2"/>
551 </group>
542 <field name="vat_ok" invisible="1" />552 <field name="vat_ok" invisible="1" />
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)]}">
544 <separator colspan="4" string="Taxes"/>554 <separator colspan="4" string="Taxes"/>
545 <field colspan="4" nolabel="1" name="taxes_id"555 <field colspan="4" nolabel="1" name="taxes_id"
546 domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>556 domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
547557
=== modified file 'bin/addons/purchase/purchase_workflow.py'
--- bin/addons/purchase/purchase_workflow.py 2017-10-02 07:11:25 +0000
+++ bin/addons/purchase/purchase_workflow.py 2017-10-03 16:52:18 +0000
@@ -107,6 +107,11 @@
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,
108 'type': 'make_to_order',108 'type': 'make_to_order',
109 }109 }
110
111 # update modification comment if it is set
112 if pol.modification_comment:
113 sol_values['modification_comment'] = pol.modification_comment
114
110 if create_line:115 if create_line:
111 sol_values.update({116 sol_values.update({
112 'order_id': so_id,117 'order_id': so_id,
@@ -284,6 +289,20 @@
284 po_to_check[pol.order_id.id] = True289 po_to_check[pol.order_id.id] = True
285 if pol.linked_sol_id:290 if pol.linked_sol_id:
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)
292 # update original qty, unit price, uom and currency on line level
293 # doesn't update original qty and uom if already set (from IR)
294 line_update = {
295 'original_price': pol.price_unit,
296 'original_currency_id': pol.currency_id.id
297 }
298 if not pol.original_qty:
299 line_update['original_qty'] = pol.product_qty
300
301 if not pol.original_uom:
302 line_update['original_uom'] = pol.product_uom.id
303
304 self.write(cr, uid, pol.id, line_update, context=context)
305
287306
288 if po_to_check:307 if po_to_check:
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)
290309
=== modified file 'bin/addons/purchase_override/purchase.py'
--- bin/addons/purchase_override/purchase.py 2017-09-14 08:41:12 +0000
+++ bin/addons/purchase_override/purchase.py 2017-10-03 16:52:18 +0000
@@ -159,7 +159,6 @@
159159
160purchase_order_merged_line()160purchase_order_merged_line()
161161
162
163class purchase_order_group(osv.osv_memory):162class purchase_order_group(osv.osv_memory):
164 _name = "purchase.order.group"163 _name = "purchase.order.group"
165 _inherit = "purchase.order.group"164 _inherit = "purchase.order.group"
166165
=== modified file 'bin/addons/purchase_override/wizard/split_order_line.py'
--- bin/addons/purchase_override/wizard/split_order_line.py 2017-08-29 12:55:18 +0000
+++ bin/addons/purchase_override/wizard/split_order_line.py 2017-10-03 16:52:18 +0000
@@ -51,7 +51,7 @@
5151
52 _columns = {52 _columns = {
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),
54 'original_qty': fields.float(digits=(16,2), string='Original Quantity', readonly=True),54 'original_qty': fields.float(string='Original Quantity', readonly=True),
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),
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),
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.'),
5858
=== modified file 'bin/addons/sale/sale_order.py'
--- bin/addons/sale/sale_order.py 2017-10-02 12:27:20 +0000
+++ bin/addons/sale/sale_order.py 2017-10-03 16:52:18 +0000
@@ -1936,6 +1936,7 @@
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),
1937 'soq_updated': fields.boolean(string='SoQ updated', readonly=True),1937 'soq_updated': fields.boolean(string='SoQ updated', readonly=True),
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 transition1938 '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
1939 'modification_comment': fields.char('Modification Comment', size=1024),
1939 }1940 }
1940 _order = 'sequence, id desc'1941 _order = 'sequence, id desc'
1941 _defaults = {1942 _defaults = {
@@ -2060,6 +2061,10 @@
2060 'set_as_sourced_n': False,2061 'set_as_sourced_n': False,
2061 })2062 })
20622063
2064 for x in ['modification_comment', 'original_qty', 'original_price', 'original_uom']:
2065 if x not in default:
2066 default[x] = False
2067
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)
20642069
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,
20662071
=== modified file 'bin/addons/sale/sale_view.xml'
--- bin/addons/sale/sale_view.xml 2017-10-02 17:36:43 +0000
+++ bin/addons/sale/sale_view.xml 2017-10-03 16:52:18 +0000
@@ -179,6 +179,7 @@
179 <field name="type" groups="base.group_extended"/>179 <field name="type" groups="base.group_extended"/>
180 <field name="delay" groups="base.group_extended"/>180 <field name="delay" groups="base.group_extended"/>
181 <field name="display_resourced_orig_line"/>181 <field name="display_resourced_orig_line"/>
182 <field name="modification_comment"/>
182 <newline/>183 <newline/>
183 <separator colspan="5" string="Taxes"/>184 <separator colspan="5" string="Taxes"/>
184 <field colspan="4" name="tax_id" nolabel="1" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>185 <field colspan="4" name="tax_id" nolabel="1" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
185186
=== modified file 'bin/addons/sale/sale_workflow.py'
--- bin/addons/sale/sale_workflow.py 2017-09-29 11:06:54 +0000
+++ bin/addons/sale/sale_workflow.py 2017-10-03 16:52:18 +0000
@@ -327,8 +327,11 @@
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':
328 to_write['type'] = 'make_to_stock'328 to_write['type'] = 'make_to_stock'
329329
330 elif sol.procurement_request: # in case of IR330 elif sol.procurement_request: # in case of IR
331 pass #TODO331 to_write['original_qty'] = sol.product_uom_qty
332 to_write['original_price'] = sol.price_unit
333 to_write['original_uom'] = sol.product_uom.id
334 # pass #TODO
332335
333 if to_write:336 if to_write:
334 self.write(cr, uid, sol.id, to_write, context=context)337 self.write(cr, uid, sol.id, to_write, context=context)
335338
=== modified file 'bin/addons/sale/wizard/split_order_line.py'
--- bin/addons/sale/wizard/split_order_line.py 2017-09-05 12:48:12 +0000
+++ bin/addons/sale/wizard/split_order_line.py 2017-10-03 16:52:18 +0000
@@ -32,7 +32,7 @@
3232
33 _columns = {33 _columns = {
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),
35 'original_qty': fields.float(digits=(16,2), string='Original Quantity', readonly=True),35 'original_qty': fields.float(string='Original Quantity', readonly=True),
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),
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),
38 }38 }
3939
=== removed directory 'bin/addons/sale_override'
=== removed directory 'bin/addons/sale_override/wizard'
=== modified file 'bin/addons/sourcing/procurement_order.py'
--- bin/addons/sourcing/procurement_order.py 2017-08-03 15:16:40 +0000
+++ bin/addons/sourcing/procurement_order.py 2017-10-03 16:52:18 +0000
@@ -114,6 +114,10 @@
114 line.update({'origin': origin_line.order_id.name})114 line.update({'origin': origin_line.order_id.name})
115 if origin_line.stock_take_date:115 if origin_line.stock_take_date:
116 line.update({'stock_take_date': origin_line.stock_take_date})116 line.update({'stock_take_date': origin_line.stock_take_date})
117 if origin_line.original_qty:
118 line.update({'original_qty': origin_line.original_qty})
119 if origin_line.original_uom:
120 line.update({'original_uom': origin_line.original_uom.id})
117 else:121 else:
118 # Update the link to the original FO to create new line on it at PO confirmation122 # Update the link to the original FO to create new line on it at PO confirmation
119 procurement = kwargs['procurement']123 procurement = kwargs['procurement']
120124
=== modified file 'bin/addons/sourcing/sale_order_line.py'
--- bin/addons/sourcing/sale_order_line.py 2017-09-25 08:50:10 +0000
+++ bin/addons/sourcing/sale_order_line.py 2017-10-03 16:52:18 +0000
@@ -1617,6 +1617,11 @@
1617 'analytic_distribution_id': anal_dist,1617 'analytic_distribution_id': anal_dist,
1618 'link_so_id': sourcing_line.order_id.id,1618 'link_so_id': sourcing_line.order_id.id,
1619 }1619 }
1620 if sourcing_line.procurement_request:
1621 pol_values.update({
1622 'original_qty': sourcing_line.original_qty,
1623 'original_uom': sourcing_line.original_uom.id,
1624 })
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)
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)
16221627
@@ -1645,6 +1650,11 @@
1645 'analytic_distribution_id': anal_dist,1650 'analytic_distribution_id': anal_dist,
1646 'link_so_id': sourcing_line.order_id.id,1651 'link_so_id': sourcing_line.order_id.id,
1647 }1652 }
1653 if sourcing_line.procurement_request:
1654 rfq_line_values.update({
1655 'original_qty': sourcing_line.original_qty,
1656 'original_uom': sourcing_line.original_uom.id,
1657 })
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)
16491659
1650 elif sourcing_line.po_cft == 'cft':1660 elif sourcing_line.po_cft == 'cft':
@@ -1658,7 +1668,7 @@
1658 # attach tender line:1668 # attach tender line:
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)
1660 proc_location_id = proc_location_id[0] if proc_location_id else False1670 proc_location_id = proc_location_id[0] if proc_location_id else False
1661 self.pool.get('tender.line').create(cr, uid, {1671 tender_values = {
1662 'product_id': sourcing_line.product_id.id,1672 'product_id': sourcing_line.product_id.id,
1663 'comment': sourcing_line.comment,1673 'comment': sourcing_line.comment,
1664 'qty': sourcing_line.product_uom_qty,1674 'qty': sourcing_line.product_uom_qty,
@@ -1666,7 +1676,13 @@
1666 'tender_id': tender_to_use,1676 'tender_id': tender_to_use,
1667 'sale_order_line_id': sourcing_line.id,1677 'sale_order_line_id': sourcing_line.id,
1668 'location_id': proc_location_id,1678 'location_id': proc_location_id,
1669 }, context=context)1679 }
1680 if sourcing_line.procurement_request:
1681 tender_values.update({
1682 'original_qty': sourcing_line.original_qty,
1683 'original_uom': sourcing_line.original_uom.id,
1684 })
1685 self.pool.get('tender.line').create(cr, uid, tender_values, context=context)
16701686
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)
16721688
16731689
=== modified file 'bin/addons/sync_so/purchase.py'
--- bin/addons/sync_so/purchase.py 2017-09-20 15:04:19 +0000
+++ bin/addons/sync_so/purchase.py 2017-10-03 16:52:18 +0000
@@ -74,6 +74,7 @@
74 order_name = sol_dict['order_id']['name']74 order_name = sol_dict['order_id']['name']
75 pol_values['order_id'] = po_ids[0]75 pol_values['order_id'] = po_ids[0]
76 pol_values['sync_linked_sol'] = sol_dict['sync_local_id']76 pol_values['sync_linked_sol'] = sol_dict['sync_local_id']
77 pol_values['modification_comment'] = sol_dict.get('modification_comment', False)
77 if 'line_number' in pol_values:78 if 'line_number' in pol_values:
78 del(pol_values['line_number'])79 del(pol_values['line_number'])
7980
@@ -210,7 +211,6 @@
210 ondelete='cascade',211 ondelete='cascade',
211 ),212 ),
212 'original_qty': fields.float(213 'original_qty': fields.float(
213 digits=(16,2),
214 string='Original qty',214 string='Original qty',
215 required=False,215 required=False,
216 readonly=True,216 readonly=True,

Subscribers

People subscribed via source and target branches

to all changes: