Skip to content

Commit

Permalink
[MIG] pos_session_pay_invoice: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-lopez-tecnativa committed Sep 19, 2024
1 parent 9102832 commit 9ab1267
Show file tree
Hide file tree
Showing 22 changed files with 225 additions and 503 deletions.
30 changes: 18 additions & 12 deletions pos_session_pay_invoice/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ POS Session Pay invoice
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github
:target: https://github.com/OCA/pos/tree/14.0/pos_session_pay_invoice
:target: https://github.com/OCA/pos/tree/16.0/pos_session_pay_invoice
:alt: OCA/pos
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/pos-14-0/pos-14-0-pos_session_pay_invoice
:target: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_session_pay_invoice
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=14.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand All @@ -39,17 +39,23 @@ to collect payment for an existing Customer Invoice, from within a POS Session.
Configuration
=============

#. Go to *Point of Sale / Configuration / Point of Sale* and activate the
'Cash Control' setting.
#. Go to *Point of Sale / Configuration / Payment Methods*
and ensure that at least one payment method with a journal type "cash"
is created (or create one if it does not exist).

#. Go to *Point of Sale / Configuration / Settings*
Select a Point of Sale and ensure than in the payment methods section,
at least one payment method has a journal type "cash"

Usage
=====

#. Go to *Point of Sale / Dashboard* and create and open or access to an
already open POS Session.
#. Press the button **Pay Invoice** to pay a Supplier Invoice or a Customer
#. Open the POS Session form view on the Backend.
#. Press the button **Pay Supplier** to pay a Supplier Invoice or **Pay Refund** for a Customer
Refund. It will be paid using Cash.
#. Select **Collect Payment from Invoice** in to receive a payment of an
#. Select **Get Payment from Invoice** to receive a payment of an
existing Customer Invoice or a Supplier Refund. You will need to select
a Journal if the POS Config has defined multiple Payment Methods.

Expand All @@ -59,16 +65,13 @@ Known issues / Roadmap
* Cannot pay invoices in a different currency than that defined in the journal
associated to the payment method used to pay/collect payment.

* Should depend on `pos_invoicing` but it requires a refactoring of `pos_invoicing`.
It will be improved when migrating to 13.0

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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_session_pay_invoice%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_session_pay_invoice%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.

Expand All @@ -85,6 +88,9 @@ Contributors

