mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[IMP] stock_orderpoint_generator: black, isort, prettier
This commit is contained in:
@@ -0,0 +1 @@
|
||||
../../../../stock_orderpoint_generator
|
||||
6
setup/stock_orderpoint_generator/setup.py
Normal file
6
setup/stock_orderpoint_generator/setup.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['setuptools-odoo'],
|
||||
odoo_addon=True,
|
||||
)
|
||||
@@ -10,7 +10,7 @@ from odoo import api, fields, models
|
||||
|
||||
|
||||
class OrderpointTemplate(models.Model):
|
||||
""" Template for orderpoints
|
||||
"""Template for orderpoints
|
||||
|
||||
Here we use same model as stock.warehouse.orderpoint but set product_id
|
||||
as non mandatory as we cannot remove it. This field will be ignored.
|
||||
@@ -83,7 +83,7 @@ class OrderpointTemplate(models.Model):
|
||||
|
||||
def _template_fields_to_discard(self):
|
||||
"""In order to create every orderpoint we should pop this template
|
||||
customization fields """
|
||||
customization fields"""
|
||||
return [
|
||||
"auto_generate",
|
||||
"auto_product_ids",
|
||||
@@ -181,7 +181,7 @@ class OrderpointTemplate(models.Model):
|
||||
orderpoint_model.create(vals_list)
|
||||
|
||||
def create_orderpoints(self, products):
|
||||
""" Create orderpoint for *products* based on these templates.
|
||||
"""Create orderpoint for *products* based on these templates.
|
||||
:type products: recordset of products
|
||||
"""
|
||||
self._disable_old_instances(products)
|
||||
|
||||
@@ -285,7 +285,8 @@ class TestOrderpointGenerator(SavepointCase):
|
||||
|
||||
def wizard_over_products(self, product, template):
|
||||
return self.wizard_model.with_context(
|
||||
active_model=product._name, active_ids=product.ids,
|
||||
active_model=product._name,
|
||||
active_ids=product.ids,
|
||||
).create({"orderpoint_template_id": [(6, 0, template.ids)]})
|
||||
|
||||
def test_product_orderpoint(self):
|
||||
|
||||
@@ -9,7 +9,7 @@ _template_register = ["orderpoint_template_id"]
|
||||
|
||||
|
||||
class OrderpointGenerator(models.TransientModel):
|
||||
""" Wizard defining stock.warehouse.orderpoint configurations for selected
|
||||
"""Wizard defining stock.warehouse.orderpoint configurations for selected
|
||||
products. Those configs are generated using templates
|
||||
"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user