Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][IMP] pos_default_partner: set default partner also in pos ui #1276

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
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: 6 additions & 7 deletions pos_default_partner/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ Configuration
Go to Point of Sale's settings page and select a default customer for a
specific PoS configuration.

Known issues / Roadmap
======================

Set the default customer also on the PoS UI.

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

Expand All @@ -70,10 +65,14 @@ Contributors

* Akretion

* David Beal <david.beal@akretion.com>
* David Beal <david.beal@akretion.com>
* Foram Shah <foram.shah@initos.com>
* FactorLibre:
* Alvaro Rollan

* Alvaro Rollan
* `Coop IT Easy SC <https://coopiteasy.be>`_:

* hugues de keyzer

Maintainers
~~~~~~~~~~~
Expand Down
5 changes: 5 additions & 0 deletions pos_default_partner/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@
"data": ["views/res_config_settings_view.xml"],
"website": "https://github.com/OCA/pos",
"installable": True,
"assets": {
"point_of_sale.assets": [
"pos_default_partner/static/src/js/**/*.js",
]
},
}
8 changes: 6 additions & 2 deletions pos_default_partner/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
* Akretion

* David Beal <david.beal@akretion.com>
* David Beal <david.beal@akretion.com>
* Foram Shah <foram.shah@initos.com>
* FactorLibre:
* Alvaro Rollan

* Alvaro Rollan
* `Coop IT Easy SC <https://coopiteasy.be>`_:

* hugues de keyzer
1 change: 0 additions & 1 deletion pos_default_partner/readme/ROADMAP.rst

This file was deleted.

44 changes: 17 additions & 27 deletions pos_default_partner/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand Down Expand Up @@ -375,12 +374,11 @@ <h1 class="title">Point Of Sale Default Partner</h1>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li>
<li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-2">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-3">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-4">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-5">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-6">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
</ul>
</li>
</ul>
Expand All @@ -390,51 +388,43 @@ <h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<p>Go to Point of Sale’s settings page and select a default customer for a
specific PoS configuration.</p>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h1>
<p>Set the default customer also on the PoS UI.</p>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/pos/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/OCA/pos/issues/new?body=module:%20pos_default_partner%0Aversion:%2016.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">
<h1><a class="toc-backref" href="#toc-entry-4">Credits</a></h1>
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<ul class="simple">
<li>Akretion</li>
<li>FactorLibre</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<ul>
<li><p class="first">Akretion</p>
<blockquote>
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<ul class="simple">
<li>Akretion<ul>
<li>David Beal &lt;<a class="reference external" href="mailto:david.beal&#64;akretion.com">david.beal&#64;akretion.com</a>&gt;</li>
</ul>
</blockquote>
</li>
<li><p class="first">Foram Shah &lt;<a class="reference external" href="mailto:foram.shah&#64;initos.com">foram.shah&#64;initos.com</a>&gt;</p>
</li>
<li><dl class="first docutils">
<dt>FactorLibre:</dt>
<dd><ul class="first last simple">
<li>Foram Shah &lt;<a class="reference external" href="mailto:foram.shah&#64;initos.com">foram.shah&#64;initos.com</a>&gt;</li>
<li>FactorLibre:<ul>
<li>Alvaro Rollan</li>
</ul>
</dd>
</dl>
</li>
<li><a class="reference external" href="https://coopiteasy.be">Coop IT Easy SC</a>:<ul>
<li>hugues de keyzer</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
Expand Down
17 changes: 17 additions & 0 deletions pos_default_partner/static/src/js/models.esm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/** @odoo-module **/

import {Order} from "point_of_sale.models";
import Registries from "point_of_sale.Registries";

const DefaultPartnerOrder = (OriginalOrder) =>
class extends OriginalOrder {
constructor(obj, options) {
super(...arguments);
const default_partner_id = this.pos.config.default_partner_id;
if (!options.json && default_partner_id) {
this.set_partner(this.pos.db.get_partner_by_id(default_partner_id[0]));
}
}
};

Registries.Model.extend(Order, DefaultPartnerOrder);
Loading