Odoo Help

2

0
1 Answer
2
Avatar

Anil R. Kesariya (AKE) India

--Anil R. Kesariya (AKE)--
6735
| 8 7 10
Rajkot, India
--Anil R. Kesariya (AKE)--

Odoo Techno Functional Expert

* Engaged with odoo since May - 2012.

* Customise existing module or develop new module base on customer requirement.

* Played key developer role in many past and running projects.

* Expert in requirement gathering of business and transforming requirement into odoo platform.

* Major expertise in core modules, database, report development and theme development.

* Integration expert.

Linkedin  : https://in.linkedin.com/in/anil-kesariya-97b20a66

Upwork : https://www.upwork.com/fl/anilkesariya


Anil R. Kesariya (AKE) India
3/27/15, 10:58 PM

Hello All,

I found solution for this, its two step process.

1) We need to push the latest dictionary of res.company model in module list.

     module.PosModel.prototype.models.push({

     model: 'res.company',

     fields: [ 'currency_id', 'email', 'website', 'company_registry', 'vat', 'name', 'phone', 'partner_id' , 'country_id', 'fax'],

     ids: function(self){ return [self.user.company_id[0]] },

     loaded: function(self,companies){ self.company = companies[0]; },

     });


Update the new fields in this fields list : fields: [ 'currency_id', 'email', 'website', 'company_registry', 'vat', 'name', 'phone', 'partner_id' , 'country_id', 'fax'],  I have added fax no , In base fax no is not used.


2) Extend the PosModel :


     module.PosModel = module.PosModel.extend({    

      models: [{

      model: 'res.company',

      fields: [ 'currency_id', 'email', 'website', 'company_registry', 'vat', 'name', 'phone', 'partner_id' , 'country_id', 'fax'],

      ids: function(self){ return [self.user.company_id[0]] },

      loaded: function(self,companies){ self.company = companies[0]; },

      },]

      });


This is how I achieved , Now I can access that field in Qweb part of POS. is there any better way to do this?

Thanks.

Anil.


Ask a Question
Tags
Keep Informed
1 follower(s)
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