Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions sale_pricelist_from_commitment_date/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

===================================
Sale Pricelist From Commitment Date
===================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f7cb9a3371d9e916481865df469b90de09062e21e5d03d9af3d450927153ab7c
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/sale-workflow/tree/18.0/sale_pricelist_from_commitment_date
:alt: OCA/sale-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_pricelist_from_commitment_date
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

When the sale order commitment date is set, this date is used by
pricelist to compute price unit instead of using order date.

This module also provides configuration options to enhance the Delivery
Date field visibility and requirement. The Delivery Date field can be
displayed in header (after the Quotation/Order Date field) for better
visibility, and can optionally be made mandatory on sales orders.

**Table of contents**

.. contents::
:local:

Configuration
=============

Go to Sales → Configuration → Settings to configure the following
options:

**Show Delivery Date in Header**

- Display the Delivery Date field in header (after the Quotation/Order
Date field) on the sales order form for better visibility.

**Require Delivery Date**

- Make the Delivery Date field mandatory on sales orders.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_pricelist_from_commitment_date%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Camptocamp

Contributors
------------

- Julien Coux <julien.coux@camptocamp.com>
- Quartile <https://www.quartile.co>

- Yoshi Tashiro
- Aung Ko Ko Lin

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/18.0/sale_pricelist_from_commitment_date>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions sale_pricelist_from_commitment_date/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
17 changes: 17 additions & 0 deletions sale_pricelist_from_commitment_date/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2021 Camptocamp
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Sale Pricelist From Commitment Date",
"summary": "Use sale order commitment date to compute line price from pricelist",
"version": "18.0.1.0.0",
"category": "Sale",
"website": "https://github.com/OCA/sale-workflow",
"author": "Camptocamp, Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": ["sale"],
"data": [
"views/res_config_settings_views.xml",
"views/sale_order_views.xml",
],
"installable": True,
}
32 changes: 32 additions & 0 deletions sale_pricelist_from_commitment_date/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_pricelist_from_commitment_date
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-12-18 20:10+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: sale_pricelist_from_commitment_date
#: model:ir.model,name:sale_pricelist_from_commitment_date.model_product_pricelist
msgid "Pricelist"
msgstr "Lista de Precios"

#. module: sale_pricelist_from_commitment_date
#: model:ir.model,name:sale_pricelist_from_commitment_date.model_product_pricelist_item
msgid "Pricelist Rule"
msgstr "Regla de la lista de Precios"

#. module: sale_pricelist_from_commitment_date
#: model:ir.model,name:sale_pricelist_from_commitment_date.model_sale_order_line
msgid "Sales Order Line"
msgstr "Línea de Orden de Venta"
32 changes: 32 additions & 0 deletions sale_pricelist_from_commitment_date/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_pricelist_from_commitment_date
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-12-31 15:06+0000\n"
"Last-Translator: samibc2c <sami.bouzidi@camptocamp.com>\n"
"Language-Team: none\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 5.6.2\n"

#. module: sale_pricelist_from_commitment_date
#: model:ir.model,name:sale_pricelist_from_commitment_date.model_product_pricelist
msgid "Pricelist"
msgstr "Liste de prix"

#. module: sale_pricelist_from_commitment_date
#: model:ir.model,name:sale_pricelist_from_commitment_date.model_product_pricelist_item
msgid "Pricelist Rule"
msgstr "Règle de liste de prix"

#. module: sale_pricelist_from_commitment_date
#: model:ir.model,name:sale_pricelist_from_commitment_date.model_sale_order_line
msgid "Sales Order Line"
msgstr "Ligne de bon de commande"
32 changes: 32 additions & 0 deletions sale_pricelist_from_commitment_date/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_pricelist_from_commitment_date
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-12-07 18:33+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: sale_pricelist_from_commitment_date
#: model:ir.model,name:sale_pricelist_from_commitment_date.model_product_pricelist
msgid "Pricelist"
msgstr "Listino prezzi"

