From 9c58c3f2f4ea707b27c763dd38aa0a275bdb35c4 Mon Sep 17 00:00:00 2001 From: carlosgalvez-nan Date: Tue, 10 Mar 2020 16:03:33 +0100 Subject: [PATCH] Add origin in warning of missing analytics when post an account move --- account.py | 11 ++++-- locale/ca.po | 96 +++++++++++++++++++++++++++++++++++++++++++++------- locale/es.po | 95 ++++++++++++++++++++++++++++++++++++++++++++------- messages.xml | 15 ++++---- 4 files changed, 184 insertions(+), 33 deletions(-) diff --git a/account.py b/account.py index 05fc269..8ab0687 100644 --- a/account.py +++ b/account.py @@ -121,12 +121,16 @@ class Account(metaclass=PoolMeta): class Move(metaclass=PoolMeta): __name__ = 'account.move' - @classmethod @ModelView.button def post(cls, moves): super(Move, cls).post(moves) for move in moves: + origin = '' + origin_model = '' + if move.origin: + origin = move.origin.rec_name + origin_model = move.origin.__names__().get('model') if move.period.type == 'adjustment': continue for line in move.lines: @@ -139,8 +143,9 @@ class Move(metaclass=PoolMeta): line.account.name), roots=', '.join(r.rec_name for r in required_roots), + origin=origin, + origin_model=origin_model, )) - for analytic_line in line.analytic_lines: if analytic_line.account.root in required_roots: required_roots.remove(analytic_line.account.root) @@ -162,6 +167,8 @@ class Move(metaclass=PoolMeta): line.account.name), roots=', '.join(r.rec_name for r in required_roots), + origin=origin, + origin_model=origin_model, )) diff --git a/locale/ca.po b/locale/ca.po index ea2a61f..b9f7dd8 100644 --- a/locale/ca.po +++ b/locale/ca.po @@ -47,6 +47,31 @@ msgctxt "" msgid "Analytic Account" msgstr "Compte analític" +msgctxt "" +"field:analytic_account.account-forbidden-account.account,create_date:" +msgid "Create Date" +msgstr "Data de creació" + +msgctxt "field:analytic_account.account-forbidden-account.account,create_uid:" +msgid "Create User" +msgstr "Usuari de creació" + +msgctxt "field:analytic_account.account-forbidden-account.account,id:" +msgid "ID" +msgstr "Identificació" + +msgctxt "field:analytic_account.account-forbidden-account.account,rec_name:" +msgid "Name" +msgstr "Nom registre" + +msgctxt "field:analytic_account.account-forbidden-account.account,write_date:" +msgid "Write Date" +msgstr "Data de modificació" + +msgctxt "field:analytic_account.account-forbidden-account.account,write_uid:" +msgid "Write User" +msgstr "Usuari de modificació" + msgctxt "field:analytic_account.account-optional-account.account,account:" msgid "Account" msgstr "Compte" @@ -56,6 +81,30 @@ msgctxt "" msgid "Analytic Account" msgstr "Compte analític" +msgctxt "field:analytic_account.account-optional-account.account,create_date:" +msgid "Create Date" +msgstr "Data de creació" + +msgctxt "field:analytic_account.account-optional-account.account,create_uid:" +msgid "Create User" +msgstr "Usuari de creació" + +msgctxt "field:analytic_account.account-optional-account.account,id:" +msgid "ID" +msgstr "Identificació" + +msgctxt "field:analytic_account.account-optional-account.account,rec_name:" +msgid "Name" +msgstr "Nom registre" + +msgctxt "field:analytic_account.account-optional-account.account,write_date:" +msgid "Write Date" +msgstr "Data de modificació" + +msgctxt "field:analytic_account.account-optional-account.account,write_uid:" +msgid "Write User" +msgstr "Usuari de modificació" + msgctxt "field:analytic_account.account-required-account.account,account:" msgid "Account" msgstr "Compte" @@ -65,6 +114,30 @@ msgctxt "" msgid "Analytic Account" msgstr "Compte analític" +msgctxt "field:analytic_account.account-required-account.account,create_date:" +msgid "Create Date" +msgstr "Data de creació" + +msgctxt "field:analytic_account.account-required-account.account,create_uid:" +msgid "Create User" +msgstr "Usuari de creació" + +msgctxt "field:analytic_account.account-required-account.account,id:" +msgid "ID" +msgstr "Identificació" + +msgctxt "field:analytic_account.account-required-account.account,rec_name:" +msgid "Name" +msgstr "Nom registre" + +msgctxt "field:analytic_account.account-required-account.account,write_date:" +msgid "Write Date" +msgstr "Data de modificació" + +msgctxt "field:analytic_account.account-required-account.account,write_uid:" +msgid "Write User" +msgstr "Usuari de modificació" + msgctxt "field:analytic_account.line,company:" msgid "Company" msgstr "Empresa" @@ -107,7 +180,7 @@ msgstr "Compte analític - Compte - Requerit" msgctxt "model:ir.message,text:account_analytic_not_configured" msgid "" -"The Move Line \"%(line)s\" is related to the Account \"%(account)s\" which " +"Move Line \"%(line)s\" is related to the Account \"%(account)s\" which " "is not configured for all Analytic hierarchies" msgstr "" "L'apunt \"%(line)s\" està associat al compte \"%(account)s\" el qual no està" @@ -115,7 +188,7 @@ msgstr "" msgctxt "model:ir.message,text:analytic_account_forbidden_optional" msgid "" -"The Account \"%(account)s\" has configured the next Analytic Roots as " +"Account \"%(account)s\" has configured the next Analytic Roots as " "Forbidden and Optional at once: %(roots)s." msgstr "" "El compte \"%(account)s\" té configurades les següents jerarquies " @@ -123,7 +196,7 @@ msgstr "" msgctxt "model:ir.message,text:analytic_account_required_forbidden" msgid "" -"The Account \"%(account)s\" has configured the next Analytic Roots as " +"Account \"%(account)s\" has configured the next Analytic Roots as " "Required and Forbidden at once: %(roots)s." msgstr "" "El compte \"%(account)s\" té configurades les següents jerarquies " @@ -131,7 +204,7 @@ msgstr "" msgctxt "model:ir.message,text:analytic_account_required_optional" msgid "" -"The Account \"%(account)s\" has configured the next Analytic Roots as " +"Account \"%(account)s\" has configured the next Analytic Roots as " "Required and Optional at once: %(roots)s." msgstr "" "El compte \"%(account)s\" té configurades les següents jerarquies " @@ -139,7 +212,7 @@ msgstr "" msgctxt "model:ir.message,text:invalid_analytic_to_post_move" msgid "" -"The Account Move \"%(move)s\" can't be posted because the Analytic Lines of " +"Account Move \"%(move)s\" can't be posted because the Analytic Lines of " "hierachy \"%(root)s\" related to Move Line \"%(line)s\" are not valid." msgstr "" "L'assentament \"%(move)s\" no pot ser confirmat perque les línies " @@ -148,17 +221,16 @@ msgstr "" msgctxt "model:ir.message,text:missing_analytic_lines" msgid "" -"The Account Move \"%(move)s\" can't be posted because it doesn't have " -"analytic lines for the next required analytic hierachies: %(roots)s." -"\nFor the account %(account)s" +"Account Move \"%(move)s\" with origin %(origin_model)s \"%(origin)s\" can't be posted because it doesn't have analytic lines for the next required analytic hierachies: %(roots)s.\n" +" For the account %(account)s." msgstr "" -"L'assentament \"%(move)s\" no es pot validar perquè no te línies analítiques" -" de les següents jerarquies obligatories \"%(roots)s\"." -"\nPer la compte %(account)s" +"L'assentament \"%(move)s\" amb origen %(origin_model)s %(origin)s no es pot " +"validar perquè no te línies analítiques de les següents jerarquies " +"obligatories \"%(roots)s\".Pel compte %(account)s" msgctxt "model:ir.message,text:move_line_account_analytic_forbidden" msgid "" -"The Analytic Line \"%(line)s\" is related to an Account Move Line of Account" +"Analytic Line \"%(line)s\" is related to an Account Move Line of Account" " \"%(account)s\" which has the analytics forbidden for the Line\\'s Analytic" " hierarchy." msgstr "" diff --git a/locale/es.po b/locale/es.po index d7442ca..3bcfb24 100644 --- a/locale/es.po +++ b/locale/es.po @@ -47,6 +47,31 @@ msgctxt "" msgid "Analytic Account" msgstr "Cuenta analítica" +msgctxt "" +"field:analytic_account.account-forbidden-account.account,create_date:" +msgid "Create Date" +msgstr "Fecha de creación" + +msgctxt "field:analytic_account.account-forbidden-account.account,create_uid:" +msgid "Create User" +msgstr "Usuario de creación" + +msgctxt "field:analytic_account.account-forbidden-account.account,id:" +msgid "ID" +msgstr "Identificador" + +msgctxt "field:analytic_account.account-forbidden-account.account,rec_name:" +msgid "Name" +msgstr "Nombre registro" + +msgctxt "field:analytic_account.account-forbidden-account.account,write_date:" +msgid "Write Date" +msgstr "Fecha modificación" + +msgctxt "field:analytic_account.account-forbidden-account.account,write_uid:" +msgid "Write User" +msgstr "Usuario modificación" + msgctxt "field:analytic_account.account-optional-account.account,account:" msgid "Account" msgstr "Cuenta" @@ -56,6 +81,30 @@ msgctxt "" msgid "Analytic Account" msgstr "Cuenta analítica" +msgctxt "field:analytic_account.account-optional-account.account,create_date:" +msgid "Create Date" +msgstr "Fecha de creación" + +msgctxt "field:analytic_account.account-optional-account.account,create_uid:" +msgid "Create User" +msgstr "Usuario de creación" + +msgctxt "field:analytic_account.account-optional-account.account,id:" +msgid "ID" +msgstr "Identificador" + +msgctxt "field:analytic_account.account-optional-account.account,rec_name:" +msgid "Name" +msgstr "Nombre registro" + +msgctxt "field:analytic_account.account-optional-account.account,write_date:" +msgid "Write Date" +msgstr "Fecha modificación" + +msgctxt "field:analytic_account.account-optional-account.account,write_uid:" +msgid "Write User" +msgstr "Usuario modificación" + msgctxt "field:analytic_account.account-required-account.account,account:" msgid "Account" msgstr "Cuenta" @@ -65,6 +114,30 @@ msgctxt "" msgid "Analytic Account" msgstr "Cuenta analítica" +msgctxt "field:analytic_account.account-required-account.account,create_date:" +msgid "Create Date" +msgstr "Fecha de creación" + +msgctxt "field:analytic_account.account-required-account.account,create_uid:" +msgid "Create User" +msgstr "Usuario de creación" + +msgctxt "field:analytic_account.account-required-account.account,id:" +msgid "ID" +msgstr "Identificador" + +msgctxt "field:analytic_account.account-required-account.account,rec_name:" +msgid "Name" +msgstr "Nombre registro" + +msgctxt "field:analytic_account.account-required-account.account,write_date:" +msgid "Write Date" +msgstr "Fecha modificación" + +msgctxt "field:analytic_account.account-required-account.account,write_uid:" +msgid "Write User" +msgstr "Usuario modificación" + msgctxt "field:analytic_account.line,company:" msgid "Company" msgstr "Empresa" @@ -107,7 +180,7 @@ msgstr "Cuenta analítica - Cuenta - Requerida" msgctxt "model:ir.message,text:account_analytic_not_configured" msgid "" -"The Move Line \"%(line)s\" is related to the Account \"%(account)s\" which " +"Move Line \"%(line)s\" is related to the Account \"%(account)s\" which " "is not configured for all Analytic hierarchies" msgstr "" "El apunte \"%(line)s\" está asociado a la cuenta \"%(account)s\" la cual no " @@ -115,7 +188,7 @@ msgstr "" msgctxt "model:ir.message,text:analytic_account_forbidden_optional" msgid "" -"The Account \"%(account)s\" has configured the next Analytic Roots as " +"Account \"%(account)s\" has configured the next Analytic Roots as " "Forbidden and Optional at once: %(roots)s." msgstr "" "La cuenta \"%(account)s\" tiene configuradas las siguientes jerarquías " @@ -123,7 +196,7 @@ msgstr "" msgctxt "model:ir.message,text:analytic_account_required_forbidden" msgid "" -"The Account \"%(account)s\" has configured the next Analytic Roots as " +"Account \"%(account)s\" has configured the next Analytic Roots as " "Required and Forbidden at once: %(roots)s." msgstr "" "La cuenta \"%(account)s\" tiene configuradas las siguientes jerarquías " @@ -131,7 +204,7 @@ msgstr "" msgctxt "model:ir.message,text:analytic_account_required_optional" msgid "" -"The Account \"%(account)s\" has configured the next Analytic Roots as " +"Account \"%(account)s\" has configured the next Analytic Roots as " "Required and Optional at once: %(roots)s." msgstr "" "La cuenta \"%(account)s\" tiene configuradas las siguientes jerarquías " @@ -139,7 +212,7 @@ msgstr "" msgctxt "model:ir.message,text:invalid_analytic_to_post_move" msgid "" -"The Account Move \"%(move)s\" can't be posted because the Analytic Lines of " +"Account Move \"%(move)s\" can't be posted because the Analytic Lines of " "hierachy \"%(root)s\" related to Move Line \"%(line)s\" are not valid." msgstr "" "El asiento \"%(move)s\" no se puede confirmar porque las líneas analíticas " @@ -148,17 +221,15 @@ msgstr "" msgctxt "model:ir.message,text:missing_analytic_lines" msgid "" -"The Account Move \"%(move)s\" can't be posted because it doesn't have " -"analytic lines for the next required analytic hierachies: %(roots)s." -"\nFor the account %(account)s" +"Account Move \"%(move)s\" with origin %(origin_model)s \"%(origin)s\" can't be posted because it doesn't have analytic lines for the next required analytic hierachies: %(roots)s.\n" +" For the account %(account)s." msgstr "" -"El asiento \"%(move)s\" no se puede validar porqué no tiene líneas " -"analíticas para las siguientes jerarquías obligatorias: %(roots)s." -"\nPara la cuenta %(account)s" +"El asiento \"%(move)s\" con origen %(origin_model)s \"%(origin)s\" no se puede validar porqué no tiene líneas analíticas para las siguientes jerarquías obligatorias: %(roots)s.\n" +"Para la cuenta %(account)s" msgctxt "model:ir.message,text:move_line_account_analytic_forbidden" msgid "" -"The Analytic Line \"%(line)s\" is related to an Account Move Line of Account" +"Analytic Line \"%(line)s\" is related to an Account Move Line of Account" " \"%(account)s\" which has the analytics forbidden for the Line\\'s Analytic" " hierarchy." msgstr "" diff --git a/messages.xml b/messages.xml index ad3298d..353e0de 100644 --- a/messages.xml +++ b/messages.xml @@ -4,25 +4,26 @@ this repository contains the full copyright notices and license terms. --> - The Account "%(account)s" has configured the next Analytic Roots as Required and Forbidden at once: %(roots)s. + Account "%(account)s" has configured the next Analytic Roots as Required and Forbidden at once: %(roots)s. - The Account "%(account)s" has configured the next Analytic Roots as Required and Optional at once: %(roots)s. + Account "%(account)s" has configured the next Analytic Roots as Required and Optional at once: %(roots)s. - The Account "%(account)s" has configured the next Analytic Roots as Forbidden and Optional at once: %(roots)s. + Account "%(account)s" has configured the next Analytic Roots as Forbidden and Optional at once: %(roots)s. - The Account Move "%(move)s" can't be posted because it doesn't have analytic lines for the next required analytic hierachies: %(roots)s.\nFor the account %(account)s. + Account Move "%(move)s" with origin %(origin_model)s "%(origin)s" can't be posted because it doesn't have analytic lines for the next required analytic hierachies: %(roots)s. + For the account %(account)s. - The Account Move "%(move)s" can't be posted because the Analytic Lines of hierachy "%(root)s" related to Move Line "%(line)s" are not valid. + Account Move "%(move)s" can't be posted because the Analytic Lines of hierachy "%(root)s" related to Move Line "%(line)s" are not valid. - The Move Line "%(line)s" is related to the Account "%(account)s" which is not configured for all Analytic hierarchies + Move Line "%(line)s" is related to the Account "%(account)s" which is not configured for all Analytic hierarchies - The Analytic Line "%(line)s" is related to an Account Move Line of Account "%(account)s" which has the analytics forbidden for the Line\'s Analytic hierarchy. + Analytic Line "%(line)s" is related to an Account Move Line of Account "%(account)s" which has the analytics forbidden for the Line\'s Analytic hierarchy.