Hello All,
I have Facing One problem related to One2many field Active Model .
For Example:
i am in sale order and i am create any record in sale order line than i am get active_model = sale.order. So any one help me how to get active_model = sale.order.line. I am try to pass this value using context and for this i am using get_default method.
And
How to Change One2many field language according to partner(Customer) language.
Thanks In Advanced
Could you share piece of code so that people will understand what you are exactly trying to do ?
Hello Nitin,
I am added one2many field in sale order and below my class.
class CustomerForm(models.Model):
_name = 'customer.from'
_rec_name = 'customer_name'
@api.model
def default_get(self, fields):
rec = super(CustomerForm, self).default_get(fields)
context = dict(self._context or {})
active_model = self.env.context.get('active_model', False)
return rec
My problem is when i am try to print Active Model than It's show 'sale.order' but can you tell me how to get active model name 'customer.from'.
anything wrong in above code ?