Merge lp:~jfb-tempo-consulting/unifield-server/DF-rec into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 5579
Proposed branch: lp:~jfb-tempo-consulting/unifield-server/DF-rec
Merge into: lp:unifield-server
Diff against target: 107 lines (+59/-0)
4 files modified
bin/addons/msf_profile/data/patches.xml (+4/-0)
bin/addons/msf_profile/msf_profile.py (+53/-0)
bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv (+1/-0)
bin/addons/sync_common/common.py (+1/-0)
To merge this branch: bzr merge lp:~jfb-tempo-consulting/unifield-server/DF-rec
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+377632@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_profile/data/patches.xml'
--- bin/addons/msf_profile/data/patches.xml 2020-01-06 17:23:45 +0000
+++ bin/addons/msf_profile/data/patches.xml 2020-01-17 13:26:16 +0000
@@ -486,5 +486,9 @@
486 <field name="method">us_6905_manage_bned_switch</field>486 <field name="method">us_6905_manage_bned_switch</field>
487 </record>487 </record>
488488
489 <record id="rec_entries_uf14_1_uf15" model="patch.scripts">
490 <field name="method">rec_entries_uf14_1_uf15</field>
491 </record>
492
489 </data>493 </data>
490</openerp>494</openerp>
491495
=== modified file 'bin/addons/msf_profile/msf_profile.py'
--- bin/addons/msf_profile/msf_profile.py 2020-01-06 17:23:45 +0000
+++ bin/addons/msf_profile/msf_profile.py 2020-01-17 13:26:16 +0000
@@ -52,6 +52,27 @@
52 'model': lambda *a: 'patch.scripts',52 'model': lambda *a: 'patch.scripts',
53 }53 }
5454
55 # UF15.2
56 def rec_entries_uf14_1_uf15(self, cr, uid, *a, **b):
57 current_instance = self.pool.get('res.users').browse(cr, uid, uid, fields_to_fetch=['company_id']).company_id.instance_id
58 if current_instance:
59 trigger_obj = self.pool.get('sync.trigger.something.target')
60 cr.execute('''
61 select sdref, values, source from sync_client_update_received where model='account.move.reconcile' and execution_date > ( select applied from sync_client_version where name='UF15.0') and fields not like '%action_date%'
62 ''')
63
64 for update in cr.fetchall():
65 rec_number = False
66 try:
67 rec_number = eval(update[1])
68 except:
69 self._logger.warn('Unable to parse values, sdref: %s' % update[0])
70
71 if rec_number:
72 trigger_obj.create(cr, uid, {'name': 'trigger_rec', 'destination': update[2] , 'args': rec_number[0], 'local': True})
73
74 return True
75
55 # UF15.176 # UF15.1
56 def us_6930_gen_unreconcile(self, cr, uid, *a, **b):77 def us_6930_gen_unreconcile(self, cr, uid, *a, **b):
57 # generate updates to delete reconcile done after UF15.078 # generate updates to delete reconcile done after UF15.0
@@ -3544,6 +3565,38 @@
35443565
3545communication_config()3566communication_config()
35463567
3568class sync_tigger_something_target(osv.osv):
3569 _name = 'sync.trigger.something.target'
3570
3571 _columns = {
3572 'name': fields.char('Name', size=256, select=1),
3573 'destination': fields.char('Destination', size=256, select=1),
3574 'args': fields.text('Args', select=1),
3575 'local': fields.boolean('Generated on the instance'),
3576 }
3577
3578 _defaults = {
3579 'local': False,
3580 }
3581 def create(self, cr, uid, vals, context=None):
3582 if context is None:
3583 context = {}
3584 if context.get('sync_update_execution') and vals.get('name') == 'trigger_rec':
3585 current_instance = self.pool.get('res.users').browse(cr, uid, uid, fields_to_fetch=['company_id']).company_id.instance_id
3586 if current_instance.instance == vals.get('destination'):
3587 # coordo retrieves updates targeted to project
3588 rec_obj = self.pool.get('account.move.reconcile')
3589 # check if this rec num was already requested by an instance
3590 if not self.search(cr, uid, [('name', '=', 'trigger_rec'), ('args', '=', vals['args']), ('local', '=', False)], context=context):
3591 rec_ids = rec_obj.search(cr, uid, [('name', '=', vals['args'])], context=context)
3592 if rec_ids:
3593 cr.execute('''update account_move_reconcile set action_date=create_date where id in %s''', (tuple(rec_ids),))
3594 cr.execute('''update ir_model_data set last_modification=NOW(), touched='[''name'']' where model='account.move.reconcile' and res_id in %s ''', (tuple(rec_ids),))
3595
3596 return super(sync_tigger_something_target, self).create(cr, uid, vals, context)
3597
3598sync_tigger_something_target()
3599
3547class sync_tigger_something(osv.osv):3600class sync_tigger_something(osv.osv):
3548 _name = 'sync.trigger.something'3601 _name = 'sync.trigger.something'
35493602
35503603
=== modified file 'bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv'
--- bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv 2019-12-27 12:31:18 +0000
+++ bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv 2020-01-17 13:26:16 +0000
@@ -1,5 +1,6 @@
1id,active,applies_to_type,can_delete,master_data,direction_usb,direction,domain,included_fields,type_id,model_id,owner_field,name,status,forced_values,sequence_number1id,active,applies_to_type,can_delete,master_data,direction_usb,direction,domain,included_fields,type_id,model_id,owner_field,name,status,forced_values,sequence_number
2msf_sync_data_server.trigger_something_up,TRUE,TRUE,FALSE,TRUE,cp_to_rw,Up,"[]","['name', 'args']",OC,sync.trigger.something.up,,Trigger Something Up,Valid,,102msf_sync_data_server.trigger_something_up,TRUE,TRUE,FALSE,TRUE,cp_to_rw,Up,"[]","['name', 'args']",OC,sync.trigger.something.up,,Trigger Something Up,Valid,,10
3msf_sync_data_server.trigger_something_target,TRUE,TRUE,FALSE,TRUE,bidirectional,Bidirectional-Private,"[]","['name', 'args', 'destination']",OC,sync.trigger.something.target,destination,Trigger Something Target,Valid,,15
3msf_sync_data_server.analytic_account,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,"[('category' , 'in' , ['FREE1', 'FREE2', 'DEST'])]","['category', 'code', 'date', 'date_start', 'description', 'name', 'type']",OC,account.analytic.account,,Analytic Accounts (Free 1 & 2 & Destination),Valid,,1004msf_sync_data_server.analytic_account,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,"[('category' , 'in' , ['FREE1', 'FREE2', 'DEST'])]","['category', 'code', 'date', 'date_start', 'description', 'name', 'type']",OC,account.analytic.account,,Analytic Accounts (Free 1 & 2 & Destination),Valid,,100
4msf_sync_data_server.cost_center_hq,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,"[('category' , '=' , 'OC'), ('parent_id', '=', '')]","['category', 'code', 'date', 'date_start', 'description', 'name', 'type']",OC,account.analytic.account,,Cost Center (HQ),Valid,,1015msf_sync_data_server.cost_center_hq,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,"[('category' , '=' , 'OC'), ('parent_id', '=', '')]","['category', 'code', 'date', 'date_start', 'description', 'name', 'type']",OC,account.analytic.account,,Cost Center (HQ),Valid,,101
5msf_sync_data_server.cost_center,TRUE,TRUE,TRUE,TRUE,bidirectional,Bidirectional-Private,"[('category' , '=' , 'OC'), ('parent_id', '!=', ''), ('code', '!=', 'cc-intermission')]","['category', 'code', 'date', 'date_start', 'description', 'name', 'type']",OC,account.analytic.account,category,Cost Center,Valid,,1026msf_sync_data_server.cost_center,TRUE,TRUE,TRUE,TRUE,bidirectional,Bidirectional-Private,"[('category' , '=' , 'OC'), ('parent_id', '!=', ''), ('code', '!=', 'cc-intermission')]","['category', 'code', 'date', 'date_start', 'description', 'name', 'type']",OC,account.analytic.account,category,Cost Center,Valid,,102
67
=== modified file 'bin/addons/sync_common/common.py'
--- bin/addons/sync_common/common.py 2019-06-14 14:52:08 +0000
+++ bin/addons/sync_common/common.py 2020-01-17 13:26:16 +0000
@@ -145,6 +145,7 @@
145 'sync.sale.order.line.split',145 'sync.sale.order.line.split',
146 'sync.trigger.something',146 'sync.trigger.something',
147 'sync.trigger.something.up',147 'sync.trigger.something.up',
148 'sync.trigger.something.target',
148 'sync.version.instance.monitor',149 'sync.version.instance.monitor',
149 'tender',150 'tender',
150 'tender.line',151 'tender.line',

Subscribers

People subscribed via source and target branches