Community mailing list archives

community@mail.odoo.com

Re: Odoo 9 POS Inheritance issue

by
Serpent Consulting Services Pvt. Ltd., Jay Vora
- 02/13/2016 04:32:12
Luis,

The course on Udemy is meant for v8.

POS has been changed for each version v7, 8, 9 by architecture.

Thanks.


On Sat, Feb 13, 2016 at 2:57 PM, Carlos Paz <phoenixsampras@gmail.com> wrote:
V9 is totally different, that training course is OBSOLETE.

On Sat, Feb 13, 2016 at 4:52 AM, Mustafa Sarkazi <sarkazimustafa@gmail.com> wrote:
Luis,

Not sure if v9 is totally different, but I have subscribed the training here to learn about pos development.

Thanks.

--

Best Regards,

Mustafa Sarkazi
Technology Consultant

On Fri, Feb 12, 2016 at 9:27 PM, Luis Miguel Sarabia <luismiguel.sarabia@gmail.com> wrote:
Hi All,


I am trying to inherit ClientListScreenWidget in the screens.js of the point of sale in order to replace the function save_client_details.

In order to make the test easy I have only change the part marked in yellow. 

 this.gui.show_popup('error',_t('XYZ'));

The rest is a copy of the original function.

While adding this my custom module does not load. I get the following error message.

Imagen integrada 1

This is the code of mymodule.js. 

odoo.define('point_of_sale_extension', function (require) {
"use strict";
var modscreen = require('point_of_sale.screens');

modscreen.ClientListScreenWidget.include({

save_client_details: function(partner) {
   var self = this;
   
   var fields = {};
   this.$('.client-details-contents .detail').each(function(idx,el){
       fields[el.name] = el.value;
   });
   if (!fields.name) {
       this.gui.show_popup('error',_t('XYZ'));
       return;
   }
   
   if (this.uploaded_picture) {
       fields.image = this.uploaded_picture;
   }
   fields.id           = partner.id || false;
   fields.country_id   = fields.country_id || false;
   fields.barcode      = fields.barcode || '';
   new Model('res.partner').call('create_from_ui',[fields]).then(function(partner_id){
       self.saved_client_details(partner_id);
   },function(err,event){
       event.preventDefault();
       self.gui.show_popup('error',{
           'title': _t('Error: Could not Save Changes'),
           'body': _t('Your Internet connection is probably down.'),
       });
   });
},
});

});


Please help.


--
Luis Miguel Sarabia

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe




--

The Splendid journey of 4 years in Numbers
---
Regards,
----------------------------------------------------------------------------------------------------------------------------
Jay Vora
Managing Director


 
Direct: +91-9879354457
Office: +91-9033472982
Skype: jaynvora
Twitter : jaynvora
   
-------------------------------------------------------------------------------------------------
Visit our website : http://www.serpentcs.com
Please consider the environment before printing this email