Merge lp:~julie-w/unifield-server/US-5855 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 5333
Proposed branch: lp:~julie-w/unifield-server/US-5855
Merge into: lp:unifield-server
Diff against target: 85 lines (+27/-3)
4 files modified
bin/addons/analytic_override/analytic_account.py (+17/-1)
bin/addons/msf_instance/add_instance.py (+1/-1)
bin/addons/msf_instance/msf_instance_view.xml (+4/-1)
bin/addons/msf_profile/i18n/fr_MF.po (+5/-0)
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-5855
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+366892@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/analytic_override/analytic_account.py'
--- bin/addons/analytic_override/analytic_account.py 2019-03-20 10:39:41 +0000
+++ bin/addons/analytic_override/analytic_account.py 2019-05-03 09:51:58 +0000
@@ -211,6 +211,21 @@
211 account_ids += tmp_ids211 account_ids += tmp_ids
212 return account_ids212 return account_ids
213213
214 def _is_pf(self, cr, uid, ids, field_name, args, context=None):
215 """
216 Returns True if the Analytic Account is the default Funding Pool "MSF Private Funds"
217 """
218 res = {}
219 ir_model_obj = self.pool.get('ir.model.data')
220 # get the id of PF
221 try:
222 pf_id = ir_model_obj.get_object_reference(cr, uid, 'analytic_distribution', 'analytic_account_msf_private_funds')[1]
223 except ValueError:
224 pf_id = 0
225 for analytic_acc_id in ids:
226 res[analytic_acc_id] = analytic_acc_id == pf_id and True or False
227 return res
228
214 _columns = {229 _columns = {
215 'name': fields.char('Name', size=128, required=True, translate=1),230 'name': fields.char('Name', size=128, required=True, translate=1),
216 'code': fields.char('Code', size=24),231 'code': fields.char('Code', size=24),
@@ -228,6 +243,7 @@
228 'filter_active': fields.function(_get_active, fnct_search=_search_filter_active, type="boolean", method=True, store=False, string="Show only active analytic accounts",),243 'filter_active': fields.function(_get_active, fnct_search=_search_filter_active, type="boolean", method=True, store=False, string="Show only active analytic accounts",),
229 'intermission_restricted': fields.function(_get_fake, type="boolean", method=True, store=False, string="Domain to restrict intermission cc"),244 'intermission_restricted': fields.function(_get_fake, type="boolean", method=True, store=False, string="Domain to restrict intermission cc"),
230 'balance': fields.function(_debit_credit_bal_qtty, method=True, type='float', string='Balance', digits_compute=dp.get_precision('Account'), multi='debit_credit_bal_qtty'),245 'balance': fields.function(_debit_credit_bal_qtty, method=True, type='float', string='Balance', digits_compute=dp.get_precision('Account'), multi='debit_credit_bal_qtty'),
246 'is_pf': fields.function(_is_pf, method=True, type='boolean', string='Is the default Funding Pool "PF"', store=False),
231 }247 }
232248
233 _defaults ={249 _defaults ={
@@ -482,7 +498,7 @@
482 res = super(analytic_account, self).write(cr, uid, ids, vals, context=context)498 res = super(analytic_account, self).write(cr, uid, ids, vals, context=context)
483 self.check_access_rule(cr, uid, ids, 'write', context=context)499 self.check_access_rule(cr, uid, ids, 'write', context=context)
484 if context.get('from_web', False) or context.get('from_import_menu', False):500 if context.get('from_web', False) or context.get('from_import_menu', False):
485 cat_instance = self.read(cr, uid, ids, ['category', 'instance_id'], context=context)[0]501 cat_instance = self.read(cr, uid, ids, ['category', 'instance_id', 'is_pf'], context=context)[0]
486 if cat_instance:502 if cat_instance:
487 self.check_fp(cr, uid, cat_instance, context=context)503 self.check_fp(cr, uid, cat_instance, context=context)
488 self._check_name_unicity(cr, uid, ids, context=context)504 self._check_name_unicity(cr, uid, ids, context=context)
489505
=== modified file 'bin/addons/msf_instance/add_instance.py'
--- bin/addons/msf_instance/add_instance.py 2019-01-31 16:41:06 +0000
+++ bin/addons/msf_instance/add_instance.py 2019-05-03 09:51:58 +0000
@@ -584,7 +584,7 @@
584 return True584 return True
585 cat = vals.get('category', False)585 cat = vals.get('category', False)
586 from_import = context.get('from_import_menu', False) or context.get('from_import_data', False)586 from_import = context.get('from_import_menu', False) or context.get('from_import_data', False)
587 if cat == 'FUNDING':587 if cat == 'FUNDING' and not vals.get('is_pf', False): # skip check for PF that doesn't require a Prop. Instance
588 instance_id = vals.get('instance_id', False)588 instance_id = vals.get('instance_id', False)
589 if isinstance(instance_id, (tuple)): # UFTP-2: This is for the case of write (create: only instance_id as int is given)589 if isinstance(instance_id, (tuple)): # UFTP-2: This is for the case of write (create: only instance_id as int is given)
590 instance_id = instance_id[0]590 instance_id = instance_id[0]
591591
=== modified file 'bin/addons/msf_instance/msf_instance_view.xml'
--- bin/addons/msf_instance/msf_instance_view.xml 2018-05-22 15:08:57 +0000
+++ bin/addons/msf_instance/msf_instance_view.xml 2019-05-03 09:51:58 +0000
@@ -371,8 +371,11 @@
371 <data>371 <data>
372 <field name="parent_id" position="before">372 <field name="parent_id" position="before">
373 <field name="current_instance_type" invisible="1"/>373 <field name="current_instance_type" invisible="1"/>
374 <field name="is_pf" invisible="1"/>
374 <field name="instance_id" domain="[('level', '=', 'coordo')]"375 <field name="instance_id" domain="[('level', '=', 'coordo')]"
375 attrs="{'required': [('category', '=', 'FUNDING'), ('current_instance_type', '=', 'section')], 'invisible': [('category', '!=', 'FUNDING')], 'readonly': [('current_instance_type', '!=', 'section')]}"/>376 attrs="{'required': [('category', '=', 'FUNDING'), ('current_instance_type', '=', 'section'), ('is_pf', '=', False)],
377 'invisible': [('category', '!=', 'FUNDING')],
378 'readonly': ['|', ('current_instance_type', '!=', 'section'), ('is_pf', '=', True)]}"/>
376 </field>379 </field>
377 </data>380 </data>
378 </field>381 </field>
379382
=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
--- bin/addons/msf_profile/i18n/fr_MF.po 2019-04-08 09:30:07 +0000
+++ bin/addons/msf_profile/i18n/fr_MF.po 2019-05-03 09:51:58 +0000
@@ -105388,3 +105388,8 @@
105388#, python-format105388#, python-format
105389msgid "Product %s, BN: %s not enough stock to process quantity %s %s (stock level: %s)"105389msgid "Product %s, BN: %s not enough stock to process quantity %s %s (stock level: %s)"
105390msgstr "Produit %s, Lot: %s, pas assez de stock pour traiter la qantité %s %s (quantité en stock: %s)"105390msgstr "Produit %s, Lot: %s, pas assez de stock pour traiter la qantité %s %s (quantité en stock: %s)"
105391
105392#. module: analytic_override
105393#: field:account.analytic.account,is_pf:0
105394msgid "Is the default Funding Pool \"PF\""
105395msgstr "Est le Funding Pool par défaut \"PF\""

Subscribers

People subscribed via source and target branches