-
-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] pos_session_pay_invoice: Migration to 16.0
- Loading branch information
1 parent
a7f9b43
commit 3c68f22
Showing
16 changed files
with
109 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from . import pos_order | ||
from . import pos_session |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from odoo import models | ||
|
||
|
||
class PosSession(models.Model): | ||
_inherit = "pos.session" | ||
|
||
def button_show_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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
* Enric Tobella <etobella@creublanca.es> | ||
* Jordi Ballester <jordi.ballester@eficent.com> | ||
* Tecnativa (https://www.tecnativa.com): | ||
|
||
* Carlos Lopez |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
from . import cash_invoice_in | ||
from . import cash_pay_invoice | ||
from . import pos_box_cash_invoice_in | ||
from . import pos_box_cash_invoice_out |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (C) 2017 Creu Blanca | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
|
||
from odoo import api, models | ||
|
||
|
||
class CashPayInvoice(models.TransientModel): | ||
_inherit = "cash.pay.invoice" | ||
|
||
@api.model | ||
def default_get(self, fields_list): | ||
values = super().default_get(fields_list) | ||
if "invoice_type" in fields_list and self.env.context.get("pos_session_id"): | ||
values["invoice_type"] = "vendor" | ||
return values | ||
|
||
def _prepare_statement_line_vals(self): | ||
vals = super()._prepare_statement_line_vals() | ||
if self.env.context.get("pos_session_id"): | ||
vals["pos_session_id"] = self.env.context.get("pos_session_id") | ||
return vals |
Oops, something went wrong.