Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
need to override account_invoice model default value of journal_id field. I'm trying to do it like this:
account_invoice(models.Model): _inherit = 'account.invoice'
inv_type = self._context.get('type', 'out_invoice')
inv_types = inv_type if isinstance(inv_type, list) else [inv_type]
company_id = self._context.get('company_id', self.env.user.company_id.id)
domain = [ ('type', 'in', filter(None, map(TYPE2JOURNAL.get, inv_types))), ('company_id', '=', company_id), ]
journal = self.env['account.journal'].search(domain, limit=1)
return journal.currency or journal.company_id.currency_id.
But def _default_currency is never override and its call from the odoo native model
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 2/17/16, 1:09 PM|
|Seen: 827 times|
|Last updated: 2/17/16, 1:18 PM|