[MIG] account_purchase_stock_report_non_billed: Migration to 15.0
parent
15fc4ce3ae
commit
fbf61bf1ee
|
@ -2,10 +2,13 @@
|
|||
Account Purchase Stock Report Non Billed
|
||||
========================================
|
||||
|
||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
..
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:c37c8ec835eb51f05c6963474a48e4ed84721ed38cc44bb0113dec12564bb2b4
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||
:target: https://odoo-community.org/page/development-status
|
||||
|
@ -14,16 +17,16 @@ Account Purchase Stock Report Non Billed
|
|||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--financial--reporting-lightgray.png?logo=github
|
||||
:target: https://github.com/OCA/account-financial-reporting/tree/13.0/account_purchase_stock_report_non_billed
|
||||
:target: https://github.com/OCA/account-financial-reporting/tree/15.0/account_purchase_stock_report_non_billed
|
||||
:alt: OCA/account-financial-reporting
|
||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||
:target: https://translation.odoo-community.org/projects/account-financial-reporting-13-0/account-financial-reporting-13-0-account_purchase_stock_report_non_billed
|
||||
:target: https://translation.odoo-community.org/projects/account-financial-reporting-15-0/account-financial-reporting-15-0-account_purchase_stock_report_non_billed
|
||||
:alt: Translate me on Weblate
|
||||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
||||
:target: https://runbot.odoo-community.org/runbot/91/13.0
|
||||
:alt: Try me on Runbot
|
||||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
|
||||
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-financial-reporting&target_branch=15.0
|
||||
:alt: Try me on Runboat
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|
||||
Module that extends account_sale_stock_report_non_billed to add the non billed stock
|
||||
moves comming from purchase orders.
|
||||
|
@ -48,8 +51,8 @@ Bug Tracker
|
|||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-financial-reporting/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/account-financial-reporting/issues/new?body=module:%20account_purchase_stock_report_non_billed%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/OCA/account-financial-reporting/issues/new?body=module:%20account_purchase_stock_report_non_billed%0Aversion:%2015.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.
|
||||
|
||||
|
@ -68,6 +71,7 @@ Contributors
|
|||
|
||||
* Carlos Roca
|
||||
* Pedro M. Baeza
|
||||
* Stefan Ungureanu
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
@ -90,6 +94,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|
|||
|
||||
|maintainer-CarlosRoca13|
|
||||
|
||||
This module is part of the `OCA/account-financial-reporting <https://github.com/OCA/account-financial-reporting/tree/13.0/account_purchase_stock_report_non_billed>`_ project on GitHub.
|
||||
This module is part of the `OCA/account-financial-reporting <https://github.com/OCA/account-financial-reporting/tree/15.0/account_purchase_stock_report_non_billed>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
{
|
||||
"name": "Account Purchase Stock Report Non Billed",
|
||||
"version": "13.0.1.1.0",
|
||||
"version": "15.0.1.0.0",
|
||||
"license": "AGPL-3",
|
||||
"author": "Tecnativa, Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/account-financial-reporting",
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 13.0\n"
|
||||
"Project-Id-Version: Odoo Server 15.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
|
|
|
@ -8,14 +8,14 @@ msgstr ""
|
|||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2022-08-30 06:00+0000\n"
|
||||
"PO-Revision-Date: 2022-08-30 08:15+0200\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: es\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Poedit 2.3\n"
|
||||
"Last-Translator: \n"
|
||||
"Language: es\n"
|
||||
|
||||
#. module: account_purchase_stock_report_non_billed
|
||||
#: model:ir.model,name:account_purchase_stock_report_non_billed.model_stock_move
|
||||
|
@ -25,4 +25,6 @@ msgstr "Movimiento de stock"
|
|||
#. module: account_purchase_stock_report_non_billed
|
||||
#: model:ir.model,name:account_purchase_stock_report_non_billed.model_account_sale_stock_report_non_billed_wiz
|
||||
msgid "Wizard to open stock moves that have not been invoiced at that time"
|
||||
msgstr "Asistente para abrir movimientos de stock que no han sido facturados a una fecha dada."
|
||||
msgstr ""
|
||||
"Asistente para abrir movimientos de stock que no han sido facturados a una "
|
||||
"fecha dada."
|
||||
|
|
|
@ -13,7 +13,7 @@ class StockMove(models.Model):
|
|||
if move.purchase_line_id:
|
||||
move.currency_id = move.purchase_line_id.currency_id
|
||||
else:
|
||||
super(StockMove, move)._compute_currency_id()
|
||||
return super(StockMove, move)._compute_currency_id()
|
||||
|
||||
def get_quantity_invoiced(self, invoice_lines):
|
||||
if self.purchase_line_id:
|
||||
|
@ -23,8 +23,8 @@ class StockMove(models.Model):
|
|||
sum(
|
||||
invoice_lines.mapped(
|
||||
lambda l: l.quantity
|
||||
if (l.move_id.type == "in_invoice" and not self.to_refund)
|
||||
or (l.move_id.type == "in_refund" and self.to_refund)
|
||||
if (l.move_id.move_type == "in_invoice" and not self.to_refund)
|
||||
or (l.move_id.move_type == "in_refund" and self.to_refund)
|
||||
else -l.quantity
|
||||
)
|
||||
)
|
||||
|
@ -70,12 +70,12 @@ class StockMove(models.Model):
|
|||
)
|
||||
self.price_not_invoiced = (qty_to_invoice - invoiced_qty) * price_unit
|
||||
else:
|
||||
super()._set_not_invoiced_values(qty_to_invoice, invoiced_qty)
|
||||
return super()._set_not_invoiced_values(qty_to_invoice, invoiced_qty)
|
||||
|
||||
@api.depends("purchase_line_id")
|
||||
@api.depends_context("date_check_invoiced_moves")
|
||||
def _compute_not_invoiced_values(self):
|
||||
super()._compute_not_invoiced_values()
|
||||
return super()._compute_not_invoiced_values()
|
||||
|
||||
def _get_model_id_origin_document(self):
|
||||
if not self.purchase_line_id:
|
||||
|
|
|
@ -2,3 +2,4 @@
|
|||
|
||||
* Carlos Roca
|
||||
* Pedro M. Baeza
|
||||
* Stefan Ungureanu
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?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>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
|
||||
<title>Account Purchase Stock Report Non Billed</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
|
||||
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
|
||||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
|
||||
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
*/
|
||||
|
||||
|
@ -366,25 +366,27 @@ ul.auto-toc {
|
|||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:c37c8ec835eb51f05c6963474a48e4ed84721ed38cc44bb0113dec12564bb2b4
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" 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" 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" href="https://github.com/OCA/account-financial-reporting/tree/13.0/account_purchase_stock_report_non_billed"><img alt="OCA/account-financial-reporting" src="https://img.shields.io/badge/github-OCA%2Faccount--financial--reporting-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/account-financial-reporting-13-0/account-financial-reporting-13-0-account_purchase_stock_report_non_billed"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/91/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-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/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/account-financial-reporting/tree/15.0/account_purchase_stock_report_non_billed"><img alt="OCA/account-financial-reporting" src="https://img.shields.io/badge/github-OCA%2Faccount--financial--reporting-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-financial-reporting-15-0/account-financial-reporting-15-0-account_purchase_stock_report_non_billed"><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/account-financial-reporting&target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
||||
<p>Module that extends account_sale_stock_report_non_billed to add the non billed stock
|
||||
moves comming from purchase orders.</p>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#usage" id="id1">Usage</a></li>
|
||||
<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li>
|
||||
<li><a class="reference internal" href="#usage" id="toc-entry-1">Usage</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>
|
||||
</div>
|
||||
<div class="section" id="usage">
|
||||
<h1><a class="toc-backref" href="#id1">Usage</a></h1>
|
||||
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
|
||||
<p>To use this module, you need to:</p>
|
||||
<ol class="arabic simple">
|
||||
<li>Go to <cite>Invicing > Reporting > Non Billed Stock Moves</cite>.</li>
|
||||
|
@ -394,41 +396,42 @@ showed at the tree view.</li>
|
|||
</ol>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#id2">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/account-financial-reporting/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 smashing it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/OCA/account-financial-reporting/issues/new?body=module:%20account_purchase_stock_report_non_billed%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
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/account-financial-reporting/issues/new?body=module:%20account_purchase_stock_report_non_billed%0Aversion:%2015.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="#id3">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="#id4">Authors</a></h2>
|
||||
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Tecnativa</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#id5">Contributors</a></h2>
|
||||
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
|
||||
<li>Carlos Roca</li>
|
||||
<li>Pedro M. Baeza</li>
|
||||
<li>Stefan Ungureanu</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#id6">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
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.</p>
|
||||
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
|
||||
<p><a class="reference external" href="https://github.com/CarlosRoca13"><img alt="CarlosRoca13" src="https://github.com/CarlosRoca13.png?size=40px" /></a></p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-financial-reporting/tree/13.0/account_purchase_stock_report_non_billed">OCA/account-financial-reporting</a> project on GitHub.</p>
|
||||
<p><a class="reference external image-reference" href="https://github.com/CarlosRoca13"><img alt="CarlosRoca13" src="https://github.com/CarlosRoca13.png?size=40px" /></a></p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-financial-reporting/tree/15.0/account_purchase_stock_report_non_billed">OCA/account-financial-reporting</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>
|
||||
|
|
|
@ -3,10 +3,11 @@
|
|||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
from odoo import fields
|
||||
from odoo.tests import Form, common
|
||||
from odoo.tests import Form, common, tagged
|
||||
|
||||
|
||||
class TestAccountPurchaseStockReportNonBilled(common.SavepointCase):
|
||||
@tagged("-at_install", "post_install")
|
||||
class TestAccountPurchaseStockReportNonBilled(common.TransactionCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
|
@ -39,9 +40,9 @@ class TestAccountPurchaseStockReportNonBilled(common.SavepointCase):
|
|||
|
||||
def test_02_report_move_full_invoiced(self):
|
||||
picking = self.get_picking_done_po()
|
||||
inv_action = self.po.action_view_invoice()
|
||||
inv_form = Form(self.env["account.move"].with_context(**inv_action["context"]))
|
||||
invoice = inv_form.save()
|
||||
inv_action = self.po.action_create_invoice()
|
||||
invoice = self.env["account.move"].browse([(inv_action["res_id"])])
|
||||
invoice.invoice_date = self.po.create_date
|
||||
invoice.action_post()
|
||||
wiz = self.env["account.sale.stock.report.non.billed.wiz"].create(
|
||||
{"date_check": fields.Date.today()}
|
||||
|
@ -58,16 +59,16 @@ class TestAccountPurchaseStockReportNonBilled(common.SavepointCase):
|
|||
picking.action_confirm()
|
||||
move_done = picking.move_lines[0]
|
||||
move_done.quantity_done = 1.0
|
||||
picking.action_done()
|
||||
inv_action = self.po.action_view_invoice()
|
||||
inv_form = Form(self.env["account.move"].with_context(**inv_action["context"]))
|
||||
inv = inv_form.save()
|
||||
inv.action_post()
|
||||
picking.button_validate()
|
||||
inv_action = self.po.action_create_invoice()
|
||||
invoice = self.env["account.move"].browse([(inv_action["res_id"])])
|
||||
invoice.invoice_date = self.po.create_date
|
||||
invoice.action_post()
|
||||
# Done other moves to appear at report
|
||||
picking_ret = self.po.picking_ids.filtered(lambda p: p.state == "assigned")
|
||||
picking_ret.action_confirm()
|
||||
picking_ret.move_lines.quantity_done = 1.0
|
||||
picking_ret.action_done()
|
||||
picking_ret.button_validate()
|
||||
moves_not_done = picking_ret.move_lines
|
||||
wiz = self.env["account.sale.stock.report.non.billed.wiz"].create(
|
||||
{"date_check": fields.Date.today()}
|
||||
|
@ -87,9 +88,9 @@ class TestAccountPurchaseStockReportNonBilled(common.SavepointCase):
|
|||
picking.move_lines.quantity_done = 1.0
|
||||
picking.button_validate()
|
||||
# Create invoice
|
||||
inv_action = self.po.action_view_invoice()
|
||||
inv_form = Form(self.env["account.move"].with_context(**inv_action["context"]))
|
||||
invoice = inv_form.save()
|
||||
inv_action = self.po.action_create_invoice()
|
||||
invoice = self.env["account.move"].browse([(inv_action["res_id"])])
|
||||
invoice.invoice_date = self.po.create_date
|
||||
invoice.action_post()
|
||||
wiz = self.env["account.sale.stock.report.non.billed.wiz"].create(
|
||||
{"date_check": fields.Date.today()}
|
||||
|
@ -102,7 +103,13 @@ class TestAccountPurchaseStockReportNonBilled(common.SavepointCase):
|
|||
wiz_invoice_refund = (
|
||||
self.env["account.move.reversal"]
|
||||
.with_context(active_model="account.move", active_ids=invoice.ids)
|
||||
.create({"refund_method": "cancel", "reason": "test"})
|
||||
.create(
|
||||
{
|
||||
"refund_method": "cancel",
|
||||
"reason": "test",
|
||||
"journal_id": invoice.journal_id.id,
|
||||
}
|
||||
)
|
||||
)
|
||||
wiz_invoice_refund.reverse_moves()
|
||||
action = wiz.open_at_date()
|
||||
|
@ -110,10 +117,10 @@ class TestAccountPurchaseStockReportNonBilled(common.SavepointCase):
|
|||
for move in picking.move_lines:
|
||||
self.assertIn(move.id, domain_ids)
|
||||
# Create invoice again
|
||||
inv_action = self.po.action_view_invoice()
|
||||
inv_form = Form(self.env["account.move"].with_context(**inv_action["context"]))
|
||||
new_inv = inv_form.save()
|
||||
new_inv.action_post()
|
||||
inv_action = self.po.action_create_invoice()
|
||||
new_invoice = self.env["account.move"].browse([(inv_action["res_id"])])
|
||||
new_invoice.invoice_date = self.po.create_date
|
||||
new_invoice.action_post()
|
||||
action = wiz.open_at_date()
|
||||
domain_ids = action["domain"][0][2]
|
||||
for move in picking.move_lines:
|
||||
|
@ -125,12 +132,11 @@ class TestAccountPurchaseStockReportNonBilled(common.SavepointCase):
|
|||
picking = self.po.picking_ids[0]
|
||||
picking.action_confirm()
|
||||
picking.move_lines.quantity_done = 3.0
|
||||
picking.button_validate()
|
||||
res_dict = picking.button_validate()
|
||||
move_lines = picking.move_lines
|
||||
wiz = self.env["stock.backorder.confirmation"].create(
|
||||
{"pick_ids": [(4, picking.id)]}
|
||||
)
|
||||
wiz.process()
|
||||
self.env["stock.backorder.confirmation"].with_context(
|
||||
**res_dict["context"]
|
||||
).process()
|
||||
picking = self.po.picking_ids.filtered(lambda p: p.state != "done")
|
||||
picking.action_confirm()
|
||||
picking.move_lines.quantity_done = 2.0
|
||||
|
@ -143,9 +149,9 @@ class TestAccountPurchaseStockReportNonBilled(common.SavepointCase):
|
|||
domain_ids = action["domain"][0][2]
|
||||
for move in move_lines:
|
||||
self.assertIn(move.id, domain_ids)
|
||||
inv_action = self.po.action_view_invoice()
|
||||
inv_form = Form(self.env["account.move"].with_context(**inv_action["context"]))
|
||||
invoice = inv_form.save()
|
||||
inv_action = self.po.action_create_invoice()
|
||||
invoice = self.env["account.move"].browse([(inv_action["res_id"])])
|
||||
invoice.invoice_date = self.po.create_date
|
||||
invoice.action_post()
|
||||
action = wiz.open_at_date()
|
||||
domain_ids = action["domain"][0][2]
|
||||
|
@ -158,15 +164,14 @@ class TestAccountPurchaseStockReportNonBilled(common.SavepointCase):
|
|||
picking = self.po.picking_ids[0]
|
||||
picking.action_confirm()
|
||||
picking.move_lines.quantity_done = 3.0
|
||||
picking.button_validate()
|
||||
wiz = self.env["stock.backorder.confirmation"].create(
|
||||
{"pick_ids": [(4, picking.id)]}
|
||||
)
|
||||
wiz.process()
|
||||
res_dict = picking.button_validate()
|
||||
move_lines = picking.move_lines
|
||||
inv_action = self.po.action_view_invoice()
|
||||
inv_form = Form(self.env["account.move"].with_context(**inv_action["context"]))
|
||||
invoice = inv_form.save()
|
||||
self.env["stock.backorder.confirmation"].with_context(
|
||||
**res_dict["context"]
|
||||
).process()
|
||||
inv_action = self.po.action_create_invoice()
|
||||
invoice = self.env["account.move"].browse([(inv_action["res_id"])])
|
||||
invoice.invoice_date = self.po.create_date
|
||||
invoice.action_post()
|
||||
picking = self.po.picking_ids.filtered(lambda p: p.state != "done")
|
||||
picking.action_confirm()
|
||||
|
@ -181,9 +186,9 @@ class TestAccountPurchaseStockReportNonBilled(common.SavepointCase):
|
|||
self.assertNotIn(move.id, domain_ids)
|
||||
for move in picking.move_lines:
|
||||
self.assertIn(move.id, domain_ids)
|
||||
inv_action = self.po.action_view_invoice()
|
||||
inv_form = Form(self.env["account.move"].with_context(**inv_action["context"]))
|
||||
invoice = inv_form.save()
|
||||
inv_action = self.po.action_create_invoice()
|
||||
invoice = self.env["account.move"].browse([(inv_action["res_id"])])
|
||||
invoice.invoice_date = self.po.create_date
|
||||
invoice.action_post()
|
||||
action = wiz.open_at_date()
|
||||
domain_ids = action["domain"][0][2]
|
||||
|
@ -199,9 +204,9 @@ class TestAccountPurchaseStockReportNonBilled(common.SavepointCase):
|
|||
picking.move_lines.quantity_done = 1.0
|
||||
picking.button_validate()
|
||||
# Create invoice
|
||||
inv_action = self.po.action_view_invoice()
|
||||
inv_form = Form(self.env["account.move"].with_context(**inv_action["context"]))
|
||||
invoice = inv_form.save()
|
||||
inv_action = self.po.action_create_invoice()
|
||||
invoice = self.env["account.move"].browse([(inv_action["res_id"])])
|
||||
invoice.invoice_date = self.po.create_date
|
||||
invoice.action_post()
|
||||
wiz = self.env["account.sale.stock.report.non.billed.wiz"].create(
|
||||
{"date_check": fields.Date.today()}
|
||||
|
@ -221,7 +226,7 @@ class TestAccountPurchaseStockReportNonBilled(common.SavepointCase):
|
|||
return_id = wiz_return.create_returns()["res_id"]
|
||||
picking_return = self.env["stock.picking"].browse(return_id)
|
||||
picking_return.move_line_ids.write({"qty_done": 1})
|
||||
picking_return.action_done()
|
||||
picking_return.button_validate()
|
||||
for move in picking_return.move_lines:
|
||||
self.assertNotIn(move.id, domain_ids)
|
||||
|
||||
|
@ -242,7 +247,7 @@ class TestAccountPurchaseStockReportNonBilled(common.SavepointCase):
|
|||
return_id = wiz_return.create_returns()["res_id"]
|
||||
picking_return = self.env["stock.picking"].browse(return_id)
|
||||
picking_return.move_line_ids.write({"qty_done": 1})
|
||||
picking_return.action_done()
|
||||
picking_return.button_validate()
|
||||
wiz_return_return_form = Form(
|
||||
self.env["stock.return.picking"].with_context(
|
||||
active_model="stock.picking", active_id=picking_return.id
|
||||
|
@ -252,10 +257,11 @@ class TestAccountPurchaseStockReportNonBilled(common.SavepointCase):
|
|||
return_return_id = wiz_return_return.create_returns()["res_id"]
|
||||
picking_return_return = self.env["stock.picking"].browse(return_return_id)
|
||||
picking_return_return.move_line_ids.write({"qty_done": 1})
|
||||
picking_return_return.action_done()
|
||||
inv_action = self.po.action_view_invoice()
|
||||
inv_form = Form(self.env["account.move"].with_context(**inv_action["context"]))
|
||||
inv_form.save()
|
||||
picking_return_return.button_validate()
|
||||
inv_action = self.po.action_create_invoice()
|
||||
invoice = self.env["account.move"].browse([(inv_action["res_id"])])
|
||||
invoice.invoice_date = self.po.create_date
|
||||
invoice.action_post()
|
||||
wiz = self.env["account.sale.stock.report.non.billed.wiz"].create(
|
||||
{"date_check": fields.Date.today()}
|
||||
)
|
||||
|
@ -285,7 +291,7 @@ class TestAccountPurchaseStockReportNonBilled(common.SavepointCase):
|
|||
return_id = wiz_return.create_returns()["res_id"]
|
||||
picking_return = self.env["stock.picking"].browse(return_id)
|
||||
picking_return.move_line_ids.write({"qty_done": 1})
|
||||
picking_return.action_done()
|
||||
picking_return.button_validate()
|
||||
wiz_return_return_form = Form(
|
||||
self.env["stock.return.picking"].with_context(
|
||||
active_model="stock.picking", active_id=picking_return.id
|
||||
|
@ -295,7 +301,7 @@ class TestAccountPurchaseStockReportNonBilled(common.SavepointCase):
|
|||
return_return_id = wiz_return_return.create_returns()["res_id"]
|
||||
picking_return_return = self.env["stock.picking"].browse(return_return_id)
|
||||
picking_return_return.move_line_ids.write({"qty_done": 1})
|
||||
picking_return_return.action_done()
|
||||
picking_return_return.button_validate()
|
||||
wiz = self.env["account.sale.stock.report.non.billed.wiz"].create(
|
||||
{"date_check": fields.Date.today()}
|
||||
)
|
||||
|
@ -316,9 +322,10 @@ class TestAccountPurchaseStockReportNonBilled(common.SavepointCase):
|
|||
picking.action_confirm()
|
||||
picking.move_lines.quantity_done = 1.0
|
||||
picking.button_validate()
|
||||
inv_action = self.po.action_view_invoice()
|
||||
inv_form = Form(self.env["account.move"].with_context(**inv_action["context"]))
|
||||
inv_form.save()
|
||||
inv_action = self.po.action_create_invoice()
|
||||
invoice = self.env["account.move"].browse([(inv_action["res_id"])])
|
||||
invoice.invoice_date = self.po.create_date
|
||||
invoice.action_post()
|
||||
wiz_return_form = Form(
|
||||
self.env["stock.return.picking"].with_context(
|
||||
active_model="stock.picking", active_id=picking.id, to_refund=False
|
||||
|
@ -328,7 +335,7 @@ class TestAccountPurchaseStockReportNonBilled(common.SavepointCase):
|
|||
return_id = wiz_return.create_returns()["res_id"]
|
||||
picking_return = self.env["stock.picking"].browse(return_id)
|
||||
picking_return.move_line_ids.write({"qty_done": 1})
|
||||
picking_return.action_done()
|
||||
picking_return.button_validate()
|
||||
wiz_return_return_form = Form(
|
||||
self.env["stock.return.picking"].with_context(
|
||||
active_model="stock.picking",
|
||||
|
@ -340,7 +347,7 @@ class TestAccountPurchaseStockReportNonBilled(common.SavepointCase):
|
|||
return_return_id = wiz_return_return.create_returns()["res_id"]
|
||||
picking_return_return = self.env["stock.picking"].browse(return_return_id)
|
||||
picking_return_return.move_line_ids.write({"qty_done": 1})
|
||||
picking_return_return.action_done()
|
||||
picking_return_return.button_validate()
|
||||
wiz = self.env["account.sale.stock.report.non.billed.wiz"].create(
|
||||
{"date_check": fields.Date.today()}
|
||||
)
|
||||
|
@ -362,10 +369,10 @@ class TestAccountPurchaseStockReportNonBilled(common.SavepointCase):
|
|||
picking.move_lines.quantity_done = 1.0
|
||||
picking.button_validate()
|
||||
# Emulate prepaying invoice
|
||||
inv_action = self.po.action_view_invoice()
|
||||
inv_form = Form(self.env["account.move"].with_context(**inv_action["context"]))
|
||||
inv_form.date = fields.Date.today() - relativedelta(days=5)
|
||||
inv_form.save()
|
||||
inv_action = self.po.action_create_invoice()
|
||||
invoice = self.env["account.move"].browse([(inv_action["res_id"])])
|
||||
invoice.invoice_date = fields.Date.today() - relativedelta(days=5)
|
||||
invoice.action_post()
|
||||
wiz = self.env["account.sale.stock.report.non.billed.wiz"].create(
|
||||
{"date_check": fields.Date.today(), "interval_restrict_invoices": True}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue