Skip to content

Commit 3c7cb7c

Browse files
authored
Merge pull request #728 from OCA/16.0
Syncing from upstream OCA/pos (16.0)
2 parents ec34f92 + ac7b481 commit 3c7cb7c

File tree

7 files changed

+71
-46
lines changed

7 files changed

+71
-46
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ addon | version | maintainers | summary
3131
[pos_customer_comment](pos_customer_comment/) | 16.0.1.0.3 | <a href='https://github.com/legalsylvain'><img src='https://github.com/legalsylvain.png' width='32' height='32' style='border-radius:50%;' alt='legalsylvain'/></a> | Display Customer comment in the PoS front office and allow to edit and save it by the cashier
3232
[pos_customer_tree_view_vat](pos_customer_tree_view_vat/) | 16.0.1.0.1 | <a href='https://github.com/mileo'><img src='https://github.com/mileo.png' width='32' height='32' style='border-radius:50%;' alt='mileo'/></a> | Point of Sale: Show VAT number at Customer Tree View
3333
[pos_daily_sales_reports_category_only](pos_daily_sales_reports_category_only/) | 16.0.1.0.1 | | Show Sales Reports by Category
34-
[pos_default_partner](pos_default_partner/) | 16.0.1.0.1 | | Add a default customer in pos order
34+
[pos_default_partner](pos_default_partner/) | 16.0.1.0.2 | | Add a default customer in pos order
3535
[pos_discount_all](pos_discount_all/) | 16.0.1.0.1 | <a href='https://github.com/legalsylvain'><img src='https://github.com/legalsylvain.png' width='32' height='32' style='border-radius:50%;' alt='legalsylvain'/></a> | Display discount amount on PoS cashier screen and print it on ticketcalculated from the difference between a sale with default pricelist
3636
[pos_edit_order_line](pos_edit_order_line/) | 16.0.1.0.1 | | POS Edit Order Line
3737
[pos_escpos_status](pos_escpos_status/) | 16.0.1.0.1 | | Point of sale: fetch status for 'escpos' driver

pos_default_partner/README.rst

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
15
=============================
26
Point Of Sale Default Partner
37
=============================
@@ -7,13 +11,13 @@ Point Of Sale Default Partner
711
!! This file is generated by oca-gen-addon-readme !!
812
!! changes will be overwritten. !!
913
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10-
!! source digest: sha256:df0ee7205b083e5d7ff020b0a121e602ad2e7c3509a37824b1adb81fb3967f20
14+
!! source digest: sha256:dfe126c5b0094e657eaf0433518028f27fa4bf0fd6fa78cab9f37ebc05a12647
1115
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1216
1317
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
1418
:target: https://odoo-community.org/page/development-status
1519
:alt: Beta
16-
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
20+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
1721
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1822
:alt: License: AGPL-3
1923
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github
@@ -41,11 +45,6 @@ Configuration
4145
Go to Point of Sale's settings page and select a default customer for a
4246
specific PoS configuration.
4347

44-
Known issues / Roadmap
45-
======================
46-
47-
Set the default customer also on the PoS UI.
48-
4948
Bug Tracker
5049
===========
5150

@@ -70,10 +69,14 @@ Contributors
7069

7170
* Akretion
7271

73-
* David Beal <[email protected]>
72+
* David Beal <[email protected]>
7473
* Foram Shah <[email protected]>
7574
* FactorLibre:
76-
* Alvaro Rollan
75+
76+
* Alvaro Rollan
77+
* `Coop IT Easy SC <https://coopiteasy.be>`_:
78+
79+
* hugues de keyzer
7780

7881
Maintainers
7982
~~~~~~~~~~~

pos_default_partner/__manifest__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@
55
"name": "Point Of Sale Default Partner",
66
"summary": "Add a default customer in pos order",
77
"license": "AGPL-3",
8-
"version": "16.0.1.0.1",
8+
"version": "16.0.1.0.2",
99
"author": "Akretion, FactorLibre, Odoo Community Association (OCA)",
1010
"maintainer": "Akretion",
1111
"category": "Point of sale",
1212
"depends": ["point_of_sale"],
1313
"data": ["views/res_config_settings_view.xml"],
1414
"website": "https://github.com/OCA/pos",
1515
"installable": True,
16+
"assets": {
17+
"point_of_sale.assets": [
18+
"pos_default_partner/static/src/js/**/*.js",
19+
]
20+
},
1621
}
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
* Akretion
22

3-
* David Beal <[email protected]>
3+
* David Beal <[email protected]>
44
* Foram Shah <[email protected]>
55
* FactorLibre:
6-
* Alvaro Rollan
6+
7+
* Alvaro Rollan
8+
* `Coop IT Easy SC <https://coopiteasy.be>`_:
9+
10+
* hugues de keyzer

pos_default_partner/readme/ROADMAP.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

pos_default_partner/static/description/index.html

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
55
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6-
<title>Point Of Sale Default Partner</title>
6+
<title>README.rst</title>
77
<style type="text/css">
88

99
/*
@@ -360,81 +360,77 @@
360360
</style>
361361
</head>
362362
<body>
363-
<div class="document" id="point-of-sale-default-partner">
364-
<h1 class="title">Point Of Sale Default Partner</h1>
363+
<div class="document">
365364

365+
366+
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367+
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368+
</a>
369+
<div class="section" id="point-of-sale-default-partner">
370+
<h1>Point Of Sale Default Partner</h1>
366371
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367372
!! This file is generated by oca-gen-addon-readme !!
368373
!! changes will be overwritten. !!
369374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370-
!! source digest: sha256:df0ee7205b083e5d7ff020b0a121e602ad2e7c3509a37824b1adb81fb3967f20
375+
!! source digest: sha256:dfe126c5b0094e657eaf0433518028f27fa4bf0fd6fa78cab9f37ebc05a12647
371376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<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/OCA/pos/tree/16.0/pos_default_partner"><img alt="OCA/pos" src="https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_default_partner"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/pos&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
377+
<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/OCA/pos/tree/16.0/pos_default_partner"><img alt="OCA/pos" src="https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_default_partner"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/pos&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373378
<p>Define a default partner for Point Of Sale order on each company.</p>
374379
<p><strong>Table of contents</strong></p>
375380
<div class="contents local topic" id="contents">
376381
<ul class="simple">
377382
<li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li>
378-
<li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-2">Known issues / Roadmap</a></li>
379-
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-3">Bug Tracker</a></li>
380-
<li><a class="reference internal" href="#credits" id="toc-entry-4">Credits</a><ul>
381-
<li><a class="reference internal" href="#authors" id="toc-entry-5">Authors</a></li>
382-
<li><a class="reference internal" href="#contributors" id="toc-entry-6">Contributors</a></li>
383-
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
383+
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
384+
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
385+
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
386+
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
387+
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
384388
</ul>
385389
</li>
386390
</ul>
387391
</div>
388392
<div class="section" id="configuration">
389-
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
393+
<h2><a class="toc-backref" href="#toc-entry-1">Configuration</a></h2>
390394
<p>Go to Point of Sale’s settings page and select a default customer for a
391395
specific PoS configuration.</p>
392396
</div>
393-
<div class="section" id="known-issues-roadmap">
394-
<h1><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h1>
395-
<p>Set the default customer also on the PoS UI.</p>
396-
</div>
397397
<div class="section" id="bug-tracker">
398-
<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
398+
<h2><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h2>
399399
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/pos/issues">GitHub Issues</a>.
400400
In case of trouble, please check there if your issue has already been reported.
401401
If you spotted it first, help us to smash it by providing a detailed and welcomed
402402
<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>
403403
<p>Do not contact contributors directly about support or help with technical issues.</p>
404404
</div>
405405
<div class="section" id="credits">
406-
<h1><a class="toc-backref" href="#toc-entry-4">Credits</a></h1>
406+
<h2><a class="toc-backref" href="#toc-entry-3">Credits</a></h2>
407407
<div class="section" id="authors">
408-
<h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2>
408+
<h3><a class="toc-backref" href="#toc-entry-4">Authors</a></h3>
409409
<ul class="simple">
410410
<li>Akretion</li>
411411
<li>FactorLibre</li>
412412
</ul>
413413
</div>
414414
<div class="section" id="contributors">
415-
<h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
416-
<ul>
417-
<li><p class="first">Akretion</p>
418-
<blockquote>
415+
<h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
419416
<ul class="simple">
417+
<li>Akretion<ul>
420418
<li>David Beal &lt;<a class="reference external" href="mailto:david.beal&#64;akretion.com">david.beal&#64;akretion.com</a>&gt;</li>
421419
</ul>
422-
</blockquote>
423-
</li>
424-
<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>
425420
</li>
426-
<li><dl class="first docutils">
427-
<dt>FactorLibre:</dt>
428-
<dd><ul class="first last simple">
421+
<li>Foram Shah &lt;<a class="reference external" href="mailto:foram.shah&#64;initos.com">foram.shah&#64;initos.com</a>&gt;</li>
422+
<li>FactorLibre:<ul>
429423
<li>Alvaro Rollan</li>
430424
</ul>
431-
</dd>
432-
</dl>
425+
</li>
426+
<li><a class="reference external" href="https://coopiteasy.be">Coop IT Easy SC</a>:<ul>
427+
<li>hugues de keyzer</li>
428+
</ul>
433429
</li>
434430
</ul>
435431
</div>
436432
<div class="section" id="maintainers">
437-
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
433+
<h3><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h3>
438434
<p>This module is maintained by the OCA.</p>
439435
<a class="reference external image-reference" href="https://odoo-community.org">
440436
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
@@ -447,5 +443,6 @@ <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
447443
</div>
448444
</div>
449445
</div>
446+
</div>
450447
</body>
451448
</html>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/** @odoo-module **/
2+
3+
import {Order} from "point_of_sale.models";
4+
import Registries from "point_of_sale.Registries";
5+
6+
const DefaultPartnerOrder = (OriginalOrder) =>
7+
class extends OriginalOrder {
8+
constructor(obj, options) {
9+
super(...arguments);
10+
const default_partner_id = this.pos.config.default_partner_id;
11+
if (!options.json && default_partner_id) {
12+
this.set_partner(this.pos.db.get_partner_by_id(default_partner_id[0]));
13+
}
14+
}
15+
};
16+
17+
Registries.Model.extend(Order, DefaultPartnerOrder);

0 commit comments

Comments
 (0)