Community mailing list archives

community@mail.odoo.com

Re: Add new models to models.js

by
Same Motion S.A.C, Carlos Rodriguez
- 03/04/2016 11:07:32
Thank you very much,

I will give it a look.

2016-03-03 22:27 GMT-05:00 Cybrosys Technologies <techsupport@cybrosys.com>:
Hi carlos,

You have to look at 'pos_restaurant' module > floors.js

there you can see how they added floors and tables to the pos.

'pos_restaurant' is also an extension of 'point_of_sale' just like your 'point_of_sale extension'.. :)

Hope it will help

On Thu, Mar 3, 2016 at 8:40 PM, Carlos Paz <phoenixsampras@gmail.com> wrote:
Unfortunately this is obsolete, for Odoo 8


Hopefully we find something for Odoo 9

On Thu, Mar 3, 2016 at 10:52 AM, Carlos Rodríguez <crodriguezrossi@gmail.com> wrote:
Thank you Cybrosys,

I have read the model.js indeed but I can not figure out how to inherit ir in order to add more models using another *.js file.

Can you give me some advice?

Best regards,

2016-03-02 22:22 GMT-05:00 Jake Shelter <shelterjake7@gmail.com>:
Could not find much on google, but I heard POS module is a specific development. I had subsribed and learnt from here.[1]

[1] : https://www.udemy.com/odoo-pos-technical/?couponCode=POSWEB29

On Wed, Mar 2, 2016 at 10:17 PM, Carlos Rodríguez <crodriguezrossi@gmail.com> wrote:

Hello community,


How can I propperly extend the models.js of the Point Of Sale (v9) in order to add a new model?

Need to do it using another js (ie, mymodels.js) I have tried with the following code:


/*mymodels.js*/

odoo.define('point_of_sale_extension', function (require) {

"use strict";

var Model = require('web.DataModel');

var core = require('web.core');

var QWeb = core.qweb;

var _t = core._t;

var module = require('point_of_sale.DB');

var pos_model = require('point_of_sale.models');

var models = pos_model.PosModel.prototype.models;

var modscreen = require('point_of_sale.screens');


models.push ([

{

model: 'x_pos_promotions',

fields: ['x_name', 'x_promo_type', 'x_from_date', 'x_to_date', 'x_buy_qty', 'x_get_qty', 'x_discount', 'x_get_product'],

domain: null,

loaded: function(self, promotions){

module.add_promotions(promotions);

},

}, {

model: 'x_pos_promotions_line',

fields: ['x_buy_product','x_promotion_id'],

domain: null,

loaded: function(self, promotions_line){

module.add_promotions_line(promotions_line);

},

}

]);

)};


Best regards,

Carlos Rodríguez Rossi

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




--
BR,
Jake Shelter,
Developer

_______________________________________________
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




--
 
Cybrosys 
www.cybrosys.com
TECHNICAL SUPPORT
Cybrosys Odoo Department
 
 techsupport@cybrosys.com
 +91 494 3015006 / 07
 +91 8606827707
 cybrosystech
 
 
Facebook Twitter LinkedIn Google Plus Pinterest Company
 
This email and any file transmitted with it are confidential and intended solely for the use of the individual or entity whom they are addressed.If you have received this email in errort please notify the system manager. The company accepts no liability for any damage caused by any virus transmitted by this email.

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