Odoo Aide

0
1 Answer
4
Asmita Chavan
25/04/2017 03:47

You can check default_invoice_policy field definition,

default_invoice_policy = fields.Selection([
('order', 'Invoice ordered quantities'),
('delivery', 'Invoice delivered quantities')
], 'Default Invoicing',
default='order',
default_model='product.template')

In this field definition, default_model is set as product.template, so this value is not set under model 'sale.config.settings', but it is set under model 'product.template' with name invoice_policy,

So, you have to retrieve value using,

def_inv = ir_values.get_default('product.template', 'invoice_policy')

same applies for picking policy too, picking policy value is set under sale.order model.

In ir.values you can observed that no value is set with name which starts with default_ , there is always substitute field added in another model, to set that value.

Poser une question
Writer
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