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
6 changes: 6 additions & 0 deletions setup/shopinvader_sale_channel_partner_pricelist/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
79 changes: 79 additions & 0 deletions shopinvader_sale_channel_partner_pricelist/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
==========================================
Shopinvader Sale Channel Partner Pricelist
==========================================

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

.. |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/16.0/shopinvader_sale_channel_partner_pricelist
:alt: shopinvader/odoo-shopinvader

|badge1| |badge2| |badge3|

This module forces the partner pricelist at partner creation from the
one specified in the sale channel in the context of a shopinvader
endpoint.

It is useful for configuring a default pricelist for the customers
created in shopinvader.

**Table of contents**

.. contents::
:local:

Usage
=====

In the sale channel used by your endpoint, set the ``Partner Pricelist``
field to the pricelist you want to use.

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:%20shopinvader_sale_channel_partner_pricelist%0Aversion:%2016.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
-------

* Akretion

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

- Florian Mounier florian.mounier@akretion.com

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

.. |maintainer-paradoxxxzero| image:: https://github.com/paradoxxxzero.png?size=40px
:target: https://github.com/paradoxxxzero
:alt: paradoxxxzero

Current maintainer:

|maintainer-paradoxxxzero|

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

You are welcome to contribute.
1 change: 1 addition & 0 deletions shopinvader_sale_channel_partner_pricelist/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
22 changes: 22 additions & 0 deletions shopinvader_sale_channel_partner_pricelist/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2026 Akretion (http://www.akretion.com).
# @author Florian Mounier <florian.mounier@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Shopinvader Sale Channel Partner Pricelist",
"version": "16.0.1.0.0",
"author": "Akretion, Odoo Community Association (OCA)",
"summary": "Add a pricelist on sale channel to affect "
"to every partner created from this channel",
"category": "Uncategorized",
"depends": [
"shopinvader_sale_channel",
],
"website": "https://github.com/shopinvader/odoo-shopinvader",
"data": [
"views/sale_channel_views.xml",
],
"maintainers": ["paradoxxxzero"],
"installable": True,
"license": "AGPL-3",
}
2 changes: 2 additions & 0 deletions shopinvader_sale_channel_partner_pricelist/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import res_partner
from . import sale_channel
23 changes: 23 additions & 0 deletions shopinvader_sale_channel_partner_pricelist/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2026 Akretion (http://www.akretion.com).
# @author Florian Mounier <florian.mounier@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import api, models


class ResPartner(models.Model):
_inherit = "res.partner"

@api.model_create_multi
def create(self, vals_list):
rv = super().create(vals_list)
if self.env.context.get("sale_channel_id"):
sale_channel = self.env["sale.channel"].browse(
self.env.context["sale_channel_id"]
)
if sale_channel.partner_pricelist_id:
rv.write(
{"property_product_pricelist": sale_channel.partner_pricelist_id.id}
)

return rv
16 changes: 16 additions & 0 deletions shopinvader_sale_channel_partner_pricelist/models/sale_channel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2026 Akretion (http://www.akretion.com).
# @author Florian Mounier <florian.mounier@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).


from odoo import fields, models


class SaleChannel(models.Model):
_inherit = "sale.channel"

partner_pricelist_id = fields.Many2one(
"product.pricelist",
string="Partner Pricelist",
help="Pricelist to apply on every partner created from this channel",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Florian Mounier <florian.mounier@akretion.com>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module forces the partner pricelist at partner creation from the one specified in the sale channel in the context of a shopinvader endpoint.

It is useful for configuring a default pricelist for the customers created in shopinvader.
1 change: 1 addition & 0 deletions shopinvader_sale_channel_partner_pricelist/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
In the sale channel used by your endpoint, set the `Partner Pricelist` field to the pricelist you want to use.
Loading
Loading