Community Mailing lijst archieven

Re: Add new models to models.js

Same Motion S.A.C, Carlos Rodriguez
- 03-03-2016 09:47:44
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 <>:
Could not find much on google, but I heard POS module is a specific development. I had subsribed and learnt from here.[1]

[1] :

On Wed, Mar 2, 2016 at 10:17 PM, Carlos Rodríguez <> 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:


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){



}, {

model: 'x_pos_promotions_line',

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

domain: null,

loaded: function(self, promotions_line){






Best regards,

Carlos Rodríguez Rossi

Post to:

Jake Shelter,

Post to: