2

I want to get the name of the currently used module in ODOO.

suppose there are different module named A,B,C,D. And each module has the same models like accounts, crm, hr, payroll, etc.

so I want to make changes in the payroll model of A module without affecting the inherited payroll model of other Modules.

so I want to get currently using the module/app name. Is there any code in python odoo

Kenly
  • 24,317
  • 7
  • 44
  • 60
Shahal
  • 115
  • 1
  • 12
  • crm, hr and payroll are modules not models, maybe you want to edit `crm.lead` or ` hr.employee`. Can you please paste your code or anything that is in your mind here so we can check together? – PMN Apr 19 '21 at 16:20
  • In invoicing module , want to inherit "account.payment" model. Inherited in anothere module A. so i want to make changes in A module without affectoing account.payment in Invoicing-@PMN – Shahal Apr 22 '21 at 10:34

1 Answers1

0

You can get it with the active_model context value, for example, you can use

if self._context.get('active_model') == 'account.invoice':
   # Your code here
Kenly
  • 24,317
  • 7
  • 44
  • 60
nouraellm
  • 357
  • 8
  • 15