mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[IMP] mrp_bom_note: black, isort
This commit is contained in:
committed by
Laurent Bélorgey
parent
4683728cda
commit
23e440eccf
@@ -3,19 +3,15 @@
|
||||
|
||||
{
|
||||
"name": "Notes in Bill of Materials",
|
||||
"version": "12.0.1.0.0",
|
||||
"version": "13.0.1.0.0",
|
||||
"license": "AGPL-3",
|
||||
"author": "OdooMRP team,"
|
||||
"AvanzOSC,"
|
||||
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "
|
||||
"Odoo Community Association (OCA)",
|
||||
"AvanzOSC,"
|
||||
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "
|
||||
"Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/manufacture",
|
||||
"category": "Manufacturing",
|
||||
"depends": [
|
||||
"mrp",
|
||||
],
|
||||
"data": [
|
||||
"views/mrp_bom_view.xml",
|
||||
],
|
||||
"installable": True
|
||||
"depends": ["mrp"],
|
||||
"data": ["views/mrp_bom_view.xml"],
|
||||
"installable": True,
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# © 2015 Oihane Crucelaegui - AvanzOSC
|
||||
# License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html
|
||||
|
||||
from odoo import models, fields
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class MrpBom(models.Model):
|
||||
_inherit = 'mrp.bom'
|
||||
_inherit = "mrp.bom"
|
||||
|
||||
notes = fields.Html()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# © 2018 Agung Rachmatullah
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import test_mrp_bom_note
|
||||
from . import test_mrp_bom_note
|
||||
|
||||
@@ -7,71 +7,62 @@ from odoo.tests.common import TransactionCase
|
||||
class TestMrpBomNote(TransactionCase):
|
||||
def setUp(self):
|
||||
super(TestMrpBomNote, self).setUp()
|
||||
self.product_t = self.env['product.template']
|
||||
self.product_p = self.env['product.product']
|
||||
self.bom = self.env['mrp.bom']
|
||||
self.product_t = self.env["product.template"]
|
||||
self.product_p = self.env["product.product"]
|
||||
self.bom = self.env["mrp.bom"]
|
||||
|
||||
def test_notes(self):
|
||||
uom_unit = self.env.ref('uom.product_uom_unit')
|
||||
product_t_fg = self.product_t.create({
|
||||
'name': 'Chair',
|
||||
'type': 'product',
|
||||
'uom_id': uom_unit.id,
|
||||
'uom_po_id': uom_unit.id,
|
||||
})
|
||||
product_t_1 = self.product_t.create({
|
||||
'name': 'Log 1',
|
||||
'type': 'product',
|
||||
'uom_id': uom_unit.id,
|
||||
'uom_po_id': uom_unit.id,
|
||||
})
|
||||
product_t_2 = self.product_t.create({
|
||||
'name': 'Log 2',
|
||||
'type': 'product',
|
||||
'uom_id': uom_unit.id,
|
||||
'uom_po_id': uom_unit.id,
|
||||
})
|
||||
product_t_3 = self.product_t.create({
|
||||
'name': 'Log 3',
|
||||
'type': 'product',
|
||||
'uom_id': uom_unit.id,
|
||||
'uom_po_id': uom_unit.id,
|
||||
})
|
||||
product_fg = self.product_p.create({
|
||||
'product_tmpl_id': product_t_fg.id
|
||||
})
|
||||
product_1 = self.product_p.create({
|
||||
'product_tmpl_id': product_t_1.id
|
||||
})
|
||||
product_2 = self.product_p.create({
|
||||
'product_tmpl_id': product_t_2.id
|
||||
})
|
||||
product_3 = self.product_p.create({
|
||||
'product_tmpl_id': product_t_3.id
|
||||
})
|
||||
BoM1 = self.bom.create({
|
||||
'product_id': product_fg.id,
|
||||
'product_tmpl_id': product_fg.product_tmpl_id.id,
|
||||
'product_uom_id': uom_unit.id,
|
||||
'product_qty': 1.0,
|
||||
'type': 'normal',
|
||||
'move_raw_ids': [
|
||||
(0, 0, {
|
||||
'product_id': product_1.id,
|
||||
'product_qty': 4,
|
||||
}),
|
||||
(0, 0, {
|
||||
'product_id': product_2.id,
|
||||
'product_qty': 2,
|
||||
}),
|
||||
(0, 0, {
|
||||
'product_id': product_3.id,
|
||||
'product_qty': 2,
|
||||
})
|
||||
]
|
||||
})
|
||||
uom_unit = self.env.ref("uom.product_uom_unit")
|
||||
product_t_fg = self.product_t.create(
|
||||
{
|
||||
"name": "Chair",
|
||||
"type": "product",
|
||||
"uom_id": uom_unit.id,
|
||||
"uom_po_id": uom_unit.id,
|
||||
}
|
||||
)
|
||||
product_t_1 = self.product_t.create(
|
||||
{
|
||||
"name": "Log 1",
|
||||
"type": "product",
|
||||
"uom_id": uom_unit.id,
|
||||
"uom_po_id": uom_unit.id,
|
||||
}
|
||||
)
|
||||
product_t_2 = self.product_t.create(
|
||||
{
|
||||
"name": "Log 2",
|
||||
"type": "product",
|
||||
"uom_id": uom_unit.id,
|
||||
"uom_po_id": uom_unit.id,
|
||||
}
|
||||
)
|
||||
product_t_3 = self.product_t.create(
|
||||
{
|
||||
"name": "Log 3",
|
||||
"type": "product",
|
||||
"uom_id": uom_unit.id,
|
||||
"uom_po_id": uom_unit.id,
|
||||
}
|
||||
)
|
||||
product_fg = self.product_p.create({"product_tmpl_id": product_t_fg.id})
|
||||
product_1 = self.product_p.create({"product_tmpl_id": product_t_1.id})
|
||||
product_2 = self.product_p.create({"product_tmpl_id": product_t_2.id})
|
||||
product_3 = self.product_p.create({"product_tmpl_id": product_t_3.id})
|
||||
BoM1 = self.bom.create(
|
||||
{
|
||||
"product_id": product_fg.id,
|
||||
"product_tmpl_id": product_fg.product_tmpl_id.id,
|
||||
"product_uom_id": uom_unit.id,
|
||||
"product_qty": 1.0,
|
||||
"type": "normal",
|
||||
"move_raw_ids": [
|
||||
(0, 0, {"product_id": product_1.id, "product_qty": 4}),
|
||||
(0, 0, {"product_id": product_2.id, "product_qty": 2}),
|
||||
(0, 0, {"product_id": product_3.id, "product_qty": 2}),
|
||||
],
|
||||
}
|
||||
)
|
||||
|
||||
BoM1.write({
|
||||
'notes': '<p>Test</p>'
|
||||
})
|
||||
self.assertEqual(BoM1.notes, '<p>Test</p>')
|
||||
BoM1.write({"notes": "<p>Test</p>"})
|
||||
self.assertEqual(BoM1.notes, "<p>Test</p>")
|
||||
|
||||
Reference in New Issue
Block a user