From c0794649f348f035f969e2969ebc68a2da213a59 Mon Sep 17 00:00:00 2001 From: William Henrotin Date: Tue, 3 Jul 2018 14:46:03 +0200 Subject: [PATCH] [IMP] stock: stockable term rename "Stockable" term is not a proper english word. We change it to"Storable"This commit is related to task ID 38933 PR:22085 TASK:38933 --- addons/hr_expense/models/product_template.py | 2 +- addons/product/models/product_template.py | 2 +- addons/sale_mrp/tests/test_sale_mrp_flow.py | 2 +- addons/sale_stock/models/product_template.py | 2 +- addons/sale_stock/models/sale_order.py | 2 +- addons/sale_stock/tests/test_sale_stock.py | 17 ++++++++--------- .../wizard/project_create_invoice.py | 2 +- addons/stock/models/product.py | 2 +- addons/stock/models/stock_inventory.py | 2 +- addons/stock/tests/test_move.py | 2 +- addons/stock/tests/test_packing_neg.py | 2 +- addons/stock/tests/test_product.py | 2 +- addons/stock/tests/test_wise_operator.py | 2 +- .../website_sale_delivery/controllers/main.py | 8 ++++---- .../views/website_sale_delivery_templates.xml | 2 +- .../views/res_config_settings_views.xml | 2 +- 16 files changed, 26 insertions(+), 27 deletions(-) diff --git a/addons/hr_expense/models/product_template.py b/addons/hr_expense/models/product_template.py index df01a901534..82ebf240311 100644 --- a/addons/hr_expense/models/product_template.py +++ b/addons/hr_expense/models/product_template.py @@ -19,5 +19,5 @@ class ProductTemplate(models.Model): @api.onchange('type') def _onchange_type_for_expense(self): - if self.type not in ['consu', 'service']: # stockable can not be expensed. + if self.type not in ['consu', 'service']: # storable can not be expensed. self.can_be_expensed = False diff --git a/addons/product/models/product_template.py b/addons/product/models/product_template.py index deb5addf2e7..f307c599971 100644 --- a/addons/product/models/product_template.py +++ b/addons/product/models/product_template.py @@ -49,7 +49,7 @@ class ProductTemplate(models.Model): type = fields.Selection([ ('consu', _('Consumable')), ('service', _('Service'))], string='Product Type', default='consu', required=True, - help='A stockable product is a product for which you manage stock. The "Inventory" app has to be installed.\n' + help='A storable product is a product for which you manage stock. The "Inventory" app has to be installed.\n' 'A consumable product, on the other hand, is a product for which stock is not managed.\n' 'A service is a non-material product you provide.\n' 'A digital content is a non-material product you sell online. The files attached to the products are the one that are sold on ' diff --git a/addons/sale_mrp/tests/test_sale_mrp_flow.py b/addons/sale_mrp/tests/test_sale_mrp_flow.py index ed3f3481454..ec10d718d13 100644 --- a/addons/sale_mrp/tests/test_sale_mrp_flow.py +++ b/addons/sale_mrp/tests/test_sale_mrp_flow.py @@ -351,7 +351,7 @@ class TestSaleMrpFlow(common.TransactionCase): # confirm our standard so, check the picking so.action_confirm() - self.assertTrue(so.picking_ids, 'Sale MRP: no picking created for "invoice on delivery" stockable products') + self.assertTrue(so.picking_ids, 'Sale MRP: no picking created for "invoice on delivery" storable products') # invoice in on delivery, nothing should be invoiced with self.assertRaises(UserError): diff --git a/addons/sale_stock/models/product_template.py b/addons/sale_stock/models/product_template.py index f554fae8e4b..9ac0588b4f1 100644 --- a/addons/sale_stock/models/product_template.py +++ b/addons/sale_stock/models/product_template.py @@ -9,7 +9,7 @@ class ProductTemplate(models.Model): @api.onchange('type') def _onchange_type(self): - """ We want to prevent stockable product to be expensed, since it make no sense as when confirm + """ We want to prevent storable product to be expensed, since it make no sense as when confirm expenses, the product is already out of our stock. """ super(ProductTemplate, self)._onchange_type() diff --git a/addons/sale_stock/models/sale_order.py b/addons/sale_stock/models/sale_order.py index 752ba3086a7..bb469c21b86 100644 --- a/addons/sale_stock/models/sale_order.py +++ b/addons/sale_stock/models/sale_order.py @@ -148,7 +148,7 @@ class SaleOrderLine(models.Model): def _compute_qty_delivered_method(self): """ Stock module compute delivered qty for product [('type', 'in', ['consu', 'product'])] For SO line coming from expense, no picking should be generate: we don't manage stock for - thoses lines, even if the product is a stockable. + thoses lines, even if the product is a storable. """ super(SaleOrderLine, self)._compute_qty_delivered_method() diff --git a/addons/sale_stock/tests/test_sale_stock.py b/addons/sale_stock/tests/test_sale_stock.py index c266d9ad15c..247278321fe 100644 --- a/addons/sale_stock/tests/test_sale_stock.py +++ b/addons/sale_stock/tests/test_sale_stock.py @@ -25,7 +25,7 @@ class TestSaleStock(TestSale): # confirm our standard so, check the picking self.so.action_confirm() - self.assertTrue(self.so.picking_ids, 'Sale Stock: no picking created for "invoice on delivery" stockable products') + self.assertTrue(self.so.picking_ids, 'Sale Stock: no picking created for "invoice on delivery" storable products') # invoice on order self.so.action_invoice_create() @@ -40,7 +40,7 @@ class TestSaleStock(TestSale): del_qties = [sol.qty_delivered for sol in self.so.order_line] del_qties_truth = [1.0 if sol.product_id.type in ['product', 'consu'] else 0.0 for sol in self.so.order_line] self.assertEqual(del_qties, del_qties_truth, 'Sale Stock: delivered quantities are wrong after partial delivery') - # invoice on delivery: only stockable products + # invoice on delivery: only storable products inv_id = self.so.action_invoice_create() inv_1 = inv_obj.browse(inv_id) self.assertTrue(all([il.product_id.invoice_policy == 'delivery' for il in inv_1.invoice_line_ids]), @@ -85,7 +85,7 @@ class TestSaleStock(TestSale): self.so.action_confirm() self.so.order_line._compute_product_updatable() self.assertFalse(self.so.order_line[0].product_updatable) - self.assertTrue(self.so.picking_ids, 'Sale Stock: no picking created for "invoice on order" stockable products') + self.assertTrue(self.so.picking_ids, 'Sale Stock: no picking created for "invoice on order" storable products') # let's do an invoice for a deposit of 5% adv_wiz = self.env['sale.advance.payment.inv'].with_context(active_ids=[self.so.id]).create({ 'advance_payment_method': 'percentage', @@ -135,7 +135,7 @@ class TestSaleStock(TestSale): # confirm our standard so, check the picking self.so.action_confirm() - self.assertTrue(self.so.picking_ids, 'Sale Stock: no picking created for "invoice on delivery" stockable products') + self.assertTrue(self.so.picking_ids, 'Sale Stock: no picking created for "invoice on delivery" storable products') # invoice in on delivery, nothing should be invoiced self.assertEqual(self.so.invoice_status, 'no', 'Sale Stock: so invoice_status should be "no" instead of "%s".' % self.so.invoice_status) @@ -207,7 +207,7 @@ class TestSaleStock(TestSale): # confirm our standard so, check the picking self.so.action_confirm() - self.assertTrue(self.so.picking_ids, 'Sale Stock: no picking created for "invoice on delivery" stockable products') + self.assertTrue(self.so.picking_ids, 'Sale Stock: no picking created for "invoice on delivery" storable products') # invoice in on delivery, nothing should be invoiced self.assertEqual(self.so.invoice_status, 'no', 'Sale Stock: so invoice_status should be "nothing to invoice"') @@ -242,7 +242,7 @@ class TestSaleStock(TestSale): # sell two products item1 = self.products['prod_order'] # consumable item1.type = 'consu' - item2 = self.products['prod_del'] # stockable + item2 = self.products['prod_del'] # storable self.so = self.env['sale.order'].create({ 'partner_id': self.partner.id, @@ -255,7 +255,7 @@ class TestSaleStock(TestSale): # deliver them # One of the move is for a consumable product, thus is assigned. The second one is for a - # stockable product, thus is unavailable. Hitting `button_validate` will first ask to + # storable product, thus is unavailable. Hitting `button_validate` will first ask to # process all the reserved quantities and, if the user chose to process, a second wizard # will ask to create a backorder for the unavailable product. self.assertEquals(len(self.so.picking_ids), 1) @@ -301,7 +301,7 @@ class TestSaleStock(TestSale): """ # sell two products item1 = self.products['prod_order'] # consumable - item2 = self.products['prod_del'] # stockable + item2 = self.products['prod_del'] # storable self.env['stock.quant']._update_available_quantity(item2, self.env.ref('stock.stock_location_stock'), 2) self.so = self.env['sale.order'].create({ @@ -416,4 +416,3 @@ class TestSaleStock(TestSale): # check the delivered quantity self.assertEqual(so1.order_line.qty_delivered, 3.0) - diff --git a/addons/sale_timesheet/wizard/project_create_invoice.py b/addons/sale_timesheet/wizard/project_create_invoice.py index db56e5f8fcb..a02ab47af75 100644 --- a/addons/sale_timesheet/wizard/project_create_invoice.py +++ b/addons/sale_timesheet/wizard/project_create_invoice.py @@ -24,7 +24,7 @@ class ProjectCreateInvoice(models.TransientModel): project_id = fields.Many2one('project.project', "Project", help="Project to make billable", required=True) sale_order_id = fields.Many2one('sale.order', string="Choose the Sales Order to invoice", required=True) - amount_to_invoice = fields.Monetary("Amount to invoice", compute='_compute_amount_to_invoice', currency_field='currency_id', help="Total amount to invoice on the sales order, including all items (services, stockables, expenses, ...)") + amount_to_invoice = fields.Monetary("Amount to invoice", compute='_compute_amount_to_invoice', currency_field='currency_id', help="Total amount to invoice on the sales order, including all items (services, storables, expenses, ...)") currency_id = fields.Many2one(related='sale_order_id.currency_id', readonly=True) @api.onchange('project_id') diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index acb94efeb2d..3a9b6f0fb0c 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -383,7 +383,7 @@ class ProductTemplate(models.Model): responsible_id = fields.Many2one( 'res.users', string='Responsible', default=lambda self: self.env.uid, required=True, help="This user will be responsible of the next activities related to logistic operations for this product.") - type = fields.Selection(selection_add=[('product', 'Stockable Product')]) + type = fields.Selection(selection_add=[('product', 'Storable Product')]) property_stock_production = fields.Many2one( 'stock.location', "Production Location", company_dependent=True, domain=[('usage', 'like', 'production')], diff --git a/addons/stock/models/stock_inventory.py b/addons/stock/models/stock_inventory.py index 9c9625e8730..83775922b33 100644 --- a/addons/stock/models/stock_inventory.py +++ b/addons/stock/models/stock_inventory.py @@ -417,7 +417,7 @@ class InventoryLine(models.Model): """ for line in self: if line.product_id.type != 'product': - raise UserError(_("You can only adjust stockable products.")) + raise UserError(_("You can only adjust storable products.")) def _get_quants(self): return self.env['stock.quant'].search([ diff --git a/addons/stock/tests/test_move.py b/addons/stock/tests/test_move.py index 0c8bc37e1b2..a65365cc801 100644 --- a/addons/stock/tests/test_move.py +++ b/addons/stock/tests/test_move.py @@ -3359,7 +3359,7 @@ class StockMove(TransactionCase): def test_scrap_1(self): """ Check the created stock move and the impact on quants when we scrap a - stockable product. + storable product. """ self.env['stock.quant']._update_available_quantity(self.product1, self.stock_location, 1) scrap = self.env['stock.scrap'].create({ diff --git a/addons/stock/tests/test_packing_neg.py b/addons/stock/tests/test_packing_neg.py index afda606e9a6..197711cf053 100644 --- a/addons/stock/tests/test_packing_neg.py +++ b/addons/stock/tests/test_packing_neg.py @@ -8,7 +8,7 @@ class TestPackingNeg(TransactionCase): def test_packing_neg(self): - # Create a new "negative" stockable product + # Create a new "negative" storable product product_neg = self.env['product.product'].create({ 'name': 'Negative product', 'type': 'product', diff --git a/addons/stock/tests/test_product.py b/addons/stock/tests/test_product.py index 9da7532909f..b8882640199 100644 --- a/addons/stock/tests/test_product.py +++ b/addons/stock/tests/test_product.py @@ -12,7 +12,7 @@ class TestVirtualAvailable(TestStockCommon): def setUp(self): super(TestVirtualAvailable, self).setUp() - # Make `product3` a stockable product for this test. Indeed, creating quants + # Make `product3` a storable product for this test. Indeed, creating quants # and playing with owners is not possible for consumables. self.product_3.type = 'product' diff --git a/addons/stock/tests/test_wise_operator.py b/addons/stock/tests/test_wise_operator.py index 4b56fc21d27..ec06ab01fc2 100644 --- a/addons/stock/tests/test_wise_operator.py +++ b/addons/stock/tests/test_wise_operator.py @@ -8,7 +8,7 @@ class TestWiseOperator(TransactionCase): def test_wise_operator(self): - # Create a new stockable product + # Create a new storable product product_wise = self.env['product.product'].create({ 'name': 'Wise Unit', 'type': 'product', diff --git a/addons/website_sale_delivery/controllers/main.py b/addons/website_sale_delivery/controllers/main.py index 5a06774fcad..d8696c0b6e7 100644 --- a/addons/website_sale_delivery/controllers/main.py +++ b/addons/website_sale_delivery/controllers/main.py @@ -36,22 +36,22 @@ class WebsiteSaleDelivery(WebsiteSale): def _get_shop_payment_values(self, order, **kwargs): values = super(WebsiteSaleDelivery, self)._get_shop_payment_values(order, **kwargs) - has_stockable_products = any(line.product_id.type in ['consu', 'product'] for line in order.order_line) + has_storable_products = any(line.product_id.type in ['consu', 'product'] for line in order.order_line) - if not order._get_delivery_methods() and has_stockable_products: + if not order._get_delivery_methods() and has_storable_products: values['errors'].append( (_('Sorry, we are unable to ship your order'), _('No shipping method is available for your current order and shipping address. ' 'Please contact us for more information.'))) - if has_stockable_products: + if has_storable_products: if order.carrier_id and not order.delivery_rating_success: order._remove_delivery_line() delivery_carriers = order._get_delivery_methods() values['deliveries'] = delivery_carriers.sudo() - values['delivery_has_stockable'] = has_stockable_products + values['delivery_has_storable'] = has_storable_products values['delivery_action_id'] = request.env.ref('delivery.action_delivery_carrier_form').id return values diff --git a/addons/website_sale_delivery/views/website_sale_delivery_templates.xml b/addons/website_sale_delivery/views/website_sale_delivery_templates.xml index 5ec55550f0c..d806d1dc96f 100644 --- a/addons/website_sale_delivery/views/website_sale_delivery_templates.xml +++ b/addons/website_sale_delivery/views/website_sale_delivery_templates.xml @@ -65,7 +65,7 @@ - 'display: none!important' if not deliveries and delivery_has_stockable else '' + 'display: none!important' if not deliveries and delivery_has_storable else '' diff --git a/addons/website_sale_stock/views/res_config_settings_views.xml b/addons/website_sale_stock/views/res_config_settings_views.xml index 372d8f14279..6010f9025c3 100644 --- a/addons/website_sale_stock/views/res_config_settings_views.xml +++ b/addons/website_sale_stock/views/res_config_settings_views.xml @@ -12,7 +12,7 @@
-
+