Browse Source

Merge pull request #141 from beescoop/12.0-MIG-FIX-beesdoo_product

[12.0][MIG][FIX] beesdoo_product
pull/146/head
Rémy Taymans 5 years ago
committed by GitHub
parent
commit
0ce052da26
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      beesdoo_product/__manifest__.py
  2. 2
      beesdoo_product/models/beesdoo_product.py
  3. 22
      beesdoo_product/static/src/js/models.js
  4. 8
      beesdoo_product/views/assets.xml
  5. 2
      beesdoo_product/views/beesdoo_product.xml

1
beesdoo_product/__manifest__.py

@ -27,6 +27,7 @@
'data/barcode_rule.xml',
'data/product_sequence.xml',
'views/beesdoo_product.xml',
'views/assets.xml',
'wizard/views/label_printing_utils.xml',
'security/ir.model.access.csv',
],

2
beesdoo_product/models/beesdoo_product.py

@ -93,7 +93,7 @@ class BeesdooProduct(models.Model):
@api.one
@api.depends('taxes_id', 'list_price', 'taxes_id.amount',
'taxes_id.tax_group_id', 'total_with_vat',
'taxes_id.tax_group_id',
'display_weight', 'weight')
def _get_total(self):
consignes_group = self.env.ref('beesdoo_product.consignes_group_tax',

22
beesdoo_product/static/src/js/models.js

@ -0,0 +1,22 @@
odoo.define('beesdoo_product.models', function (require) {
"use strict";
var models = require('point_of_sale.models');
var _super_PosModel = models.PosModel.prototype;
models.PosModel = models.PosModel.extend({
initialize: function (session, attributes) {
var product_model = _.find(this.models, function(model){
return model.model === 'product.product';
});
product_model.fields.push('total_with_vat');
// Inheritance
return _super_PosModel.initialize.call(this, session, attributes);
},
});
});

8
beesdoo_product/views/assets.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="assets_frontend" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<script type="text/javascript" src="/beesdoo_product/static/src/js/models.js"/>
</xpath>
</template>
</odoo>

2
beesdoo_product/views/beesdoo_product.xml

@ -6,7 +6,7 @@
<field name="inherit_id" ref="product.product_template_only_form_view" />
<field name="arch" type="xml">
<field name="barcode" position="after">
<button string="Generate Barcode" name="generate_barcode" type="object" colspan="2" attrs="{'invisible' : [('barcode','!=',False)]}" /> />
<button string="Generate Barcode" name="generate_barcode" type="object" colspan="2" attrs="{'invisible' : [('barcode','!=',False)]}" />
</field>
<field name="list_price" position="after">
<field name="suggested_price" widget='monetary' options="{'currency_field': 'currency_id'}" />

Loading…
Cancel
Save