Browse Source

Feb 24 : [UPDT] Bug Fixed 'pos_multi_variant'

pull/254/head
AjmalCybro 2 years ago
parent
commit
d548d47a38
  1. 2
      pos_multi_variant/__manifest__.py
  2. 5
      pos_multi_variant/doc/RELEASE_NOTES.md
  3. 2
      pos_multi_variant/models/pos_variants.py
  4. 5
      pos_multi_variant/static/src/js/ProductScreen.js
  5. 1
      pos_multi_variant/static/src/js/models.js

2
pos_multi_variant/__manifest__.py

@ -21,7 +21,7 @@
############################################################################# #############################################################################
{ {
'name': "POS Product Multi variant", 'name': "POS Product Multi variant",
'version': '15.0.1.0.1', 'version': '15.0.1.0.2',
'summary': """Product with multi-variants""", 'summary': """Product with multi-variants""",
'description': """Configure products having variants in POS""", 'description': """Configure products having variants in POS""",
'author': 'Cybrosys Techno Solutions', 'author': 'Cybrosys Techno Solutions',

5
pos_multi_variant/doc/RELEASE_NOTES.md

@ -5,3 +5,8 @@
##### ADD ##### ADD
- Initial commit for pos_multi_variant - Initial commit for pos_multi_variant
#### 18.02.2023
#### Version 15.0.1.0.2
##### FIX
- Bug fix

2
pos_multi_variant/models/pos_variants.py

@ -37,7 +37,7 @@ class VariantsSelection(models.Model):
variants_id = fields.Many2one('product.template') variants_id = fields.Many2one('product.template')
attribute = fields.Many2one('product.attribute', string='Attribute', ondelete='restrict', required=True, index=True) attribute = fields.Many2one('product.attribute', string='Attribute', ondelete='restrict', required=True, index=True)
value = fields.Many2many('product.attribute.value', string='Values') value = fields.Many2many('product.attribute.value', string='Values')
extra_price = fields.Char(string="Price Extra") extra_price = fields.Float(string="Price Extra")
pos_active = fields.Boolean(string="Active") pos_active = fields.Boolean(string="Active")

5
pos_multi_variant/static/src/js/ProductScreen.js

@ -1,6 +1,5 @@
odoo.define('pos_multi_variant.ProductScreen', function(require) { odoo.define('pos_multi_variant.ProductScreen', function(require) {
'use strict'; 'use strict';
var ProductScreen = require('point_of_sale.ProductScreen'); var ProductScreen = require('point_of_sale.ProductScreen');
const Registries = require('point_of_sale.Registries'); const Registries = require('point_of_sale.Registries');
const NumberBuffer = require('point_of_sale.NumberBuffer'); const NumberBuffer = require('point_of_sale.NumberBuffer');
@ -34,9 +33,11 @@ odoo.define('pos_multi_variant.ProductScreen', function(require) {
} }
async _clickProduct(event) { async _clickProduct(event) {
await super._clickProduct(...arguments)
if (!this.currentOrder) { if (!this.currentOrder) {
this.env.pos.add_new_order(); this.env.pos.add_new_order();
} }
const product = event.detail; const product = event.detail;
var variant_product = '' var variant_product = ''
await rpc.query({ await rpc.query({
@ -70,8 +71,6 @@ odoo.define('pos_multi_variant.ProductScreen', function(require) {
// Do not add product if options is undefined. // Do not add product if options is undefined.
if (!options) return; if (!options) return;
// Add the product after having the extra information.
this.currentOrder.add_product(product, options);
NumberBuffer.reset(); NumberBuffer.reset();
if(product.pos_variants) if(product.pos_variants)
this.showPopup('ProductsPopup',{ this.showPopup('ProductsPopup',{

1
pos_multi_variant/static/src/js/models.js

@ -25,7 +25,6 @@ odoo.define('pos_multi_variant.model', function(require) {
export_for_printing: function() { export_for_printing: function() {
var line = _super_orderline.export_for_printing.apply(this,arguments); var line = _super_orderline.export_for_printing.apply(this,arguments);
line.product_variants = this.product_variants; line.product_variants = this.product_variants;
console.log(line, "line")
return line; return line;
}, },
}); });

Loading…
Cancel
Save