diff --git a/addons/product/data/product_data.xml b/addons/product/data/product_data.xml index 676081d8f8c..0c99ccfb51b 100644 --- a/addons/product/data/product_data.xml +++ b/addons/product/data/product_data.xml @@ -1,5 +1,5 @@ - + @@ -39,7 +39,7 @@ - + @@ -47,7 +47,7 @@
- +
@@ -561,4 +561,4 @@
-
+ diff --git a/addons/product/views/res_partner_views.xml b/addons/product/views/res_partner_views.xml index 4e66967a3f1..692fe5025e0 100644 --- a/addons/product/views/res_partner_views.xml +++ b/addons/product/views/res_partner_views.xml @@ -1,7 +1,5 @@ - - - + res.partner.product.property.form.inherit res.partner @@ -16,6 +14,4 @@ - - - + \ No newline at end of file diff --git a/addons/product/wizard/product_price_list.py b/addons/product/wizard/product_price_list.py index d1b2f354513..de344bae5aa 100644 --- a/addons/product/wizard/product_price_list.py +++ b/addons/product/wizard/product_price_list.py @@ -1,28 +1,19 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from openerp.osv import fields, osv -from odoo import api +from odoo import api, fields, models -class product_price_list(osv.osv_memory): + +class product_price_list(models.TransientModel): _name = 'product.price_list' _description = 'Price List' - _columns = { - 'price_list': fields.many2one('product.pricelist', 'PriceList', required=True), - 'qty1': fields.integer('Quantity-1'), - 'qty2': fields.integer('Quantity-2'), - 'qty3': fields.integer('Quantity-3'), - 'qty4': fields.integer('Quantity-4'), - 'qty5': fields.integer('Quantity-5'), - } - _defaults = { - 'qty1': 1, - 'qty2': 5, - 'qty3': 10, - 'qty4': 0, - 'qty5': 0, - } + price_list = fields.Many2one('product.pricelist', 'PriceList', required=True) + qty1 = fields.Integer('Quantity-1', default=1) + qty2 = fields.Integer('Quantity-2', default=5) + qty3 = fields.Integer('Quantity-3', default=10) + qty4 = fields.Integer('Quantity-4', default=0) + qty5 = fields.Integer('Quantity-5', default=0) @api.multi def print_report(self): diff --git a/addons/product/wizard/product_price_list_views.xml b/addons/product/wizard/product_price_list_views.xml index cb85c4dba60..96edadb4c49 100644 --- a/addons/product/wizard/product_price_list_views.xml +++ b/addons/product/wizard/product_price_list_views.xml @@ -1,9 +1,7 @@ - - + - Price per unit product.price_list @@ -32,6 +30,4 @@ src_model="product.product" groups="product.group_sale_pricelist" view_mode="form" target="new" view_type="form" /> - - - + diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index 032b526f1f1..50d07bf1d31 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -343,6 +343,7 @@ class Product(models.Model): class ProductTemplate(models.Model): _inherit = 'product.template' + type = fields.Selection(selection_add=[('product', 'Stockable Product')]) property_stock_procurement = fields.Many2one( 'stock.location', "Procurement Location", company_dependent=True, domain=[('usage', 'like', 'procurement')], @@ -443,13 +444,6 @@ class ProductTemplate(models.Model): template.reordering_min_qty = res[template.id]['reordering_min_qty'] template.reordering_max_qty = res[template.id]['reordering_max_qty'] - @api.model - def _get_product_template_type(self): - res = super(ProductTemplate, self)._get_product_template_type() - if 'product' not in [item[0] for item in res]: - res.append(('product', _('Stockable Product'))) - return res - @api.onchange('tracking') def onchange_tracking(self): return self.mapped('product_variant_ids').onchange_tracking()