[IMP] product_quick_bom: black, isort

This commit is contained in:
ps-tubtim
2020-03-12 15:47:16 +07:00
parent 6866495e21
commit aaf95c4cb4
3 changed files with 5 additions and 9 deletions

View File

@@ -4,7 +4,7 @@
{
"name": "Product Quick Bom",
"summary": "Create the bom directly from the product",
"version": "12.0.1.0.0",
"version": "13.0.1.0.0",
"category": "mrp",
"website": "https://github.com/OCA/manufacture",
"author": "Akretion, Odoo Community Association (OCA)",

View File

@@ -26,10 +26,7 @@ class ProductTemplate(models.Model):
# we just add a button to create one
def button_create_bom(self):
self.ensure_one()
vals = {
"product_tmpl_id": self.id,
"type": "normal",
}
vals = {"product_tmpl_id": self.id, "type": "normal"}
self.env["mrp.bom"].create(vals)
specific_bom_line_ids = fields.One2many(

View File

@@ -1,9 +1,10 @@
# Copyright (C) 2015 Akretion (http://www.akretion.com).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
import logging
from odoo.tests.common import TransactionCase
_logger = logging.getLogger(__name__)
@@ -15,9 +16,7 @@ class TestQuickBom(TransactionCase):
self.prd_1 = self.env.ref("mrp.product_product_computer_desk_bolt")
self.prd_2 = self.env.ref("mrp.product_product_computer_desk_screw")
self.prd_3 = self.env.ref("mrp.product_product_wood_ply")
self.tmpl_4 = self.env.ref(
"product.product_delivery_02_product_template"
)
self.tmpl_4 = self.env.ref("product.product_delivery_02_product_template")
def test_create_bom(self):
self.tmpl_4.button_create_bom()