[IMP] purchase*: Improve the settings form view
This commit is contained in:
committed by
Yannick Tivisse
parent
931afc2ff1
commit
31cb715787
@@ -36,6 +36,7 @@ Dashboard / Reports for Purchase Management will include:
|
||||
'views/purchase_views.xml',
|
||||
'views/procurement_views.xml',
|
||||
'views/stock_views.xml',
|
||||
'views/stock_config_settings_views.xml',
|
||||
'views/res_partner_views.xml',
|
||||
'report/purchase_report_views.xml',
|
||||
'data/mail_template_data.xml',
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
import account_invoice
|
||||
import purchase
|
||||
import stock_config_settings
|
||||
import res_company
|
||||
import res_config
|
||||
import res_partner
|
||||
|
||||
@@ -10,7 +10,6 @@ class PurchaseConfigSettings(models.TransientModel):
|
||||
|
||||
company_id = fields.Many2one('res.company', string='Company', required=True,
|
||||
default=lambda self: self.env.user.company_id)
|
||||
po_lead = fields.Float(related='company_id.po_lead', string="Purchase Lead Time")
|
||||
lock_confirmed_po = fields.Boolean("Lock Confirmed Orders", default=lambda self: self.env.user.company_id.po_lock == 'lock')
|
||||
po_lock = fields.Selection(related='company_id.po_lock', string="Purchase Order Modification *")
|
||||
po_order_approval = fields.Boolean("Order Approval", default=lambda self: self.env.user.company_id.po_double_validation == 'two_step')
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class StockConfigSettings(models.TransientModel):
|
||||
_inherit = 'stock.config.settings'
|
||||
|
||||
po_lead = fields.Float(related='company_id.po_lead', default=lambda self: self.env.user.company_id.po_lead)
|
||||
default_new_po_lead = fields.Boolean(string="Security Lead Time for Purchase", default_model="stock.config.settings", help="Margin of error for vendor lead times. When the system generates Purchase Orders for reordering products,they will be scheduled that many days earlier to cope with unexpected vendor delays.")
|
||||
@@ -140,17 +140,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" >
|
||||
<div class="o_setting_left_pane">
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="po_lead"/>
|
||||
<field name="po_lead"/>
|
||||
<div class="text-muted">
|
||||
Margin of error for vendor lead times
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<field name="is_installed_sale" invisible="1"/>
|
||||
<h2 attrs="{'invisible': [('is_installed_sale', '=', False)]}">Logistics</h2>
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="stock_config_settings_view_form_inherit_purchase" model="ir.ui.view">
|
||||
<field name="name">stock.config.settings.view.form.inherit.purchase</field>
|
||||
<field name="model">stock.config.settings</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_config_settings"/>
|
||||
<field name="arch" type="xml">
|
||||
<div id="purchase_po_lead" position="replace">
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" title="Margin of error for vendor lead times. When the system generates Purchase Orders for reordering products,they will be scheduled that many days earlier to cope with unexpected vendor delays.">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="default_new_po_lead"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="default_new_po_lead"/>
|
||||
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." groups="base.group_multi_company"/>
|
||||
<div class="text-muted">
|
||||
Schedule receivings earlier to avoid delays
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<div class="mt16" attrs="{'invisible': [('default_new_po_lead','=',False)]}">
|
||||
<span>Move forward expected delivery dates by <field name="po_lead" class="oe_inline"/> days</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" title="Scheduled dates of requests for quotation generated from reordering rules are based on vendor lead times (defined on products). By default, such a scheduling is made on calendar days. This option allow to adapt the scheduling with vendor calendars to set on reordering rules.">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_stock_calendar"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="module_stock_calendar"/>
|
||||
<div class="text-muted">
|
||||
Adapt reordering scheduling with vendor's open days calendar
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -32,6 +32,7 @@ You can choose flexible invoicing methods:
|
||||
'views/sale_order_views.xml',
|
||||
'views/stock_views.xml',
|
||||
'views/sale_config_settings_views.xml',
|
||||
'views/stock_config_settings_views.xml',
|
||||
'views/account_invoice_views.xml',
|
||||
'report/sale_order_report_templates.xml',
|
||||
'report/stock_report_deliveryslip.xml',
|
||||
|
||||
@@ -7,4 +7,5 @@ from . import product
|
||||
from . import res_company
|
||||
from . import sale_order
|
||||
from . import sale_config_settings
|
||||
from . import stock_config_settings
|
||||
from . import stock
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class StockConfigSettings(models.TransientModel):
|
||||
_inherit = 'stock.config.settings'
|
||||
|
||||
security_lead = fields.Float(related='company_id.security_lead')
|
||||
default_new_security_lead = fields.Boolean(string="Security Lead Time for Sales", default_model="stock.config.settings", help="Margin of error for dates promised to customers. Products will be scheduled for procurement and delivery that many days earlier than the actual promised date, to cope with unexpected delays in the supply chain.")
|
||||
default_picking_policy = fields.Selection([
|
||||
('direct', 'Ship products as soon as available, with back orders'),
|
||||
('one', 'Ship all products at once')
|
||||
], "Shipping Management", default='direct', default_model="sale.order")
|
||||
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="stock_config_settings_view_form_inherit_sale_stock" model="ir.ui.view">
|
||||
<field name="name">stock.config.settings.inherit.sale.stock</field>
|
||||
<field name="model">stock.config.settings</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_config_settings"/>
|
||||
<field name="arch" type="xml">
|
||||
<div id="warning_info" position="after">
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" title="Reserving products manually in delivery orders or by running the scheduler is advised to better manage priorities in case of long customer lead times or/and frequent stock-outs. By default, the scheduler runs automatically every 24 hours.">
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="module_procurement_jit"/>
|
||||
<div class="text-muted">
|
||||
When to reserve sold products
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<div class="mt16">
|
||||
<field name="module_procurement_jit" class="o_light_label" widget="radio"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="default_picking_policy"/>
|
||||
<div class="text-muted">
|
||||
When to start shipping
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<div class="mt16">
|
||||
<field name="default_picking_policy" class="o_light_label" widget="selection"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="sale_security_lead" position="replace">
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" title="Margin of error for dates promised to customers. Products will be scheduled for procurement and delivery that many days earlier than the actual promised date, to cope with unexpected delays in the supply chain.">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="default_new_security_lead"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="default_new_security_lead"/>
|
||||
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." groups="base.group_multi_company"/>
|
||||
<div class="text-muted">
|
||||
Schedule deliveries earlier to avoid delays
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<div class="mt16" attrs="{'invisible': [('default_new_security_lead','=',False)]}">
|
||||
<span>Move forward expected delivery dates by <field name="security_lead" class="oe_inline"/> days</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -4,126 +4,68 @@
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class StockSettings(models.TransientModel):
|
||||
class StockConfigSettings(models.TransientModel):
|
||||
_name = 'stock.config.settings'
|
||||
_inherit = 'res.config.settings'
|
||||
|
||||
@api.model
|
||||
def default_get(self, fields):
|
||||
res = super(StockSettings, self).default_get(fields)
|
||||
if 'warehouse_and_location_usage_level' in fields or not fields:
|
||||
res['warehouse_and_location_usage_level'] = int(res.get('group_stock_multi_locations', False)) + int(res.get('group_stock_multi_warehouses', False))
|
||||
return res
|
||||
|
||||
group_product_variant = fields.Selection([
|
||||
(0, "No variants on products"),
|
||||
(1, 'Products can have several attributes, defining variants (Example: size, color,...)')
|
||||
], "Product Variants",
|
||||
implied_group='product.group_product_variant',
|
||||
help='Work with product variant allows you to define some variant of the same products, an ease the product management in the ecommerce for example')
|
||||
company_id = fields.Many2one(
|
||||
'res.company', 'Company',
|
||||
default=lambda self: self.env.user.company_id, required=True)
|
||||
module_procurement_jit = fields.Selection([
|
||||
(1, 'Reserve products immediately after the sales order confirmation'),
|
||||
(0, 'Reserve products manually or based on automatic scheduler')
|
||||
], "Procurements",
|
||||
help="""Allows you to automatically reserve the available
|
||||
products when confirming a sales order.
|
||||
This installs the module procurement_jit.""")
|
||||
module_product_expiry = fields.Selection([
|
||||
(0, 'Do not use Expiration Date on serial numbers'),
|
||||
(1, 'Define Expiration Date on serial numbers')
|
||||
], "Expiration Dates",
|
||||
help="""Track different dates on products and serial numbers.
|
||||
The following dates can be tracked:
|
||||
- end of life
|
||||
- best before date
|
||||
- removal date
|
||||
- alert date.
|
||||
This installs the module product_expiry.""")
|
||||
group_uom = fields.Selection([
|
||||
(0, 'Products have only one unit of measure (easier)'),
|
||||
(1, 'Some products may be sold/purchased in different units of measure (advanced)')
|
||||
], "Units of Measure",
|
||||
implied_group='product.group_uom',
|
||||
help="""Allows you to select and maintain different units of measure for products.""")
|
||||
group_stock_packaging = fields.Selection([
|
||||
(0, 'Do not manage packaging'),
|
||||
(1, 'Manage available packaging options per products')
|
||||
], "Packaging Methods",
|
||||
(1, 'Immediately after sales order confirmation'),
|
||||
(0, 'Manually or based on automatic scheduler')
|
||||
], "Reservation",
|
||||
help="Reserving products manually in delivery orders or by running the scheduler is advised to better manage priorities in case of long customer lead times or/and frequent stock-outs.")
|
||||
module_product_expiry = fields.Boolean("Expiration Dates",
|
||||
help="Track following dates on lots & serial numbers: best before, removal, end of life, alert. \n Such dates are set automatically at lot/serial number creation based on values set on the product (in days).")
|
||||
group_stock_packaging = fields.Boolean('Packaging',
|
||||
implied_group='product.group_stock_packaging',
|
||||
help="""Allows you to create and manage your packaging dimensions and types you want to be maintained in your system.""")
|
||||
group_stock_production_lot = fields.Selection([
|
||||
(0, 'Do not track individual product items'),
|
||||
(1, 'Track lots or serial numbers')
|
||||
], "Lots and Serial Numbers",
|
||||
implied_group='stock.group_production_lot',
|
||||
help="""This allows you to assign a lot (or serial number) to the pickings and moves. This can make it possible to know which production lot was sent to a certain client, ...""")
|
||||
group_stock_tracking_lot = fields.Selection([
|
||||
(0, 'Do not manage packaging'),
|
||||
(1, 'Record packages used on packing: pallets, boxes, ...')
|
||||
], "Packages",
|
||||
help="Select or scan the packaging used to transfer products in operations. This allows to update or check the unit # transferred (which must be a multiple of the unit # per package). Packaging types are set on product detail form.")
|
||||
group_stock_production_lot = fields.Boolean("Lots & Serial Numbers",
|
||||
implied_group='stock.group_production_lot')
|
||||
group_stock_tracking_lot = fields.Boolean("Packages",
|
||||
implied_group='stock.group_tracking_lot',
|
||||
help="""This allows to manipulate packages. You can put something in, take something from a package, but also move entire packages and put them even in another package. """)
|
||||
group_stock_tracking_owner = fields.Selection([
|
||||
(0, 'All products in your warehouse belong to your company'),
|
||||
(1, 'Manage consignee stocks (advanced)')
|
||||
], "Product Owners",
|
||||
implied_group='stock.group_tracking_owner',
|
||||
help="""This way you can receive products attributed to a certain owner. """)
|
||||
group_stock_adv_location = fields.Selection([
|
||||
(0, 'No automatic routing of products'),
|
||||
(1, 'Advanced routing of products using rules')
|
||||
], "Routes",
|
||||
help="Put products in packages and get shipping labels per package unit thanks to shipping connectors.")
|
||||
group_stock_tracking_owner = fields.Boolean("Consignment",
|
||||
implied_group='stock.group_tracking_owner')
|
||||
group_stock_adv_location = fields.Boolean("Multi-Step Routes",
|
||||
implied_group='stock.group_adv_location',
|
||||
help="""This option supplements the warehouse application by effectively implementing Push and Pull inventory flows through Routes.""")
|
||||
group_warning_stock = fields.Selection([
|
||||
(0, 'All the partners can be used in pickings'),
|
||||
(1, 'An informative or blocking warning can be set on a partner')
|
||||
], "Warning", implied_group='stock.group_warning_stock')
|
||||
decimal_precision = fields.Integer('Decimal precision on weight', help="As an example, a decimal precision of 2 will allow weights like: 9.99 kg, whereas a decimal precision of 4 will allow weights like: 0.0231 kg.")
|
||||
propagation_minimum_delta = fields.Integer("Minimum days to trigger a propagation of date change in pushed/pull flows.", related='company_id.propagation_minimum_delta')
|
||||
module_stock_dropshipping = fields.Selection([
|
||||
(0, 'Suppliers always deliver to your warehouse(s)'),
|
||||
(1, "Allow suppliers to deliver directly to your customers")
|
||||
], "Dropshipping",
|
||||
help='\nCreates the dropship route and add more complex tests\n'
|
||||
'-This installs the module stock_dropshipping.')
|
||||
module_stock_picking_wave = fields.Selection([
|
||||
(0, 'Manage pickings one at a time'),
|
||||
(1, 'Manage picking in batch per worker')
|
||||
], "Picking Waves",
|
||||
help='Install the picking wave module which will help you grouping your pickings and processing them in batch')
|
||||
module_stock_calendar = fields.Selection([
|
||||
(0, 'Set lead times in calendar days (easy)'),
|
||||
(1, "Adapt lead times using the suppliers' open days calendars (advanced)")
|
||||
], "Minimum Stock Rules",
|
||||
help='This allows you to handle minimum stock rules differently by the possibility to take into account the purchase and delivery calendars \n-This installs the module stock_calendar.')
|
||||
module_stock_barcode = fields.Boolean("Barcode scanner support")
|
||||
module_delivery_dhl = fields.Boolean("DHL integration")
|
||||
module_delivery_fedex = fields.Boolean("Fedex integration")
|
||||
module_delivery_ups = fields.Boolean("UPS integration")
|
||||
module_delivery_usps = fields.Boolean("USPS integration")
|
||||
# Warehouse and location usage_level
|
||||
warehouse_and_location_usage_level = fields.Selection([
|
||||
(0, 'Manage only 1 Warehouse with only 1 stock location'),
|
||||
(1, 'Manage only 1 Warehouse, composed by several stock locations'),
|
||||
(2, 'Manage several Warehouses, each one composed by several stock locations')
|
||||
], "Warehouses and Locations usage level")
|
||||
group_stock_multi_locations = fields.Boolean('Manage several stock locations', implied_group='stock.group_stock_multi_locations')
|
||||
group_stock_multi_warehouses = fields.Boolean('Manage several warehouses', implied_group='stock.group_stock_multi_warehouses')
|
||||
module_quality = fields.Boolean(string="Quality", help="This module allows you to generate quality alerts and quality check")
|
||||
help="Add and customize route operations to process product moves in your warehouse(s): e.g. unload > quality control > stock for incoming products, pick > pack > ship for outgoing products. \n You can also set putaway strategies on warehouse locations in order to send incoming products into specific child locations straight away (e.g. specific bins, racks).")
|
||||
group_warning_stock = fields.Boolean("Warnings", implied_group='stock.group_warning_stock')
|
||||
propagation_minimum_delta = fields.Integer(related='company_id.propagation_minimum_delta', string="No Rescheduling Propagation")
|
||||
default_new_propagation_minimum_delta = fields.Boolean(string="No Rescheduling Propagation", default_model="stock.config.settings", help="Rescheduling applies to any chain of operations (e.g. Make To Order, Pick Pack Ship). In the case of MTO sales, a vendor delay (updated incoming date) impacts the expected delivery date to the customer. \n This option allows to not propagate the rescheduling if the change is not critical.")
|
||||
module_stock_picking_wave = fields.Boolean("Picking Waves")
|
||||
module_stock_calendar = fields.Boolean("Vendor Calendar for Reordering",
|
||||
help='Scheduled dates of requests for quotation generated from reordering rules are based on vendor lead times (defined on products).\nBy default, such a scheduling is made on calendar days. This option allow to adapt the scheduling with vendor calendars to set on reordering rules.')
|
||||
module_stock_barcode = fields.Boolean("Barcode Scanner")
|
||||
module_delivery_dhl = fields.Boolean("DHL")
|
||||
module_delivery_fedex = fields.Boolean("FedEx")
|
||||
module_delivery_ups = fields.Boolean("UPS")
|
||||
module_delivery_usps = fields.Boolean("USPS")
|
||||
group_uom = fields.Boolean("Units of Measure", implied_group='product.group_uom')
|
||||
group_product_variant = fields.Boolean("Attributes & Variants", implied_group='product.group_product_variant')
|
||||
group_stock_multi_locations = fields.Boolean('Storage Locations', implied_group='stock.group_stock_multi_locations',
|
||||
help="Store products in specific locations of your warehouse (e.g. bins, racks) and to track inventory accordingly.")
|
||||
group_stock_multi_warehouses = fields.Boolean('Multi-Warehouses', implied_group='stock.group_stock_multi_warehouses')
|
||||
module_quality = fields.Boolean(string="Quality Control")
|
||||
module_mrp = fields.Boolean(string="Manufacturing")
|
||||
module_sale = fields.Boolean(string="Sales")
|
||||
module_purchase = fields.Boolean(string="Purchase")
|
||||
|
||||
@api.onchange('warehouse_and_location_usage_level')
|
||||
def onchange_warehouse_and_location_usage_level(self):
|
||||
self.group_stock_multi_locations = self.warehouse_and_location_usage_level > 0
|
||||
self.group_stock_multi_warehouses = self.warehouse_and_location_usage_level > 1
|
||||
@api.onchange('group_stock_multi_locations')
|
||||
def _onchange_group_stock_multi_locations(self):
|
||||
if not self.group_stock_multi_locations:
|
||||
self.group_stock_multi_warehouses = False
|
||||
|
||||
@api.onchange('group_stock_multi_warehouses')
|
||||
def _onchange_group_stock_multi_warehouses(self):
|
||||
if self.group_stock_multi_warehouses:
|
||||
self.group_stock_multi_locations = True
|
||||
|
||||
@api.onchange('group_stock_adv_location')
|
||||
def onchange_adv_location(self):
|
||||
if self.group_stock_adv_location and self.warehouse_and_location_usage_level == 0:
|
||||
self.warehouse_and_location_usage_level = 1
|
||||
if self.group_stock_adv_location and not self.group_stock_multi_locations:
|
||||
self.group_stock_multi_locations = True
|
||||
|
||||
@api.multi
|
||||
def set_group_stock_multi_locations(self):
|
||||
|
||||
@@ -7,84 +7,338 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Configure Warehouse" class="oe_form_configuration">
|
||||
<header>
|
||||
<button string="Apply" type="object" name="execute" class="oe_highlight"/>
|
||||
<button string="Save" type="object" name="execute" class="oe_highlight"/>
|
||||
<button string="Cancel" type="object" name="cancel" class="oe_link"/>
|
||||
</header>
|
||||
<group string="Traceability" name="traceability">
|
||||
<field name="group_stock_production_lot" widget="radio"/>
|
||||
<field name="module_product_expiry" widget="radio" attrs="{'invisible': [('group_stock_production_lot', '=', False)]}"/>
|
||||
<field name="group_stock_tracking_lot" widget="radio"/>
|
||||
<field name="group_stock_tracking_owner" widget="radio"/>
|
||||
<label for="id" string="Barcode Interface"/>
|
||||
<div>
|
||||
<div>
|
||||
<field name="module_stock_barcode" widget="upgrade_boolean"/>
|
||||
<label for="module_stock_barcode"/>
|
||||
<a href="https://www.odoo.com/page/warehouse-features" target="_blank"> More Info</a>
|
||||
<sheet>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<h2>Operations</h2>
|
||||
<div class="row mt16 o_settings_container">
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_stock_barcode" widget="upgrade_boolean"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="module_stock_barcode"/>
|
||||
<div class="text-muted">
|
||||
Process operations faster with barcodes
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<div class="mt16 text-warning" id="use_product_barcode" attrs="{'invisible': [('module_stock_barcode','=',False)]}">
|
||||
Save this page and come back here to set up the feature.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" title="Put products in packages and get shipping labels per package unit thanks to shipping connectors.">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="group_stock_tracking_lot"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="group_stock_tracking_lot"/>
|
||||
<div class="text-muted">
|
||||
Track product packages (e.g.pallets, boxes)
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<div class="mt16" attrs="{'invisible': [('group_stock_tracking_lot', '=', False)]}">
|
||||
<button name="%(product.action_packaging_view)d" icon="fa-arrow-right" type="action" string="Package Types" class="btn-link"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_stock_picking_wave"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="module_stock_picking_wave"/>
|
||||
<div class="text-muted">
|
||||
Process picking in batch per worker
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" id="warning_info">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="group_warning_stock"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="group_warning_stock"/>
|
||||
<div class="text-muted">
|
||||
Get informative or blocking warnings on partners
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</group>
|
||||
<group string="Shipping Connectors" name="shipping">
|
||||
<label for="id" string="Carriers"/>
|
||||
<div>
|
||||
<div>
|
||||
<field name="module_delivery_dhl" widget="upgrade_boolean"/>
|
||||
<label for="module_delivery_dhl"/>
|
||||
<h2>Shipping Connectors</h2>
|
||||
<div class="row mt16 o_settings_container" title="Shipping connectors allow to compute accurate shipping costs, print shipping labels and request carrier picking at your warehouse to ship to the customer. Apply shipping connector from delivery methods.">
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_delivery_ups" widget="upgrade_boolean"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="module_delivery_ups"/>
|
||||
<div class="text-muted">
|
||||
Ship with UPS
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<div class="mt16 text-warning" id="delivery_ups" attrs="{'invisible': [('module_delivery_ups','=',False)]}">
|
||||
Save this page and come back here to set up the feature.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<field name="module_delivery_fedex" widget="upgrade_boolean"/>
|
||||
<label for="module_delivery_fedex"/>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_delivery_dhl" widget="upgrade_boolean"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="module_delivery_dhl"/>
|
||||
<div class="text-muted">
|
||||
Ship with DHL
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<div class="mt16 text-warning" id="delivery_dhl" attrs="{'invisible': [('module_delivery_dhl','=',False)]}">
|
||||
Save this page and come back here to set up the feature.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<field name="module_delivery_ups" widget="upgrade_boolean"/>
|
||||
<label for="module_delivery_ups"/>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_delivery_fedex" widget="upgrade_boolean"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="module_delivery_fedex"/>
|
||||
<div class="text-muted">
|
||||
Ship with FedEx
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<div class="mt16 text-warning" id="delivery_fedex" attrs="{'invisible': [('module_delivery_fedex','=',False)]}">
|
||||
Save this page and come back here to set up the feature.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<field name="module_delivery_usps" widget="upgrade_boolean"/>
|
||||
<label for="module_delivery_usps"/>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_delivery_usps" widget="upgrade_boolean"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="module_delivery_usps"/>
|
||||
<div class="text-muted">
|
||||
Ship with USPS
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<div class="mt16 text-warning" id="delivery_usps" attrs="{'invisible': [('module_delivery_usps','=',False)]}">
|
||||
Save this page and come back here to set up the feature.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</group>
|
||||
<group string="Location & Warehouse">
|
||||
<field name="module_procurement_jit" widget="radio"/>
|
||||
<field name="warehouse_and_location_usage_level" widget="radio"/>
|
||||
<field name="group_stock_multi_locations" invisible="1"/>
|
||||
<field name="group_stock_multi_warehouses" invisible="1"/>
|
||||
|
||||
<label for="group_stock_adv_location"/>
|
||||
<div>
|
||||
<field name="group_stock_adv_location" widget="radio"/>
|
||||
<div attrs="{'invisible': [('group_stock_adv_location', '=', 0)]}">
|
||||
<label for="propagation_minimum_delta"/>
|
||||
<field name="propagation_minimum_delta" class="oe_inline"/>
|
||||
<h2>Products</h2>
|
||||
<div class="row mt16 o_settings_container">
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="group_product_variant"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="group_product_variant"/>
|
||||
<div class="text-muted">
|
||||
Set product attributes (e.g. color, size) to manage variants
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<div class="mt16" attrs="{'invisible': [('group_product_variant', '=', False)]}">
|
||||
<button name="%(product.attribute_action)d" icon="fa-arrow-right" type="action" string="Attributes" class="btn-link"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="group_uom"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="group_uom"/>
|
||||
<div class="text-muted">
|
||||
Sell and purchase products in different units of measure
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<div class="mt16" attrs="{'invisible': [('group_uom', '=', False)]}">
|
||||
<button name="%(product.product_uom_form_action)d" icon="fa-arrow-right" type="action" string="Units Of Measure" class="btn-link"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" title="Select or scan the packaging used to transfer products in operations. This allows to update or check the unit # transferred (which must be a multiple of the unit # per package). Packaging types are set on product detail form.">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="group_stock_packaging"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="group_stock_packaging"/>
|
||||
<div class="text-muted">
|
||||
Manage product packaging
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label for="id" string="Products" groups="base.group_no_one"/>
|
||||
<div name="config_products" groups="base.group_no_one">
|
||||
<label for="decimal_precision"/>
|
||||
<field name="decimal_precision" class="oe_inline"/>
|
||||
</div>
|
||||
|
||||
<field name="module_stock_dropshipping" widget="radio"/>
|
||||
<field name="module_stock_picking_wave" widget="radio"/>
|
||||
<field name="module_stock_calendar" widget="radio"/>
|
||||
<field name="group_warning_stock" widget="radio"/>
|
||||
</group>
|
||||
<group string="Products">
|
||||
<field name="group_uom" widget="radio"/>
|
||||
<field name="group_product_variant" widget="radio"/>
|
||||
<field name="group_stock_packaging" widget="radio"/>
|
||||
</group>
|
||||
<group string="Extra Features">
|
||||
<label for="module_quality"/>
|
||||
<div>
|
||||
<div>
|
||||
<field name="module_quality" widget="upgrade_boolean"/>
|
||||
<label for="module_quality" string="Manage quality control points, checks and measures"/>
|
||||
<h2>Traceability</h2>
|
||||
<div class="row mt16 o_settings_container" id="production_lot_info">
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="group_stock_production_lot"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="group_stock_production_lot"/>
|
||||
<div class="text-muted">
|
||||
Get a full traceability from vendors to customers
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" attrs="{'invisible': [('group_stock_production_lot', '=', False)]}" title="Track following dates on lots & serial numbers: best before, removal, end of life, alert. Such dates are set automatically at lot/serial number creation based on values set on the product (in days).">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_product_expiry"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="module_product_expiry"/>
|
||||
<div class="text-muted">
|
||||
Set expiration dates on lots & serial numbers
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="group_stock_tracking_owner"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="group_stock_tracking_owner"/>
|
||||
<div class="text-muted">
|
||||
Set owner on stored products
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</group>
|
||||
<h2 class="mt32">Warehouse</h2>
|
||||
<div class="row mt16 o_settings_container">
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" title="Store products in specific locations of your warehouse (e.g. bins, racks) and to track inventory accordingly.">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="group_stock_multi_locations"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="group_stock_multi_locations"/>
|
||||
<div class="text-muted">
|
||||
Track product location in your warehouse
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<div class="mt16" attrs="{'invisible': [('group_stock_multi_locations', '=', False)]}">
|
||||
<button name="%(stock.action_location_form)d" icon="fa-arrow-right" type="action" string="Locations" class="btn-link"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="group_stock_multi_warehouses"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="group_stock_multi_warehouses"/>
|
||||
<div class="text-muted">
|
||||
Manage several warehouses
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<div class="mt16" attrs="{'invisible': [('group_stock_multi_warehouses', '=', False)]}">
|
||||
<button name="%(stock.action_warehouse_form)d" icon="fa-arrow-right" type="action" string="Warehouses" class="btn-link"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" title="Add and customize route operations to process product moves in your warehouse(s): e.g. unload > quality control > stock for incoming products, pick > pack > ship for outgoing products. You can also set putaway strategies on warehouse locations in order to send incoming products into specific child locations straight away (e.g. specific bins, racks).">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="group_stock_adv_location"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="group_stock_adv_location"/>
|
||||
<div class="text-muted">
|
||||
Use your own routes and putaway strategies
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<div class="mt16" attrs="{'invisible': [('group_stock_adv_location', '=', False)]}">
|
||||
<button name="%(stock.action_warehouse_form)d" icon="fa-arrow-right" type="action" string="Set Warehouse Routes" class="btn-link"/><br/>
|
||||
<button name="%(stock.action_location_form)d" icon="fa-arrow-right" type="action" string="Set Putaway Strategies on Locations" class="btn-link"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2 id="schedule_info">Advanced Scheduling</h2>
|
||||
<div class="row mt16 o_settings_container">
|
||||
<div id="sale_security_lead"/>
|
||||
<div id="purchase_po_lead"/>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" id="propagation_info" title="Rescheduling applies to any chain of operations (e.g. Make To Order, Pick Pack Ship). In the case of MTO sales, a vendor delay (updated incoming date) impacts the expected delivery date to the customer. This option allows to not propagate the rescheduling if the change is not critical.">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="default_new_propagation_minimum_delta"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="default_new_propagation_minimum_delta"/>
|
||||
<div class="text-muted">
|
||||
Don’t propagate scheduling changes through chains of operations
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<div class="mt16" attrs="{'invisible': [('default_new_propagation_minimum_delta', '=', False)]}">
|
||||
<span>Change must be higher than <field name="propagation_minimum_delta" class="oe_inline"/> days to be propagated</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2>Recommended Apps</h2>
|
||||
<div class="row mt16 o_settings_container">
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_quality" widget="upgrade_boolean"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="module_quality"/>
|
||||
<div class="text-muted">
|
||||
Manage quality control points, checks and measures
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_sale"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="module_sale"/>
|
||||
<div class="text-muted">
|
||||
Engage successfully with your customers thanks to an integrated supply chain
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_purchase"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="module_purchase"/>
|
||||
<div class="text-muted">
|
||||
Avoid stock-outs with purchase requests based on demand and stock levels
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_mrp"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="module_mrp"/>
|
||||
<div class="text-muted">
|
||||
Streamline your manufacturing operations with an integrated inventory management
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -7,22 +7,22 @@ from odoo import api, fields, models
|
||||
class StockConfigSettings(models.TransientModel):
|
||||
_inherit = 'stock.config.settings'
|
||||
|
||||
group_stock_inventory_valuation = fields.Selection([
|
||||
(0, "Periodic inventory valuation (recommended)"),
|
||||
(1, 'Perpetual inventory valuation (stock move generates accounting entries)')],
|
||||
"Inventory Valuation", implied_group='stock_account.group_inventory_valuation',
|
||||
help="""Allows to configure inventory valuations on products and product categories.""")
|
||||
module_stock_landed_costs = fields.Selection([
|
||||
(0, 'No landed costs'),
|
||||
(1, 'Include landed costs in product costing computation')], "Landed Costs",
|
||||
help="""Install the module that allows to affect landed costs on pickings, and split them onto the different products.""")
|
||||
group_stock_inventory_valuation = fields.Boolean("Perpetual Valuation", implied_group='stock_account.group_inventory_valuation',
|
||||
help="Perpetual valuation allows to get up-to-date books whenever products are transferred. It is only tailored for big companies where such a need matters. It requires extra configuration and testing to make sure accounting is impacted the right way for every kind of stock move. \n This must be set on product categories. The Periodic mode is applied by default (i.e. manual accounting entries at the end of the fiscal year). This last mode is recommended for starters and small/medium-size companies.")
|
||||
module_stock_landed_costs = fields.Boolean("Landed Costs",
|
||||
help="Affect landed costs on receipt operations and split them among products to update their cost price.")
|
||||
|
||||
@api.model
|
||||
def get_default_property_valuation(self, fields):
|
||||
category = self.env['ir.values'].get_default('product.category', 'property_valuation')
|
||||
return {
|
||||
'group_stock_inventory_valuation': True if category == 'real_time' else False
|
||||
}
|
||||
|
||||
@api.multi
|
||||
def set_property_valuation_on_product_category(self):
|
||||
data = {0: 'manual_periodic', 1: 'real_time'}
|
||||
return self.env['ir.values'].set_default('product.category', 'property_valuation', data[self.group_stock_inventory_valuation])
|
||||
|
||||
@api.onchange('module_stock_landed_costs')
|
||||
def onchange_landed_costs(self):
|
||||
if self.module_stock_landed_costs:
|
||||
self.group_stock_inventory_valuation = 1
|
||||
def set_default_property_valuation(self):
|
||||
if self.group_stock_inventory_valuation:
|
||||
data = 'real_time'
|
||||
else:
|
||||
data = 'manual_periodic'
|
||||
return self.env['ir.values'].set_default('product.category', 'property_valuation', data)
|
||||
|
||||
@@ -6,12 +6,38 @@
|
||||
<field name="model">stock.config.settings</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_config_settings"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//group[@name='traceability']" position="after">
|
||||
<group string="Stock Accounting">
|
||||
<field name="module_stock_landed_costs" widget="radio"/>
|
||||
<field name="group_stock_inventory_valuation" widget="radio"/>
|
||||
</group>
|
||||
</xpath>
|
||||
<div id="production_lot_info" position="after">
|
||||
<h2>Costing & Valuation </h2>
|
||||
<div class="row mt16 o_settings_container">
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" title="Perpetual valuation allows to get an up-to-date stock valuation in your accounting whenever products are transferred. It is only tailored for big companies where such a need matters. It requires extra configuration and testing to make sure accounting is impacted the right way for every kind of stock move. This must be set on product categories. The Periodic mode is applied by default (i.e. manual accounting entries at the end of the fiscal year). This last mode is recommended for starters and small/medium-size companies.">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="group_stock_inventory_valuation"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="group_stock_inventory_valuation"/>
|
||||
<div class="text-muted">
|
||||
Allow perpetual stock valuation in accounting
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" title="Affect landed costs on receipt operations and split them among products to update their cost price.">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_stock_landed_costs"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="module_stock_landed_costs"/>
|
||||
<div class="text-muted">
|
||||
Include landed costs in product cost
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<div class="mt16 text-warning" name="landed_cost_info" attrs="{'invisible': [('module_stock_landed_costs','=',False)]}">
|
||||
Save this page and come back here to set up the feature.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
@@ -21,6 +21,7 @@ This module allows you to easily add extra costs on pickings and decide the spli
|
||||
'data/stock_landed_cost_data.xml',
|
||||
'views/product_views.xml',
|
||||
'views/stock_landed_cost_views.xml',
|
||||
'views/stock_config_settings_views.xml',
|
||||
],
|
||||
'test': [
|
||||
'../account/test/account_minimal_test.xml',
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="view_stock_config_settings_inherit_landed_cost" model="ir.ui.view">
|
||||
<field name="name">stock.config.settings.inherit.landed.cost</field>
|
||||
<field name="model">stock.config.settings</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_config_settings"/>
|
||||
<field name="arch" type="xml">
|
||||
<div name="landed_cost_info" position="replace">
|
||||
<div class="mt16" attrs="{'invisible': [('module_stock_landed_costs','=',False)]}">
|
||||
<button name="%(stock_landed_costs.stock_landed_cost_type_action)d" icon="fa-arrow-right" type="action" string="Landed Cost Types" class="btn-link"/>
|
||||
</div>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user