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

Proposed by jftempo
Status: Merged
Merged at revision: 5371
Proposed branch: lp:~julie-w/unifield-server/US-5625
Merge into: lp:unifield-server
Diff against target: 104 lines (+61/-0)
3 files modified
bin/addons/account_override/account.py (+17/-0)
bin/addons/analytic_override/analytic_account.py (+26/-0)
bin/addons/msf_profile/i18n/fr_MF.po (+18/-0)
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-5625
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+364809@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/account_override/account.py'
--- bin/addons/account_override/account.py 2019-02-06 09:25:31 +0000
+++ bin/addons/account_override/account.py 2019-03-20 14:43:47 +0000
@@ -516,6 +516,22 @@
516 raise osv.except_osv(_('Warning !'),516 raise osv.except_osv(_('Warning !'),
517 _('An account set as "Included in revaluation" must be set as "Reconcile".'))517 _('An account set as "Included in revaluation" must be set as "Reconcile".'))
518518
519 def _check_existing_entries(self, cr, uid, account_id, context=None):
520 """
521 Displays a message visible on top of the page in case some JI booked on the account_id have a posting date
522 outside the account activation time interval
523 """
524 if context is None:
525 context = {}
526 aml_obj = self.pool.get('account.move.line')
527 if account_id and not context.get('sync_update_execution'):
528 account_fields = ['activation_date', 'inactivation_date', 'code', 'name']
529 account = self.browse(cr, uid, account_id, fields_to_fetch=account_fields, context=context)
530 aml_dom = [('account_id', '=', account_id), '|', ('date', '<', account.activation_date), ('date', '>=', account.inactivation_date)]
531 if aml_obj.search_exist(cr, uid, aml_dom, context=context):
532 self.log(cr, uid, account_id, _('At least one Journal Item using the Account "%s - %s" has a Posting Date '
533 'outside the activation dates selected.') % (account.code, account.name))
534
519 def create(self, cr, uid, vals, context=None):535 def create(self, cr, uid, vals, context=None):
520 self._check_date(vals)536 self._check_date(vals)
521 self._check_allowed_partner_type(vals)537 self._check_allowed_partner_type(vals)
@@ -541,6 +557,7 @@
541 res = res and super(account_account, self).write(cr, uid, [acc.id], newvals, context=context)557 res = res and super(account_account, self).write(cr, uid, [acc.id], newvals, context=context)
542 for account_id in ids:558 for account_id in ids:
543 self._check_reconcile_status(cr, uid, account_id, context=context)559 self._check_reconcile_status(cr, uid, account_id, context=context)
560 self._check_existing_entries(cr, uid, account_id, context=context)
544 return res561 return res
545562
546 def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):563 def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
547564
=== modified file 'bin/addons/analytic_override/analytic_account.py'
--- bin/addons/analytic_override/analytic_account.py 2019-02-14 14:44:01 +0000
+++ bin/addons/analytic_override/analytic_account.py 2019-03-20 14:43:47 +0000
@@ -442,6 +442,30 @@
442 raise osv.except_osv(_('Warning !'), _('You cannot have the same name between analytic accounts in the same category!'))442 raise osv.except_osv(_('Warning !'), _('You cannot have the same name between analytic accounts in the same category!'))
443 return True443 return True
444444
445 def _check_existing_entries(self, cr, uid, analytic_account_id, context=None):
446 """
447 Checks if some AJI booked on the analytic_account_id are outside the account activation time interval.
448 For FP and Free accounts: check is done on Doc Date. If AJI are found an error is raised to prevent Saving the account.
449 For other accounts: check is done on Posting Date. If AJI are found only a message is displayed on top of the page.
450 """
451 if context is None:
452 context = {}
453 aal_obj = self.pool.get('account.analytic.line')
454 if analytic_account_id:
455 analytic_acc_fields = ['date_start', 'date', 'code']
456 analytic_acc = self.browse(cr, uid, analytic_account_id, fields_to_fetch=analytic_acc_fields, context=context)
457 aal_dom_fp_free = [('account_id', '=', analytic_account_id),
458 '|', ('document_date', '<', analytic_acc.date_start), ('document_date', '>=', analytic_acc.date)]
459 if aal_obj.search_exist(cr, uid, aal_dom_fp_free, context=context):
460 raise osv.except_osv(_('Error'), _('At least one Analytic Journal Item using the Analytic Account %s '
461 'has a Document Date outside the activation dates selected.') % (analytic_acc.code))
462 if not context.get('sync_update_execution'):
463 aal_dom_cc_dest = ['|', ('cost_center_id', '=', analytic_account_id), ('destination_id', '=', analytic_account_id),
464 '|', ('date', '<', analytic_acc.date_start), ('date', '>=', analytic_acc.date)]
465 if aal_obj.search_exist(cr, uid, aal_dom_cc_dest, context=context):
466 self.log(cr, uid, analytic_account_id, _('At least one Analytic Journal Item using the Analytic Account %s '
467 'has a Posting Date outside the activation dates selected.') % (analytic_acc.code))
468
445 def create(self, cr, uid, vals, context=None):469 def create(self, cr, uid, vals, context=None):
446 """470 """
447 Some verifications before analytic account creation471 Some verifications before analytic account creation
@@ -485,6 +509,8 @@
485 if cat_instance:509 if cat_instance:
486 self.check_fp(cr, uid, cat_instance, context=context)510 self.check_fp(cr, uid, cat_instance, context=context)
487 self._check_name_unicity(cr, uid, ids, context=context)511 self._check_name_unicity(cr, uid, ids, context=context)
512 for analytic_acc_id in ids:
513 self._check_existing_entries(cr, uid, analytic_acc_id, context=context)
488 return res514 return res
489515
490 def unlink(self, cr, uid, ids, context=None):516 def unlink(self, cr, uid, ids, context=None):
491517
=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
--- bin/addons/msf_profile/i18n/fr_MF.po 2019-03-04 11:05:48 +0000
+++ bin/addons/msf_profile/i18n/fr_MF.po 2019-03-20 14:43:47 +0000
@@ -105335,3 +105335,21 @@
105335msgstr "\n"105335msgstr "\n"
105336" Attention: Les lignes suivantes ont des qté ou des montants sur plus de 15 chiffres. Veuillez vérifier la qté et le prix unitaire pour éviter des pertes d'information:\n"105336" Attention: Les lignes suivantes ont des qté ou des montants sur plus de 15 chiffres. Veuillez vérifier la qté et le prix unitaire pour éviter des pertes d'information:\n"
105337" "105337" "
105338
105339#. module: analytic_override
105340#: code:addons/analytic_override/analytic_account.py:460
105341#, python-format
105342msgid "At least one Analytic Journal Item using the Analytic Account %s has a Document Date outside the activation dates selected."
105343msgstr "Au moins une Ligne d'Ecriture Analytique utilisant le Compte Analytique %s a une Date de Document en dehors des dates d'activation sélectionnées."
105344
105345#. module: analytic_override
105346#: code:addons/analytic_override/analytic_account.py:466
105347#, python-format
105348msgid "At least one Analytic Journal Item using the Analytic Account %s has a Posting Date outside the activation dates selected."
105349msgstr "Au moins une Ligne d'Ecriture Analytique utilisant le Compte Analytique %s a une Date de Comptabilisation en dehors des dates d'activation sélectionnées."
105350
105351#. module: account_override
105352#: code:addons/account_override/account.py:532
105353#, python-format
105354msgid "At least one Journal Item using the Account \"%s - %s\" has a Posting Date outside the activation dates selected."
105355msgstr "Au moins une Ligne d'Ecriture Comptable utilisant le Compte \"%s - %s\" a une Date de Comptabilisation en dehors des dates d'activation sélectionnées."

Subscribers

People subscribed via source and target branches