Initial commit: Odoo 18.0-20251222 extra-addons
This commit is contained in:
3
sale_order_product_recommendation/models/__init__.py
Executable file
3
sale_order_product_recommendation/models/__init__.py
Executable file
@@ -0,0 +1,3 @@
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
from . import res_company
|
||||
from . import res_config_settings
|
||||
11
sale_order_product_recommendation/models/res_company.py
Executable file
11
sale_order_product_recommendation/models/res_company.py
Executable file
@@ -0,0 +1,11 @@
|
||||
# Copyright 2023 Camptocamp SA
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
_inherit = "res.company"
|
||||
|
||||
force_zero_units_included = fields.Boolean()
|
||||
sale_line_recommendation_domain = fields.Char(default="[]")
|
||||
39
sale_order_product_recommendation/models/res_config_settings.py
Executable file
39
sale_order_product_recommendation/models/res_config_settings.py
Executable file
@@ -0,0 +1,39 @@
|
||||
# Copyright 2020 Tecnativa - Sergio Teruel
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResConfigSettings(models.TransientModel):
|
||||
_inherit = "res.config.settings"
|
||||
|
||||
default_sale_recommendation_price_origin = fields.Selection(
|
||||
[("pricelist", "Pricelist"), ("last_sale_price", "Last sale price")],
|
||||
string="Price origin",
|
||||
default="pricelist",
|
||||
default_model="sale.order.recommendation",
|
||||
required=True,
|
||||
)
|
||||
|
||||
default_use_delivery_address = fields.Boolean(
|
||||
string="Use delivery address", default_model="sale.order.recommendation"
|
||||
)
|
||||
default_months = fields.Float(
|
||||
string="Default sale recommendation months",
|
||||
default_model="sale.order.recommendation",
|
||||
default=6,
|
||||
)
|
||||
default_line_amount = fields.Integer(
|
||||
string="Default sale number of recommendations",
|
||||
default_model="sale.order.recommendation",
|
||||
default=15,
|
||||
)
|
||||
force_zero_units_included = fields.Boolean(
|
||||
related="company_id.force_zero_units_included",
|
||||
readonly=False,
|
||||
help="Add recomented products in so even if units included is zero.",
|
||||
)
|
||||
sale_line_recommendation_domain = fields.Char(
|
||||
related="company_id.sale_line_recommendation_domain",
|
||||
readonly=False,
|
||||
help="Domain applied to find SO lines to propose as recommended products.",
|
||||
)
|
||||
Reference in New Issue
Block a user