#. module: sale_pricelist_from_commitment_date
#: model:ir.model,name:sale_pricelist_from_commitment_date.model_product_pricelist_item
msgid "Pricelist Rule"
msgstr "Regola listino prezzi"

#. module: sale_pricelist_from_commitment_date
#: model:ir.model,name:sale_pricelist_from_commitment_date.model_sale_order_line
msgid "Sales Order Line"
msgstr "Riga ordine di vendita"
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_pricelist_from_commitment_date
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: sale_pricelist_from_commitment_date
#: model:ir.model,name:sale_pricelist_from_commitment_date.model_product_pricelist
msgid "Pricelist"
msgstr ""

#. module: sale_pricelist_from_commitment_date
#: model:ir.model,name:sale_pricelist_from_commitment_date.model_product_pricelist_item
msgid "Pricelist Rule"
msgstr ""

#. module: sale_pricelist_from_commitment_date
#: model:ir.model,name:sale_pricelist_from_commitment_date.model_sale_order_line
msgid "Sales Order Line"
msgstr ""
6 changes: 6 additions & 0 deletions sale_pricelist_from_commitment_date/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import sale_order_line
from . import sale_order
from . import res_company
from . import res_config_settings
11 changes: 11 additions & 0 deletions sale_pricelist_from_commitment_date/models/res_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2026 Quartile (https://www.quartile.co)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResCompany(models.Model):
_inherit = "res.company"

sale_require_commitment_date = fields.Boolean()
sale_commitment_date_in_header = fields.Boolean()
17 changes: 17 additions & 0 deletions sale_pricelist_from_commitment_date/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2026 Quartile (https://www.quartile.co)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"

sale_require_commitment_date = fields.Boolean(
related="company_id.sale_require_commitment_date",
readonly=False,
)
sale_commitment_date_in_header = fields.Boolean(
related="company_id.sale_commitment_date_in_header",
readonly=False,
)
15 changes: 15 additions & 0 deletions sale_pricelist_from_commitment_date/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2026 Quartile (https://www.quartile.co)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import fields, models


class SaleOrder(models.Model):
_inherit = "sale.order"

sale_require_commitment_date = fields.Boolean(
related="company_id.sale_require_commitment_date"
)
sale_commitment_date_in_header = fields.Boolean(
related="company_id.sale_commitment_date_in_header"
)
31 changes: 31 additions & 0 deletions sale_pricelist_from_commitment_date/models/sale_order_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import api, models


class SaleOrderLine(models.Model):
_inherit = "sale.order.line"

@api.depends(
"product_id",
"product_uom",
"product_uom_qty",
"order_id.commitment_date",
)
def _compute_price_unit(self):
return super()._compute_price_unit()

@api.depends(
"product_id",
"product_uom",
"product_uom_qty",
"order_id.commitment_date",
)
def _compute_pricelist_item_id(self):
return super()._compute_pricelist_item_id()

def _get_order_date(self):
if self.order_id.commitment_date:
return self.order_id.commitment_date
return super()._get_order_date()
3 changes: 3 additions & 0 deletions sale_pricelist_from_commitment_date/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
8 changes: 8 additions & 0 deletions sale_pricelist_from_commitment_date/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Go to Sales → Configuration → Settings to configure the following options:

**Show Delivery Date in Header**
- Display the Delivery Date field in header (after the Quotation/Order Date
field) on the sales order form for better visibility.

**Require Delivery Date**
- Make the Delivery Date field mandatory on sales orders.
4 changes: 4 additions & 0 deletions sale_pricelist_from_commitment_date/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Julien Coux \<<julien.coux@camptocamp.com>\>
- Quartile \<<https://www.quartile.co>\>
- Yoshi Tashiro
- Aung Ko Ko Lin
7 changes: 7 additions & 0 deletions sale_pricelist_from_commitment_date/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
When the sale order commitment date is set, this date is used by
pricelist to compute price unit instead of using order date.

This module also provides configuration options to enhance the Delivery Date
field visibility and requirement. The Delivery Date field can be displayed
in header (after the Quotation/Order Date field) for better visibility, and
can optionally be made mandatory on sales orders.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading