Skip to content

Commit

Permalink
Merge PR #627 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by chienandalu
  • Loading branch information
OCA-git-bot committed Jun 7, 2021
2 parents aa67c08 + 341bad5 commit a0ac984
Show file tree
Hide file tree
Showing 19 changed files with 818 additions and 0 deletions.
88 changes: 88 additions & 0 deletions pos_default_partner/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
=============================
Point Of Sale Default Partner
=============================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-OCA%2Fpos-lightgray.png?logo=github
:target: https://github.com/OCA/pos/tree/13.0/pos_default_partner
:alt: OCA/pos
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/pos-13-0/pos-13-0-pos_default_partner
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/184/13.0
:alt: Try me on Runbot

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

Define a default partner for Point Of Sale order on each company.

**Table of contents**

.. contents::
:local:

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
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/pos/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_default_partner%0Aversion:%2013.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
~~~~~~~~~~~~

* Akretion

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


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/pos <https://github.com/OCA/pos/tree/13.0/pos_default_partner>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions pos_default_partner/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions pos_default_partner/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# copyright 2020 Akretion David BEAL
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Point Of Sale Default Partner",
"summary": "Add a default customer in pos order",
"license": "AGPL-3",
"version": "14.0.1.0.0",
"author": "Akretion," "Odoo Community Association (OCA)",
"maintainer": "Akretion",
"category": "Point of sale",
"depends": ["point_of_sale"],
"data": ["views/pos_config.xml"],
"website": "https://github.com/OCA/pos",
"installable": True,
}
43 changes: 43 additions & 0 deletions pos_default_partner/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_default_partner
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-07-27 11:19+0000\n"
"Last-Translator: Daniel Martinez Vila <daniel.martinez@qubiq.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 3.10\n"

#. module: pos_default_partner
#: model_terms:ir.ui.view,arch_db:pos_default_partner.pos_config_view_form
msgid "Customers"
msgstr "Clientes"

#. module: pos_default_partner
#: model:ir.model.fields,field_description:pos_default_partner.field_pos_config__default_partner_id
#: model_terms:ir.ui.view,arch_db:pos_default_partner.pos_config_view_form
msgid "Default Customer"
msgstr "Cliente predeterminado"

#. module: pos_default_partner
#: model_terms:ir.ui.view,arch_db:pos_default_partner.pos_config_view_form
msgid "Default customer to use if none is set"
msgstr "Cliente predeterminado para usar si no se establece ninguno"

#. module: pos_default_partner
#: model:ir.model,name:pos_default_partner.model_pos_config
msgid "Point of Sale Configuration"
msgstr "Configuración del punto de venta"

#. module: pos_default_partner
#: model:ir.model,name:pos_default_partner.model_pos_order
msgid "Point of Sale Orders"
msgstr "Pedidos de Punto de Venta"
40 changes: 40 additions & 0 deletions pos_default_partner/i18n/pos_default_partner.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_default_partner
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.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: pos_default_partner
#: model_terms:ir.ui.view,arch_db:pos_default_partner.pos_config_view_form
msgid "Customers"
msgstr ""

#. module: pos_default_partner
#: model:ir.model.fields,field_description:pos_default_partner.field_pos_config__default_partner_id
#: model_terms:ir.ui.view,arch_db:pos_default_partner.pos_config_view_form
msgid "Default Customer"
msgstr ""

#. module: pos_default_partner
#: model_terms:ir.ui.view,arch_db:pos_default_partner.pos_config_view_form
msgid "Default customer to use if none is set"
msgstr ""

#. module: pos_default_partner
#: model:ir.model,name:pos_default_partner.model_pos_config
msgid "Point of Sale Configuration"
msgstr ""

#. module: pos_default_partner
#: model:ir.model,name:pos_default_partner.model_pos_order
msgid "Point of Sale Orders"
msgstr ""
2 changes: 2 additions & 0 deletions pos_default_partner/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import pos_order
from . import pos_config
14 changes: 14 additions & 0 deletions pos_default_partner/models/pos_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2020 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class PosConfig(models.Model):

_inherit = "pos.config"

default_partner_id = fields.Many2one(
comodel_name="res.partner",
string="Default Customer",
)
15 changes: 15 additions & 0 deletions pos_default_partner/models/pos_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# copyright 2020 Akretion David BEAL
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import api, models


class PosOrder(models.Model):
_inherit = "pos.order"

@api.model
def _complete_values_from_session(self, session, values):
result = super()._complete_values_from_session(session, values)
if session.config_id.default_partner_id and not result.get("partner_id"):
result["partner_id"] = session.config_id.default_partner_id.id
return result
2 changes: 2 additions & 0 deletions pos_default_partner/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Go to Point of Sale's settings page and select a default customer for a
specific PoS configuration.
4 changes: 4 additions & 0 deletions pos_default_partner/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* Akretion

* David Beal <david.beal@akretion.com>
* Foram Shah <foram.shah@initos.com>
1 change: 1 addition & 0 deletions pos_default_partner/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Define a default partner for Point Of Sale order on each company.
1 change: 1 addition & 0 deletions pos_default_partner/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Set the default customer also on the PoS UI.
Binary file added pos_default_partner/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a0ac984

Please sign in to comment.