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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with
33 additions and
2 deletions
-
beesdoo_product/__manifest__.py
-
beesdoo_product/models/beesdoo_product.py
-
beesdoo_product/static/src/js/models.js
-
beesdoo_product/views/assets.xml
-
beesdoo_product/views/beesdoo_product.xml
|
@ -27,6 +27,7 @@ |
|
|
'data/barcode_rule.xml', |
|
|
'data/barcode_rule.xml', |
|
|
'data/product_sequence.xml', |
|
|
'data/product_sequence.xml', |
|
|
'views/beesdoo_product.xml', |
|
|
'views/beesdoo_product.xml', |
|
|
|
|
|
'views/assets.xml', |
|
|
'wizard/views/label_printing_utils.xml', |
|
|
'wizard/views/label_printing_utils.xml', |
|
|
'security/ir.model.access.csv', |
|
|
'security/ir.model.access.csv', |
|
|
], |
|
|
], |
|
|
|
@ -93,7 +93,7 @@ class BeesdooProduct(models.Model): |
|
|
|
|
|
|
|
|
@api.one |
|
|
@api.one |
|
|
@api.depends('taxes_id', 'list_price', 'taxes_id.amount', |
|
|
@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') |
|
|
'display_weight', 'weight') |
|
|
def _get_total(self): |
|
|
def _get_total(self): |
|
|
consignes_group = self.env.ref('beesdoo_product.consignes_group_tax', |
|
|
consignes_group = self.env.ref('beesdoo_product.consignes_group_tax', |
|
|
|
@ -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); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
@ -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> |
|
@ -6,7 +6,7 @@ |
|
|
<field name="inherit_id" ref="product.product_template_only_form_view" /> |
|
|
<field name="inherit_id" ref="product.product_template_only_form_view" /> |
|
|
<field name="arch" type="xml"> |
|
|
<field name="arch" type="xml"> |
|
|
<field name="barcode" position="after"> |
|
|
<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> |
|
|
<field name="list_price" position="after"> |
|
|
<field name="list_price" position="after"> |
|
|
<field name="suggested_price" widget='monetary' options="{'currency_field': 'currency_id'}" /> |
|
|
<field name="suggested_price" widget='monetary' options="{'currency_field': 'currency_id'}" /> |
|
|