Merge lp:~unifield-team/unifield-server/us-1732 into lp:unifield-server

Proposed by Quentin THEURET @Amaris
Status: Merged
Merged at revision: 3979
Proposed branch: lp:~unifield-team/unifield-server/us-1732
Merge into: lp:unifield-server
Diff against target: 68 lines (+29/-1)
3 files modified
bin/addons/msf_profile/data/patches.xml (+4/-0)
bin/addons/msf_profile/msf_profile.py (+24/-0)
bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv (+1/-1)
To merge this branch: bzr merge lp:~unifield-team/unifield-server/us-1732
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+306872@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
1=== modified file 'bin/addons/msf_profile/data/patches.xml'
2--- bin/addons/msf_profile/data/patches.xml 2016-09-13 12:47:21 +0000
3+++ bin/addons/msf_profile/data/patches.xml 2016-09-28 08:25:10 +0000
4@@ -103,5 +103,9 @@
5 <field name="method">us_trans_admin_fr</field>
6 </record>
7
8+ <record id="us_1732_sync_state_ud" model="patch.scripts">
9+ <field name="method">us_1732_sync_state_ud</field>
10+ </record>
11+
12 </data>
13 </openerp>
14
15=== modified file 'bin/addons/msf_profile/msf_profile.py'
16--- bin/addons/msf_profile/msf_profile.py 2016-09-14 10:11:03 +0000
17+++ bin/addons/msf_profile/msf_profile.py 2016-09-28 08:25:10 +0000
18@@ -29,6 +29,9 @@
19 import logging
20 from threading import Lock
21
22+from msf_field_access_rights.osv_override import _get_instance_level
23+
24+
25 class patch_scripts(osv.osv):
26 _name = 'patch.scripts'
27 _logger = logging.getLogger('patch_scripts')
28@@ -841,6 +844,27 @@
29
30 self._logger.warn('%s local translation for UniData products deleted' % (cr.rowcount,))
31
32+ def us_1732_sync_state_ud(self, cr, uid, *a, **b):
33+ """
34+ Make the product.product with state_ud is not null as to be synchronized at HQ
35+ :param cr: Cursor to the database
36+ :param uid: ID of the res.users that calls this method
37+ :param a: Named parameters
38+ :param b: Unnamed parameters
39+ :return:
40+ """
41+ if _get_instance_level(self, cr, uid) == 'hq':
42+ cr.execute("""
43+ UPDATE ir_model_data SET last_modification = NOW(), touched = '[''state_ud'']'
44+ WHERE
45+ module = 'sd'
46+ AND
47+ model = 'product.product'
48+ AND
49+ res_id IN (
50+ SELECT id FROM product_product WHERE state_ud IS NOT NULL
51+ )""")
52+
53 patch_scripts()
54
55
56
57=== modified file 'bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv'
58--- bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv 2016-08-12 17:01:18 +0000
59+++ bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv 2016-09-28 08:25:10 +0000
60@@ -109,7 +109,7 @@
61 msf_sync_data_server.price_list_version,FALSE,TRUE,FALSE,FALSE,bidirectional,Bidirectional,[],"['active', 'date_end', 'date_start', 'name', 'pricelist_id/id']",MISSION,product.pricelist.version,,Price List Version,Valid,,561
62 msf_sync_data_server.country_restrictions,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,[],['name'],MISSION,res.country.restriction,,Country restrictions,Valid,,570
63 msf_sync_data_server.country_code_mapping,TRUE,TRUE,TRUE,TRUE,bidirectional,Down,[],"['instance_id/id', 'mapping_value']",COORDINATIONS,country.export.mapping,,Country Code Mapping,Valid,,571
64-msf_sync_data_server.oc_product_creator_itc_esc_hq,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,"['|','|','|',('international_status','=','UniData'),('international_status','=','ITC'),('international_status','=','ESC'),('international_status','=','HQ'), ('active', 'in', ['t','f'])]","['alert_time', 'batch_management', 'categ_id/id', 'closed_article', 'manufacturer_txt', 'manufacturer_ref', 'code', 'cold_chain/id', 'composed_kit', 'xmlid_code', 'cost_method', 'country_restriction/id', 'dangerous_goods', 'default_code', 'description', 'description2', 'description_purchase', 'description_sale', 'gmdn_code', 'gmdn_description', 'heat_sensitive_item/id', 'international_status/id', 'justification_code_id/id', 'library', 'life_time', 'list_ids/id','med_device_class', 'name', 'name_template', 'controlled_substance', 'nomen_manda_0/id', 'nomen_manda_1/id', 'nomen_manda_2/id', 'nomen_manda_3/id', 'options_ids/id', 'perishable', 'procure_delay', 'procure_method', 'produce_delay', 'product_catalog_page', 'product_catalog_path', 'property_account_expense/id', 'property_account_income/id', 'property_stock_account_input/id', 'property_stock_account_output/id', 'restricted_country', 'short_shelf_life', 'single_use', 'sterilized', 'standard_price', 'sublist', 'subtype', 'asset_type_id', 'supply_method', 'type', 'un_code', 'uom_id/id', 'uom_po_id/id','use_time', 'valuation', 'weight', 'weight_net', 'active', 'state', 'old_code', 'new_code', 'function_value', 'form_value', 'fit_value', 'standard_ok','transport_ok','volume', 'volume_updated', 'soq_quantity', 'soq_weight', 'soq_volume', 'msfid']",OC,product.product,,"OC Product (Creator = ITC, ESC, UniData or HQ)",Valid,,600
65+msf_sync_data_server.oc_product_creator_itc_esc_hq,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,"['|','|','|',('international_status','=','UniData'),('international_status','=','ITC'),('international_status','=','ESC'),('international_status','=','HQ'), ('active', 'in', ['t','f'])]","['alert_time', 'batch_management', 'categ_id/id', 'closed_article', 'manufacturer_txt', 'manufacturer_ref', 'code', 'cold_chain/id', 'composed_kit', 'xmlid_code', 'cost_method', 'country_restriction/id', 'dangerous_goods', 'default_code', 'description', 'description2', 'description_purchase', 'description_sale', 'gmdn_code', 'gmdn_description', 'heat_sensitive_item/id', 'international_status/id', 'justification_code_id/id', 'library', 'life_time', 'list_ids/id','med_device_class', 'name', 'name_template', 'controlled_substance', 'nomen_manda_0/id', 'nomen_manda_1/id', 'nomen_manda_2/id', 'nomen_manda_3/id', 'options_ids/id', 'perishable', 'procure_delay', 'procure_method', 'produce_delay', 'product_catalog_page', 'product_catalog_path', 'property_account_expense/id', 'property_account_income/id', 'property_stock_account_input/id', 'property_stock_account_output/id', 'restricted_country', 'short_shelf_life', 'single_use', 'sterilized', 'standard_price', 'sublist', 'subtype', 'asset_type_id', 'supply_method', 'type', 'un_code', 'uom_id/id', 'uom_po_id/id','use_time', 'valuation', 'weight', 'weight_net', 'active', 'state', 'state_ud', 'old_code', 'new_code', 'function_value', 'form_value', 'fit_value', 'standard_ok','transport_ok','volume', 'volume_updated', 'soq_quantity', 'soq_weight', 'soq_volume', 'msfid']",OC,product.product,,"OC Product (Creator = ITC, ESC, UniData or HQ)",Valid,,600
66 msf_sync_data_server.mission_product_creator_local,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,"[('international_status','=','Local'), ('active', 'in', ['t','f'])]","['alert_time', 'batch_management', 'categ_id/id', 'closed_article', 'manufacturer_txt', 'manufacturer_ref', 'code', 'xmlid_code','cold_chain/id', 'composed_kit', 'cost_method', 'country_restriction/id', 'dangerous_goods', 'default_code', 'description', 'description2', 'description_purchase', 'description_sale', 'gmdn_code', 'gmdn_description', 'heat_sensitive_item/id', 'international_status/id', 'justification_code_id/id', 'library', 'life_time', 'list_ids/id','med_device_class', 'name', 'name_template', 'controlled_substance', 'nomen_manda_0/id', 'nomen_manda_1/id', 'nomen_manda_2/id', 'nomen_manda_3/id', 'options_ids/id', 'perishable', 'procure_delay', 'procure_method', 'produce_delay', 'product_catalog_page', 'product_catalog_path', 'property_account_expense/id', 'property_account_income/id', 'property_stock_account_input/id', 'property_stock_account_output/id', 'restricted_country', 'short_shelf_life', 'single_use', 'sterilized', 'standard_price', 'sublist', 'subtype', 'asset_type_id', 'supply_method', 'type', 'un_code', 'uom_id/id', 'uom_po_id/id','use_time', 'valuation', 'weight', 'weight_net', 'active', 'state', 'old_code', 'new_code', 'function_value', 'form_value', 'fit_value', 'standard_ok','transport_ok','volume', 'volume_updated', 'soq_quantity', 'soq_weight','soq_volume']",MISSION,product.product,,Mission Product (Creator = local),Valid,,601
67 msf_sync_data_server.standard_product_list,TRUE,TRUE,TRUE,TRUE,bidirectional,Down,"[('standard_list_ok','=','True')]","['creation_date', 'creator', 'description', 'last_update_date', 'name', 'order_list_print_ok', 'ref', 'standard_list_ok', 'type']",OC,product.list,,Standard Product List,Valid,,605
68 msf_sync_data_server.standard_product_list_line,TRUE,TRUE,TRUE,TRUE,bidirectional,Down,"[('list_id' , 'in', ('product.list', 'id', [('standard_list_ok','=','True')]))]","['comment','list_id/id','ref','name']",OC,product.list.line,,Standard Product List Line,Valid,,606

Subscribers

People subscribed via source and target branches

to all changes: