Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 5 additions & 8 deletions sale_cart/README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=========
Sale Cart
=========
Expand All @@ -17,7 +13,7 @@ Sale Cart
.. |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
.. |badge2| image:: https://img.shields.io/badge/licence-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-shopinvader%2Fodoo--shopinvader-lightgray.png?logo=github
Expand All @@ -26,9 +22,9 @@ Sale Cart

|badge1| |badge2| |badge3|

This addon add a typology on sale.order to distinguish the sale orders
that are in the process of being written (cart) and those that are
quotations ready to be confirmed.
This addon adds a "cart" typology on sale.order to distinguish the sale
orders that are in the process of being written (cart) and those that
are quotations ready to be confirmed.

It also automatically converts the cart into a sale when the payment is
authorized, set as pending, or done.
Expand Down Expand Up @@ -60,6 +56,7 @@ Contributors
------------

- Laurent Mignon <laurent.mignon@acsone.eu>
- Nicolas DELBOVIER <nicolas.delbovier@acsone.eu>

Maintainers
-----------
Expand Down
2 changes: 1 addition & 1 deletion sale_cart/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"license": "AGPL-3",
"author": "ACSONE SA/NV",
"website": "https://github.com/shopinvader/odoo-shopinvader",
"depends": ["sale", "sales_team"],
"depends": ["sale", "sales_team", "sale_typology"],
"data": ["views/sale_order.xml"],
"demo": [],
"installable": True,
Expand Down
7 changes: 6 additions & 1 deletion sale_cart/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
class SaleOrder(models.Model):
_inherit = "sale.order"

typology = fields.Selection([("sale", "Sale"), ("cart", "Cart")], default="sale")
typology = fields.Selection(
selection_add=[("cart", "Cart")],
ondelete={
"cart": "cascade",
},
)

def _confirm_cart(self):
self.ensure_one()
Expand Down
1 change: 1 addition & 0 deletions sale_cart/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Laurent Mignon \<laurent.mignon@acsone.eu\>
- Nicolas DELBOVIER \<nicolas.delbovier@acsone.eu\>
6 changes: 3 additions & 3 deletions sale_cart/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
This addon add a typology on sale.order to distinguish the sale orders
that are in the process of being written (cart) and those that are
quotations ready to be confirmed.
This addon adds a "cart" typology on sale.order to distinguish the sale orders that are
in the process of being written (cart) and those that are quotations
ready to be confirmed.

It also automatically converts the cart into a sale when the payment is
authorized, set as pending, or done.
31 changes: 13 additions & 18 deletions sale_cart/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>README.rst</title>
<title>Sale Cart</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,24 +360,19 @@
</style>
</head>
<body>
<div class="document">
<div class="document" id="sale-cart">
<h1 class="title">Sale Cart</h1>


<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="sale-cart">
<h1>Sale Cart</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b0c909cc6508bfeb72d58e55c8094617606d5299cb2c3cdb77f180fcafbb7e77
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/shopinvader/odoo-shopinvader/tree/18.0/sale_cart"><img alt="shopinvader/odoo-shopinvader" src="https://img.shields.io/badge/github-shopinvader%2Fodoo--shopinvader-lightgray.png?logo=github" /></a></p>
<p>This addon add a typology on sale.order to distinguish the sale orders
that are in the process of being written (cart) and those that are
quotations ready to be confirmed.</p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/shopinvader/odoo-shopinvader/tree/18.0/sale_cart"><img alt="shopinvader/odoo-shopinvader" src="https://img.shields.io/badge/github-shopinvader%2Fodoo--shopinvader-lightgray.png?logo=github" /></a></p>
<p>This addon adds a “cart” typology on sale.order to distinguish the sale
orders that are in the process of being written (cart) and those that
are quotations ready to be confirmed.</p>
<p>It also automatically converts the cart into a sale when the payment is
authorized, set as pending, or done.</p>
<p><strong>Table of contents</strong></p>
Expand All @@ -393,34 +388,34 @@ <h1>Sale Cart</h1>
</ul>
</div>
<div class="section" id="bug-tracker">
<h2><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h2>
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/shopinvader/odoo-shopinvader/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/shopinvader/odoo-shopinvader/issues/new?body=module:%20sale_cart%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h2><a class="toc-backref" href="#toc-entry-2">Credits</a></h2>
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
<div class="section" id="authors">
<h3><a class="toc-backref" href="#toc-entry-3">Authors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
<ul class="simple">
<li>ACSONE SA/NV</li>
</ul>
</div>
<div class="section" id="contributors">
<h3><a class="toc-backref" href="#toc-entry-4">Contributors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<ul class="simple">
<li>Laurent Mignon &lt;<a class="reference external" href="mailto:laurent.mignon&#64;acsone.eu">laurent.mignon&#64;acsone.eu</a>&gt;</li>
<li>Nicolas DELBOVIER &lt;<a class="reference external" href="mailto:nicolas.delbovier&#64;acsone.eu">nicolas.delbovier&#64;acsone.eu</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h3><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h3>
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
<p>This module is part of the <a class="reference external" href="https://github.com/shopinvader/odoo-shopinvader/tree/18.0/sale_cart">shopinvader/odoo-shopinvader</a> project on GitHub.</p>
<p>You are welcome to contribute.</p>
</div>
</div>
</div>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion sale_cart/views/sale_order.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</record>

<record id="sale.action_quotations" model="ir.actions.act_window">
<field name="domain">[('typology', '=', 'sale'),
<field name="domain">[('typology', '!=', 'cart'),
('state','in',('draft','sent','cancel'))]
</field>
</record>
Expand Down
61 changes: 61 additions & 0 deletions sale_cart_quotation/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
===================
Sale Cart Quotation
===================

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

.. |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/licence-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-shopinvader%2Fodoo--shopinvader-lightgray.png?logo=github
:target: https://github.com/shopinvader/odoo-shopinvader/tree/18.0/sale_cart_quotation
:alt: shopinvader/odoo-shopinvader

|badge1| |badge2| |badge3|

Glue module between sale_quotation and sale_cart, allowing users to
request a quotation directly from a cart.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/shopinvader/odoo-shopinvader/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/shopinvader/odoo-shopinvader/issues/new?body=module:%20sale_cart_quotation%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
-------

* ACSONE SA/NV

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

- Nicolas DELBOVIER <nicolas.delbovier@acsone.eu>

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

This module is part of the `shopinvader/odoo-shopinvader <https://github.com/shopinvader/odoo-shopinvader/tree/18.0/sale_cart_quotation>`_ project on GitHub.

You are welcome to contribute.
1 change: 1 addition & 0 deletions sale_cart_quotation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions sale_cart_quotation/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2025 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Sale Cart Quotation",
"summary": """Glue module between sale_quotation and sale_cart,
allowing users to request a quotation directly from a cart.""",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV",
"website": "https://github.com/shopinvader/odoo-shopinvader",
"depends": ["sale_quotation", "sale_cart"],
"data": [
"views/sale_order.xml",
],
"demo": [],
}
1 change: 1 addition & 0 deletions sale_cart_quotation/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import sale_order
21 changes: 21 additions & 0 deletions sale_cart_quotation/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2025 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models
from odoo.exceptions import UserError


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

def action_cart_request_quotation(self):
if any(rec.state != "draft" or rec.typology != "cart" for rec in self):
raise UserError(
self.env._(
"Only orders of cart typology in draft state "
"can be converted to quotation"
)
)
self.write({"use_customer_quotation_workflow": True})
self.action_customer_request_quotation()
return True
3 changes: 3 additions & 0 deletions sale_cart_quotation/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
1 change: 1 addition & 0 deletions sale_cart_quotation/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Nicolas DELBOVIER \<nicolas.delbovier@acsone.eu\>
2 changes: 2 additions & 0 deletions sale_cart_quotation/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Glue module between sale_quotation and sale_cart, allowing users to
request a quotation directly from a cart.
Loading
Loading