* Enric Tobella <[email protected]>
* Jordi Ballester <[email protected]>
* Tecnativa (https://www.tecnativa.com):

* Carlos Lopez

Maintainers
~~~~~~~~~~~
Expand All @@ -99,6 +105,6 @@ 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/14.0/pos_session_pay_invoice>`_ project on GitHub.
This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/16.0/pos_session_pay_invoice>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
7 changes: 2 additions & 5 deletions pos_session_pay_invoice/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@

{
"name": "POS Session Pay invoice",
"version": "14.0.1.1.0",
"version": "16.0.1.0.0",
"category": "Point Of Sale",
"author": "Creu Blanca, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/pos",
"summary": "Pay and receive invoices from PoS Session",
"license": "LGPL-3",
"depends": ["point_of_sale", "account_cash_invoice"],
"data": [
"security/ir.model.access.csv",
"wizard/pos_box_cash_invoice_out.xml",
"wizard/pos_box_cash_invoice_in.xml",
"wizard/cash_invoice_in.xml",
"wizard/cash_pay_invoice.xml",
"views/pos_session.xml",
],
}
2 changes: 1 addition & 1 deletion pos_session_pay_invoice/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from . import pos_order
from . import pos_session
25 changes: 0 additions & 25 deletions pos_session_pay_invoice/models/pos_order.py

This file was deleted.

35 changes: 35 additions & 0 deletions pos_session_pay_invoice/models/pos_session.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from odoo import models


class PosSession(models.Model):
_inherit = "pos.session"

def button_show_wizard_pay_in_invoice(self):
action = self._get_action_wizard_pay_invoice()
action["context"]["pos_pay_invoice_type"] = "vendor"
action["context"]["pos_pay_invoice_domain"] = "in_invoice"
return action

def button_show_wizard_pay_out_refund(self):
action = self._get_action_wizard_pay_invoice()
action["context"]["pos_pay_invoice_type"] = "vendor"
action["context"]["pos_pay_invoice_domain"] = "out_refund"
return action

def button_show_wizard_pay_out_invoice(self):
action = self._get_action_wizard_pay_invoice()
action["context"]["pos_pay_invoice_type"] = "customer"
action["context"]["pos_pay_invoice_domain"] = "out_invoice"
return action

def _get_action_wizard_pay_invoice(self):
cash_journal = self.cash_journal_id
action = self.env["ir.actions.actions"]._for_xml_id(
"pos_session_pay_invoice.action_pos_invoice_in_control"
)
action["context"] = {
"active_ids": cash_journal.ids,
"active_name": cash_journal._name,
"pos_session_id": self.id,
}
return action
9 changes: 7 additions & 2 deletions pos_session_pay_invoice/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
#. Go to *Point of Sale / Configuration / Point of Sale* and activate the
'Cash Control' setting.
#. Go to *Point of Sale / Configuration / Payment Methods*
and ensure that at least one payment method with a journal type "cash"
is created (or create one if it does not exist).

#. Go to *Point of Sale / Configuration / Settings*
Select a Point of Sale and ensure than in the payment methods section,
at least one payment method has a journal type "cash"
3 changes: 3 additions & 0 deletions pos_session_pay_invoice/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
* Enric Tobella <[email protected]>
* Jordi Ballester <[email protected]>
* Tecnativa (https://www.tecnativa.com):

* Carlos Lopez
3 changes: 0 additions & 3 deletions pos_session_pay_invoice/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
* Cannot pay invoices in a different currency than that defined in the journal
associated to the payment method used to pay/collect payment.

* Should depend on `pos_invoicing` but it requires a refactoring of `pos_invoicing`.
It will be improved when migrating to 13.0
5 changes: 3 additions & 2 deletions pos_session_pay_invoice/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#. Go to *Point of Sale / Dashboard* and create and open or access to an
already open POS Session.
#. Press the button **Pay Invoice** to pay a Supplier Invoice or a Customer
#. Open the POS Session form view on the Backend.
#. Press the button **Pay Supplier** to pay a Supplier Invoice or **Pay Refund** for a Customer
Refund. It will be paid using Cash.
#. Select **Collect Payment from Invoice** in to receive a payment of an
#. Select **Get Payment from Invoice** to receive a payment of an
existing Customer Invoice or a Supplier Refund. You will need to select
a Journal if the POS Config has defined multiple Payment Methods.
3 changes: 0 additions & 3 deletions pos_session_pay_invoice/security/ir.model.access.csv

This file was deleted.

37 changes: 23 additions & 14 deletions pos_session_pay_invoice/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 All @@ -9,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -275,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -301,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -369,7 +369,7 @@ <h1 class="title">POS Session Pay invoice</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:6eac7dbff1f6e08ae835df882a549b193c4d037be692dfd6913960c06245184b
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/pos/tree/14.0/pos_session_pay_invoice"><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-14-0/pos-14-0-pos_session_pay_invoice"><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=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></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/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/pos/tree/16.0/pos_session_pay_invoice"><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_session_pay_invoice"><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>
<p>This modules allows to pay an existing Supplier Invoice / Customer Refund, or
to collect payment for an existing Customer Invoice, from within a POS Session.</p>
<p><strong>Table of contents</strong></p>
Expand All @@ -390,18 +390,23 @@ <h1 class="title">POS Session Pay invoice</h1>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<ol class="arabic simple">
<li>Go to <em>Point of Sale / Configuration / Point of Sale</em> and activate the
‘Cash Control’ setting.</li>
<li>Go to <em>Point of Sale / Configuration / Payment Methods</em>
and ensure that at least one payment method with a journal type “cash”
is created (or create one if it does not exist).</li>
<li>Go to <em>Point of Sale / Configuration / Settings</em>
Select a Point of Sale and ensure than in the payment methods section,
at least one payment method has a journal type “cash”</li>
</ol>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
<ol class="arabic simple">
<li>Go to <em>Point of Sale / Dashboard</em> and create and open or access to an
already open POS Session.</li>
<li>Press the button <strong>Pay Invoice</strong> to pay a Supplier Invoice or a Customer
<li>Open the POS Session form view on the Backend.</li>
<li>Press the button <strong>Pay Supplier</strong> to pay a Supplier Invoice or <strong>Pay Refund</strong> for a Customer
Refund. It will be paid using Cash.</li>
<li>Select <strong>Collect Payment from Invoice</strong> in to receive a payment of an
<li>Select <strong>Get Payment from Invoice</strong> to receive a payment of an
existing Customer Invoice or a Supplier Refund. You will need to select
a Journal if the POS Config has defined multiple Payment Methods.</li>
</ol>
Expand All @@ -411,16 +416,14 @@ <h1><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h1>
<ul class="simple">
<li>Cannot pay invoices in a different currency than that defined in the journal
associated to the payment method used to pay/collect payment.</li>
<li>Should depend on <cite>pos_invoicing</cite> but it requires a refactoring of <cite>pos_invoicing</cite>.
It will be improved when migrating to 13.0</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-4">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_session_pay_invoice%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/pos/issues/new?body=module:%20pos_session_pay_invoice%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">
Expand All @@ -436,16 +439,22 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
<ul class="simple">
<li>Enric Tobella &lt;<a class="reference external" href="mailto:etobella&#64;creublanca.es">etobella&#64;creublanca.es</a>&gt;</li>
<li>Jordi Ballester &lt;<a class="reference external" href="mailto:jordi.ballester&#64;eficent.com">jordi.ballester&#64;eficent.com</a>&gt;</li>
<li>Tecnativa (<a class="reference external" href="https://www.tecnativa.com">https://www.tecnativa.com</a>):<ul>
<li>Carlos Lopez</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-8">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>
<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
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/pos/tree/14.0/pos_session_pay_invoice">OCA/pos</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/pos/tree/16.0/pos_session_pay_invoice">OCA/pos</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
Loading

0 comments on commit 9ab1267

Please sign in to comment.