[FIX] account: improve warnings.warn call
As-is, the warning will reports that post() is called from within post, which is not very convenient when trying to find what calls post() (as there are other "post" methods in the system). By increasing the stacklevel from 1 (default) to 2, the warning will report the method's caller, which is a lot more useful. closes odoo/odoo#60043 X-original-commit: 5bc6eb9b387112138ac118726ff746bad6d00f8d Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
This commit is contained in:
@@ -2331,7 +2331,8 @@ class AccountMove(models.Model):
|
||||
def post(self):
|
||||
warnings.warn(
|
||||
"RedirectWarning method 'post()' is a deprecated alias to 'action_post()' or _post()",
|
||||
DeprecationWarning
|
||||
DeprecationWarning,
|
||||
stacklevel=2
|
||||
)
|
||||
return self.action_post()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user