mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
Merge pull request #154 from acsone/8.0-account_payment_blocking
[8.0] port account payment blocking from 7.0
This commit is contained in:
65
account_payment_blocking/README.rst
Normal file
65
account_payment_blocking/README.rst
Normal file
@@ -0,0 +1,65 @@
|
||||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
|
||||
:alt: License: AGPL-3
|
||||
|
||||
Block payment of invoices
|
||||
=========================
|
||||
|
||||
This module was written to extend the functionality of payment orders
|
||||
to prevent invoices under litigation to be presented for inclusion in payment orders.
|
||||
|
||||
This module uses the 'blocked' flag that is present on journal items
|
||||
to filter out lines proposed in payment orders.
|
||||
|
||||
In addition it exposes this flag on the supplier invoice form
|
||||
so it is easier to block an invoice.
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
This module depends on account_banking_payment_export that is part
|
||||
of the OCA/bank-payment suite.
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
There is nothing to configure.
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
To use this module, set the "Blocked" flag on supplier invoices
|
||||
or on payable/receivable journal items.
|
||||
|
||||
These invoices will not be proposed for inclusion in payment orders.
|
||||
|
||||
For further information, please visit:
|
||||
|
||||
* https://www.odoo.com/forum/help-1
|
||||
|
||||
Known issues / Roadmap
|
||||
======================
|
||||
|
||||
None.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Contributors
|
||||
------------
|
||||
|
||||
* Adrien Peiffer <adrien.peiffer@acsone.eu>
|
||||
* Stéphane Bidoul <stephane.bidoul@acsone.eu>
|
||||
|
||||
Maintainer
|
||||
----------
|
||||
|
||||
.. image:: http://odoo-community.org/logo.png
|
||||
:alt: Odoo Community Association
|
||||
:target: http://odoo-community.org
|
||||
|
||||
This module is maintained by the OCA.
|
||||
|
||||
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.
|
||||
|
||||
To contribute to this module, please visit http://odoo-community.org.
|
||||
|
||||
24
account_payment_blocking/__init__.py
Normal file
24
account_payment_blocking/__init__.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Payment Blocking module for Odoo
|
||||
# Copyright (C) 2014-2015 ACSONE SA/NV (http://acsone.eu)
|
||||
# @author Stéphane Bidoul <stephane.bidoul@acsone.eu>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from . import model
|
||||
from . import tests
|
||||
43
account_payment_blocking/__openerp__.py
Normal file
43
account_payment_blocking/__openerp__.py
Normal file
@@ -0,0 +1,43 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Payment Blocking module for Odoo
|
||||
# Copyright (C) 2014-2015 ACSONE SA/NV (http://acsone.eu)
|
||||
# @author Stéphane Bidoul <stephane.bidoul@acsone.eu>
|
||||
# @author Adrien Peiffer <adrien.peiffer@acsone.eu>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
{
|
||||
'name': 'account banking payment blocking',
|
||||
'version': '0.1',
|
||||
'category': 'Banking addons',
|
||||
'summary': """
|
||||
Prevent invoices under litigation to be proposed in payment orders.
|
||||
""",
|
||||
'author': 'ACSONE SA/NV,Odoo Community Association (OCA)',
|
||||
'website': 'http://acsone.eu',
|
||||
'depends': [
|
||||
'base',
|
||||
'account_banking_payment_export'
|
||||
],
|
||||
'data': [
|
||||
'view/account_invoice_view.xml'
|
||||
],
|
||||
'installable': True,
|
||||
'application': False,
|
||||
'auto_install': False,
|
||||
'license': 'AGPL-3',
|
||||
}
|
||||
24
account_payment_blocking/model/__init__.py
Normal file
24
account_payment_blocking/model/__init__.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Payment Blocking module for Odoo
|
||||
# Copyright (C) 2014-2015 ACSONE SA/NV (http://acsone.eu)
|
||||
# @author Stéphane Bidoul <stephane.bidoul@acsone.eu>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from . import payment_order_create
|
||||
from . import account_invoice
|
||||
75
account_payment_blocking/model/account_invoice.py
Normal file
75
account_payment_blocking/model/account_invoice.py
Normal file
@@ -0,0 +1,75 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Payment Blocking module for Odoo
|
||||
# Copyright (C) 2014-2015 ACSONE SA/NV (http://acsone.eu)
|
||||
# @author Adrien Peiffer <adrien.peiffer@acsone.eu>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp.osv import orm, fields
|
||||
|
||||
|
||||
class account_invoice(orm.Model):
|
||||
_inherit = "account.invoice"
|
||||
|
||||
def _get_move_line(self, cr, uid, invoice_id, context=None):
|
||||
return self.pool.get('account.move.line')\
|
||||
.search(cr, uid, [('account_id.type', 'in',
|
||||
['payable', 'receivable']),
|
||||
('invoice.id', '=', invoice_id)],
|
||||
context=context)
|
||||
|
||||
def _set_move_blocked(self, cr, uid, ids, name, field_value, arg,
|
||||
context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
if isinstance(ids, (int, long)):
|
||||
ids = [ids]
|
||||
for invoice in self.browse(cr, uid, ids, context=context):
|
||||
if invoice.move_id.id:
|
||||
move_line_ids = self._get_move_line(cr, uid, invoice.id,
|
||||
context=context)
|
||||
assert len(move_line_ids) == 1
|
||||
# work with account_constraints from OCA/AFT:
|
||||
context.update({'from_parent_object': True})
|
||||
self.pool.get('account.move.line')\
|
||||
.write(cr, uid, move_line_ids, {'blocked': field_value},
|
||||
context=context)
|
||||
|
||||
def _get_move_blocked(self, cr, uid, ids, name, arg, context=None):
|
||||
res = {}
|
||||
if isinstance(ids, (int, long)):
|
||||
ids = [ids]
|
||||
for invoice in self.browse(cr, uid, ids, context=context):
|
||||
if invoice.move_id.id:
|
||||
move_line_ids = self._get_move_line(cr, uid, invoice.id,
|
||||
context=context)
|
||||
assert len(move_line_ids) == 1
|
||||
move_line = self.pool.get('account.move.line')\
|
||||
.browse(cr, uid, move_line_ids, context=context)[0]
|
||||
res[invoice.id] = move_line.blocked
|
||||
else:
|
||||
res[invoice.id] = False
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'blocked': fields.function(_get_move_blocked,
|
||||
fnct_inv=_set_move_blocked,
|
||||
type='boolean', string='No Follow Up',
|
||||
states={'draft': [('readonly',
|
||||
True)]}),
|
||||
}
|
||||
34
account_payment_blocking/model/payment_order_create.py
Normal file
34
account_payment_blocking/model/payment_order_create.py
Normal file
@@ -0,0 +1,34 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Payment Blocking module for Odoo
|
||||
# Copyright (C) 2014-2015 ACSONE SA/NV (http://acsone.eu)
|
||||
# @author Stéphane Bidoul <stephane.bidoul@acsone.eu>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp.osv import orm
|
||||
|
||||
|
||||
class payment_order_create(orm.TransientModel):
|
||||
_inherit = 'payment.order.create'
|
||||
|
||||
def extend_payment_order_domain(
|
||||
self, cr, uid, payment_order, domain, context=None):
|
||||
super(payment_order_create, self).extend_payment_order_domain(
|
||||
cr, uid, payment_order, domain, context=context)
|
||||
domain += [('blocked', '!=', True)]
|
||||
return True
|
||||
538
account_payment_blocking/static/description/icon.png
Normal file
538
account_payment_blocking/static/description/icon.png
Normal file
@@ -0,0 +1,538 @@
|
||||
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" class="">
|
||||
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# object: http://ogp.me/ns/object# article: http://ogp.me/ns/article# profile: http://ogp.me/ns/profile#">
|
||||
<meta charset='utf-8'>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta http-equiv="Content-Language" content="en">
|
||||
|
||||
|
||||
<title>maintainer-tools/icon.png at master · OCA/maintainer-tools · GitHub</title>
|
||||
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub">
|
||||
<link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub">
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-114.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-144.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144.png">
|
||||
<meta property="fb:app_id" content="1401488693436528">
|
||||
|
||||
<meta content="@github" name="twitter:site" /><meta content="summary" name="twitter:card" /><meta content="OCA/maintainer-tools" name="twitter:title" /><meta content="maintainer-tools - Odoo Maintainers Tools for OCA members which evaluate and maintain repositories." name="twitter:description" /><meta content="https://avatars1.githubusercontent.com/u/7600578?v=3&s=400" name="twitter:image:src" />
|
||||
<meta content="GitHub" property="og:site_name" /><meta content="object" property="og:type" /><meta content="https://avatars1.githubusercontent.com/u/7600578?v=3&s=400" property="og:image" /><meta content="OCA/maintainer-tools" property="og:title" /><meta content="https://github.com/OCA/maintainer-tools" property="og:url" /><meta content="maintainer-tools - Odoo Maintainers Tools for OCA members which evaluate and maintain repositories." property="og:description" />
|
||||
<meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">
|
||||
<meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">
|
||||
<link rel="assets" href="https://assets-cdn.github.com/">
|
||||
|
||||
<meta name="pjax-timeout" content="1000">
|
||||
|
||||
|
||||
<meta name="msapplication-TileImage" content="/windows-tile.png">
|
||||
<meta name="msapplication-TileColor" content="#ffffff">
|
||||
<meta name="selected-link" value="repo_source" data-pjax-transient>
|
||||
<meta name="google-analytics" content="UA-3769691-2">
|
||||
|
||||
<meta content="collector.githubapp.com" name="octolytics-host" /><meta content="collector-cdn.github.com" name="octolytics-script-host" /><meta content="github" name="octolytics-app-id" /><meta content="51F0F88C:09EF:CE867D:5530CFDC" name="octolytics-dimension-request_id" />
|
||||
|
||||
<meta content="Rails, view, blob#show" name="analytics-event" />
|
||||
<meta class="js-ga-set" name="dimension1" content="Logged Out">
|
||||
<meta class="js-ga-set" name="dimension2" content="Header v3">
|
||||
<meta name="is-dotcom" content="true">
|
||||
<meta name="hostname" content="github.com">
|
||||
<meta name="user-login" content="">
|
||||
|
||||
|
||||
<link rel="icon" type="image/x-icon" href="https://assets-cdn.github.com/favicon.ico">
|
||||
|
||||
|
||||
<meta content="authenticity_token" name="csrf-param" />
|
||||
<meta content="g2jqCjB58Csg5BMankdhxfgorobZ+m9tWpfHZARGVsRNvmsVN7tWKv2+hgTzITDt6vcOMEdVhafjnTOF919xbA==" name="csrf-token" />
|
||||
|
||||
<link href="https://assets-cdn.github.com/assets/github-99d0b872ee54fd3afae4675a7592394fa9d65696f8ad7a751b79704bc999f40a.css" media="all" rel="stylesheet" />
|
||||
<link href="https://assets-cdn.github.com/assets/github2-e6c2d39e3c50ad99c491e3d19fe91e598eb13a1b75ec03b1831e8d710cde2f04.css" media="all" rel="stylesheet" />
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="x-pjax-version" content="4a4eec5c32a35d72f5cb696ad3d59cda">
|
||||
|
||||
|
||||
<meta name="description" content="maintainer-tools - Odoo Maintainers Tools for OCA members which evaluate and maintain repositories.">
|
||||
<meta name="go-import" content="github.com/OCA/maintainer-tools git https://github.com/OCA/maintainer-tools.git">
|
||||
|
||||
<meta content="7600578" name="octolytics-dimension-user_id" /><meta content="OCA" name="octolytics-dimension-user_login" /><meta content="20999008" name="octolytics-dimension-repository_id" /><meta content="OCA/maintainer-tools" name="octolytics-dimension-repository_nwo" /><meta content="true" name="octolytics-dimension-repository_public" /><meta content="false" name="octolytics-dimension-repository_is_fork" /><meta content="20999008" name="octolytics-dimension-repository_network_root_id" /><meta content="OCA/maintainer-tools" name="octolytics-dimension-repository_network_root_nwo" />
|
||||
<link href="https://github.com/OCA/maintainer-tools/commits/master.atom" rel="alternate" title="Recent Commits to maintainer-tools:master" type="application/atom+xml">
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
<body class="logged_out env-production vis-public page-blob">
|
||||
<a href="#start-of-content" tabindex="1" class="accessibility-aid js-skip-to-content">Skip to content</a>
|
||||
<div class="wrapper">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="header header-logged-out" role="banner">
|
||||
<div class="container clearfix">
|
||||
|
||||
<a class="header-logo-wordmark" href="https://github.com/" data-ga-click="(Logged out) Header, go to homepage, icon:logo-wordmark">
|
||||
<span class="mega-octicon octicon-logo-github"></span>
|
||||
</a>
|
||||
|
||||
<div class="header-actions" role="navigation">
|
||||
<a class="btn btn-primary" href="/join" data-ga-click="(Logged out) Header, clicked Sign up, text:sign-up">Sign up</a>
|
||||
<a class="btn" href="/login?return_to=%2FOCA%2Fmaintainer-tools%2Fblob%2Fmaster%2Ftemplate%2Fmodule%2Fstatic%2Fdescription%2Ficon.png" data-ga-click="(Logged out) Header, clicked Sign in, text:sign-in">Sign in</a>
|
||||
</div>
|
||||
|
||||
<div class="site-search repo-scope js-site-search" role="search">
|
||||
<form accept-charset="UTF-8" action="/OCA/maintainer-tools/search" class="js-site-search-form" data-global-search-url="/search" data-repo-search-url="/OCA/maintainer-tools/search" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /></div>
|
||||
<input type="text"
|
||||
class="js-site-search-field is-clearable"
|
||||
data-hotkey="s"
|
||||
name="q"
|
||||
placeholder="Search"
|
||||
data-global-scope-placeholder="Search GitHub"
|
||||
data-repo-scope-placeholder="Search"
|
||||
tabindex="1"
|
||||
autocapitalize="off">
|
||||
<div class="scope-badge">This repository</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<ul class="header-nav left" role="navigation">
|
||||
<li class="header-nav-item">
|
||||
<a class="header-nav-link" href="/explore" data-ga-click="(Logged out) Header, go to explore, text:explore">Explore</a>
|
||||
</li>
|
||||
<li class="header-nav-item">
|
||||
<a class="header-nav-link" href="/features" data-ga-click="(Logged out) Header, go to features, text:features">Features</a>
|
||||
</li>
|
||||
<li class="header-nav-item">
|
||||
<a class="header-nav-link" href="https://enterprise.github.com/" data-ga-click="(Logged out) Header, go to enterprise, text:enterprise">Enterprise</a>
|
||||
</li>
|
||||
<li class="header-nav-item">
|
||||
<a class="header-nav-link" href="/blog" data-ga-click="(Logged out) Header, go to blog, text:blog">Blog</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="start-of-content" class="accessibility-aid"></div>
|
||||
<div class="site" itemscope itemtype="http://schema.org/WebPage">
|
||||
<div id="js-flash-container">
|
||||
|
||||
</div>
|
||||
<div class="pagehead repohead instapaper_ignore readability-menu">
|
||||
<div class="container">
|
||||
|
||||
<ul class="pagehead-actions">
|
||||
|
||||
<li>
|
||||
<a href="/login?return_to=%2FOCA%2Fmaintainer-tools"
|
||||
class="btn btn-sm btn-with-count tooltipped tooltipped-n"
|
||||
aria-label="You must be signed in to watch a repository" rel="nofollow">
|
||||
<span class="octicon octicon-eye"></span>
|
||||
Watch
|
||||
</a>
|
||||
<a class="social-count" href="/OCA/maintainer-tools/watchers">
|
||||
30
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/login?return_to=%2FOCA%2Fmaintainer-tools"
|
||||
class="btn btn-sm btn-with-count tooltipped tooltipped-n"
|
||||
aria-label="You must be signed in to star a repository" rel="nofollow">
|
||||
<span class="octicon octicon-star"></span>
|
||||
Star
|
||||
</a>
|
||||
|
||||
<a class="social-count js-social-count" href="/OCA/maintainer-tools/stargazers">
|
||||
8
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/login?return_to=%2FOCA%2Fmaintainer-tools"
|
||||
class="btn btn-sm btn-with-count tooltipped tooltipped-n"
|
||||
aria-label="You must be signed in to fork a repository" rel="nofollow">
|
||||
<span class="octicon octicon-repo-forked"></span>
|
||||
Fork
|
||||
</a>
|
||||
<a href="/OCA/maintainer-tools/network" class="social-count">
|
||||
29
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h1 itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="entry-title public">
|
||||
<span class="mega-octicon octicon-repo"></span>
|
||||
<span class="author"><a href="/OCA" class="url fn" itemprop="url" rel="author"><span itemprop="title">OCA</span></a></span><!--
|
||||
--><span class="path-divider">/</span><!--
|
||||
--><strong><a href="/OCA/maintainer-tools" class="js-current-repository" data-pjax="#js-repo-pjax-container">maintainer-tools</a></strong>
|
||||
|
||||
<span class="page-context-loader">
|
||||
<img alt="" height="16" src="https://assets-cdn.github.com/assets/spinners/octocat-spinner-32-e513294efa576953719e4e2de888dd9cf929b7d62ed8d05f25e731d02452ab6c.gif" width="16" />
|
||||
</span>
|
||||
|
||||
</h1>
|
||||
</div><!-- /.container -->
|
||||
</div><!-- /.repohead -->
|
||||
|
||||
<div class="container">
|
||||
<div class="repository-with-sidebar repo-container new-discussion-timeline ">
|
||||
<div class="repository-sidebar clearfix">
|
||||
|
||||
<nav class="sunken-menu repo-nav js-repo-nav js-sidenav-container-pjax js-octicon-loaders"
|
||||
role="navigation"
|
||||
data-pjax="#js-repo-pjax-container"
|
||||
data-issue-count-url="/OCA/maintainer-tools/issues/counts">
|
||||
<ul class="sunken-menu-group">
|
||||
<li class="tooltipped tooltipped-w" aria-label="Code">
|
||||
<a href="/OCA/maintainer-tools" aria-label="Code" class="selected js-selected-navigation-item sunken-menu-item" data-hotkey="g c" data-selected-links="repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches /OCA/maintainer-tools">
|
||||
<span class="octicon octicon-code"></span> <span class="full-word">Code</span>
|
||||
<img alt="" class="mini-loader" height="16" src="https://assets-cdn.github.com/assets/spinners/octocat-spinner-32-e513294efa576953719e4e2de888dd9cf929b7d62ed8d05f25e731d02452ab6c.gif" width="16" />
|
||||
</a> </li>
|
||||
|
||||
<li class="tooltipped tooltipped-w" aria-label="Issues">
|
||||
<a href="/OCA/maintainer-tools/issues" aria-label="Issues" class="js-selected-navigation-item sunken-menu-item" data-hotkey="g i" data-selected-links="repo_issues repo_labels repo_milestones /OCA/maintainer-tools/issues">
|
||||
<span class="octicon octicon-issue-opened"></span> <span class="full-word">Issues</span>
|
||||
<span class="js-issue-replace-counter"></span>
|
||||
<img alt="" class="mini-loader" height="16" src="https://assets-cdn.github.com/assets/spinners/octocat-spinner-32-e513294efa576953719e4e2de888dd9cf929b7d62ed8d05f25e731d02452ab6c.gif" width="16" />
|
||||
</a> </li>
|
||||
|
||||
<li class="tooltipped tooltipped-w" aria-label="Pull requests">
|
||||
<a href="/OCA/maintainer-tools/pulls" aria-label="Pull requests" class="js-selected-navigation-item sunken-menu-item" data-hotkey="g p" data-selected-links="repo_pulls /OCA/maintainer-tools/pulls">
|
||||
<span class="octicon octicon-git-pull-request"></span> <span class="full-word">Pull requests</span>
|
||||
<span class="js-pull-replace-counter"></span>
|
||||
<img alt="" class="mini-loader" height="16" src="https://assets-cdn.github.com/assets/spinners/octocat-spinner-32-e513294efa576953719e4e2de888dd9cf929b7d62ed8d05f25e731d02452ab6c.gif" width="16" />
|
||||
</a> </li>
|
||||
|
||||
<li class="tooltipped tooltipped-w" aria-label="Wiki">
|
||||
<a href="/OCA/maintainer-tools/wiki" aria-label="Wiki" class="js-selected-navigation-item sunken-menu-item" data-hotkey="g w" data-selected-links="repo_wiki /OCA/maintainer-tools/wiki">
|
||||
<span class="octicon octicon-book"></span> <span class="full-word">Wiki</span>
|
||||
<img alt="" class="mini-loader" height="16" src="https://assets-cdn.github.com/assets/spinners/octocat-spinner-32-e513294efa576953719e4e2de888dd9cf929b7d62ed8d05f25e731d02452ab6c.gif" width="16" />
|
||||
</a> </li>
|
||||
</ul>
|
||||
<div class="sunken-menu-separator"></div>
|
||||
<ul class="sunken-menu-group">
|
||||
|
||||
<li class="tooltipped tooltipped-w" aria-label="Pulse">
|
||||
<a href="/OCA/maintainer-tools/pulse" aria-label="Pulse" class="js-selected-navigation-item sunken-menu-item" data-selected-links="pulse /OCA/maintainer-tools/pulse">
|
||||
<span class="octicon octicon-pulse"></span> <span class="full-word">Pulse</span>
|
||||
<img alt="" class="mini-loader" height="16" src="https://assets-cdn.github.com/assets/spinners/octocat-spinner-32-e513294efa576953719e4e2de888dd9cf929b7d62ed8d05f25e731d02452ab6c.gif" width="16" />
|
||||
</a> </li>
|
||||
|
||||
<li class="tooltipped tooltipped-w" aria-label="Graphs">
|
||||
<a href="/OCA/maintainer-tools/graphs" aria-label="Graphs" class="js-selected-navigation-item sunken-menu-item" data-selected-links="repo_graphs repo_contributors /OCA/maintainer-tools/graphs">
|
||||
<span class="octicon octicon-graph"></span> <span class="full-word">Graphs</span>
|
||||
<img alt="" class="mini-loader" height="16" src="https://assets-cdn.github.com/assets/spinners/octocat-spinner-32-e513294efa576953719e4e2de888dd9cf929b7d62ed8d05f25e731d02452ab6c.gif" width="16" />
|
||||
</a> </li>
|
||||
</ul>
|
||||
|
||||
|
||||
</nav>
|
||||
|
||||
<div class="only-with-full-nav">
|
||||
|
||||
<div class="clone-url open"
|
||||
data-protocol-type="http"
|
||||
data-url="/users/set_protocol?protocol_selector=http&protocol_type=clone">
|
||||
<h3><span class="text-emphasized">HTTPS</span> clone URL</h3>
|
||||
<div class="input-group js-zeroclipboard-container">
|
||||
<input type="text" class="input-mini input-monospace js-url-field js-zeroclipboard-target"
|
||||
value="https://github.com/OCA/maintainer-tools.git" readonly="readonly">
|
||||
<span class="input-group-button">
|
||||
<button aria-label="Copy to clipboard" class="js-zeroclipboard btn btn-sm zeroclipboard-button tooltipped tooltipped-s" data-copied-hint="Copied!" data-copy-hint="Copy to clipboard" type="button"><span class="octicon octicon-clippy"></span></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="clone-url "
|
||||
data-protocol-type="subversion"
|
||||
data-url="/users/set_protocol?protocol_selector=subversion&protocol_type=clone">
|
||||
<h3><span class="text-emphasized">Subversion</span> checkout URL</h3>
|
||||
<div class="input-group js-zeroclipboard-container">
|
||||
<input type="text" class="input-mini input-monospace js-url-field js-zeroclipboard-target"
|
||||
value="https://github.com/OCA/maintainer-tools" readonly="readonly">
|
||||
<span class="input-group-button">
|
||||
<button aria-label="Copy to clipboard" class="js-zeroclipboard btn btn-sm zeroclipboard-button tooltipped tooltipped-s" data-copied-hint="Copied!" data-copy-hint="Copy to clipboard" type="button"><span class="octicon octicon-clippy"></span></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<p class="clone-options">You can clone with
|
||||
<a href="#" class="js-clone-selector" data-protocol="http">HTTPS</a> or <a href="#" class="js-clone-selector" data-protocol="subversion">Subversion</a>.
|
||||
<a href="https://help.github.com/articles/which-remote-url-should-i-use" class="help tooltipped tooltipped-n" aria-label="Get help on which URL is right for you.">
|
||||
<span class="octicon octicon-question"></span>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/OCA/maintainer-tools/archive/master.zip"
|
||||
class="btn btn-sm sidebar-button"
|
||||
aria-label="Download the contents of OCA/maintainer-tools as a zip file"
|
||||
title="Download the contents of OCA/maintainer-tools as a zip file"
|
||||
rel="nofollow">
|
||||
<span class="octicon octicon-cloud-download"></span>
|
||||
Download ZIP
|
||||
</a>
|
||||
</div>
|
||||
</div><!-- /.repository-sidebar -->
|
||||
|
||||
<div id="js-repo-pjax-container" class="repository-content context-loader-container" data-pjax-container>
|
||||
|
||||
|
||||
<a href="/OCA/maintainer-tools/blob/d488c2bd0d59a8dbfb47743de111d0f8877d6202/template/module/static/description/icon.png" class="hidden js-permalink-shortcut" data-hotkey="y">Permalink</a>
|
||||
|
||||
<!-- blob contrib key: blob_contributors:v21:3721227b06b2a9bcc210e7f8c354cfd6 -->
|
||||
|
||||
<div class="file-navigation js-zeroclipboard-container">
|
||||
|
||||
<div class="select-menu js-menu-container js-select-menu left">
|
||||
<span class="btn btn-sm select-menu-button js-menu-target css-truncate" data-hotkey="w"
|
||||
data-master-branch="master"
|
||||
data-ref="master"
|
||||
title="master"
|
||||
role="button" aria-label="Switch branches or tags" tabindex="0" aria-haspopup="true">
|
||||
<span class="octicon octicon-git-branch"></span>
|
||||
<i>branch:</i>
|
||||
<span class="js-select-button css-truncate-target">master</span>
|
||||
</span>
|
||||
|
||||
<div class="select-menu-modal-holder js-menu-content js-navigation-container" data-pjax aria-hidden="true">
|
||||
|
||||
<div class="select-menu-modal">
|
||||
<div class="select-menu-header">
|
||||
<span class="select-menu-title">Switch branches/tags</span>
|
||||
<span class="octicon octicon-x js-menu-close" role="button" aria-label="Close"></span>
|
||||
</div>
|
||||
|
||||
<div class="select-menu-filters">
|
||||
<div class="select-menu-text-filter">
|
||||
<input type="text" aria-label="Filter branches/tags" id="context-commitish-filter-field" class="js-filterable-field js-navigation-enable" placeholder="Filter branches/tags">
|
||||
</div>
|
||||
<div class="select-menu-tabs">
|
||||
<ul>
|
||||
<li class="select-menu-tab">
|
||||
<a href="#" data-tab-filter="branches" data-filter-placeholder="Filter branches/tags" class="js-select-menu-tab">Branches</a>
|
||||
</li>
|
||||
<li class="select-menu-tab">
|
||||
<a href="#" data-tab-filter="tags" data-filter-placeholder="Find a tag…" class="js-select-menu-tab">Tags</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="branches">
|
||||
|
||||
<div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring">
|
||||
|
||||
|
||||
<a class="select-menu-item js-navigation-item js-navigation-open selected"
|
||||
href="/OCA/maintainer-tools/blob/master/template/module/static/description/icon.png"
|
||||
data-name="master"
|
||||
data-skip-pjax="true"
|
||||
rel="nofollow">
|
||||
<span class="select-menu-item-icon octicon octicon-check"></span>
|
||||
<span class="select-menu-item-text css-truncate-target" title="master">
|
||||
master
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="select-menu-no-results">Nothing to show</div>
|
||||
</div>
|
||||
|
||||
<div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="tags">
|
||||
<div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="select-menu-no-results">Nothing to show</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="btn-group right">
|
||||
<a href="/OCA/maintainer-tools/find/master"
|
||||
class="js-show-file-finder btn btn-sm empty-icon tooltipped tooltipped-s"
|
||||
data-pjax
|
||||
data-hotkey="t"
|
||||
aria-label="Quickly jump between files">
|
||||
<span class="octicon octicon-list-unordered"></span>
|
||||
</a>
|
||||
<button aria-label="Copy file path to clipboard" class="js-zeroclipboard btn btn-sm zeroclipboard-button tooltipped tooltipped-s" data-copied-hint="Copied!" data-copy-hint="Copy file path to clipboard" type="button"><span class="octicon octicon-clippy"></span></button>
|
||||
</div>
|
||||
|
||||
<div class="breadcrumb js-zeroclipboard-target">
|
||||
<span class='repo-root js-repo-root'><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/OCA/maintainer-tools" class="" data-branch="master" data-direction="back" data-pjax="true" itemscope="url"><span itemprop="title">maintainer-tools</span></a></span></span><span class="separator">/</span><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/OCA/maintainer-tools/tree/master/template" class="" data-branch="master" data-direction="back" data-pjax="true" itemscope="url"><span itemprop="title">template</span></a></span><span class="separator">/</span><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/OCA/maintainer-tools/tree/master/template/module" class="" data-branch="master" data-direction="back" data-pjax="true" itemscope="url"><span itemprop="title">module</span></a></span><span class="separator">/</span><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/OCA/maintainer-tools/tree/master/template/module/static" class="" data-branch="master" data-direction="back" data-pjax="true" itemscope="url"><span itemprop="title">static</span></a></span><span class="separator">/</span><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/OCA/maintainer-tools/tree/master/template/module/static/description" class="" data-branch="master" data-direction="back" data-pjax="true" itemscope="url"><span itemprop="title">description</span></a></span><span class="separator">/</span><strong class="final-path">icon.png</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="commit file-history-tease">
|
||||
<div class="file-history-tease-header">
|
||||
<img alt="@pedrobaeza" class="avatar" data-user="7165771" height="24" src="https://avatars3.githubusercontent.com/u/7165771?v=3&s=48" width="24" />
|
||||
<span class="author"><a href="/pedrobaeza" rel="contributor">pedrobaeza</a></span>
|
||||
<time datetime="2015-03-14T07:21:56Z" is="relative-time">Mar 14, 2015</time>
|
||||
<div class="commit-title">
|
||||
<a href="/OCA/maintainer-tools/commit/df4640e17a25d70ba295e60b98ab99fd956f9682" class="message" data-pjax="true" title="[IMP] Default template icon">[IMP] Default template icon</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="participation">
|
||||
<p class="quickstat">
|
||||
<a href="#blob_contributors_box" rel="facebox">
|
||||
<strong>2</strong>
|
||||
contributors
|
||||
</a>
|
||||
</p>
|
||||
<a class="avatar-link tooltipped tooltipped-s" aria-label="pedrobaeza" href="/OCA/maintainer-tools/commits/master/template/module/static/description/icon.png?author=pedrobaeza"><img alt="@pedrobaeza" class="avatar" data-user="7165771" height="20" src="https://avatars1.githubusercontent.com/u/7165771?v=3&s=40" width="20" /> </a>
|
||||
<a class="avatar-link tooltipped tooltipped-s" aria-label="hbrunn" href="/OCA/maintainer-tools/commits/master/template/module/static/description/icon.png?author=hbrunn"><img alt="@hbrunn" class="avatar" data-user="2563186" height="20" src="https://avatars2.githubusercontent.com/u/2563186?v=3&s=40" width="20" /> </a>
|
||||
|
||||
|
||||
</div>
|
||||
<div id="blob_contributors_box" style="display:none">
|
||||
<h2 class="facebox-header">Users who have contributed to this file</h2>
|
||||
<ul class="facebox-user-list">
|
||||
<li class="facebox-user-list-item">
|
||||
<img alt="@pedrobaeza" data-user="7165771" height="24" src="https://avatars3.githubusercontent.com/u/7165771?v=3&s=48" width="24" />
|
||||
<a href="/pedrobaeza">pedrobaeza</a>
|
||||
</li>
|
||||
<li class="facebox-user-list-item">
|
||||
<img alt="@hbrunn" data-user="2563186" height="24" src="https://avatars0.githubusercontent.com/u/2563186?v=3&s=48" width="24" />
|
||||
<a href="/hbrunn">hbrunn</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="file">
|
||||
<div class="file-header">
|
||||
<div class="file-actions">
|
||||
|
||||
<div class="btn-group">
|
||||
<a href="/OCA/maintainer-tools/raw/master/template/module/static/description/icon.png" class="btn btn-sm " id="raw-url">Raw</a>
|
||||
<a href="/OCA/maintainer-tools/commits/master/template/module/static/description/icon.png" class="btn btn-sm " rel="nofollow">History</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<button type="button" class="octicon-btn octicon-btn-danger disabled tooltipped tooltipped-n" aria-label="You must be signed in to make or propose changes">
|
||||
<span class="octicon octicon-trashcan"></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="file-info">
|
||||
9.455 kb
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="blob-wrapper data type-text">
|
||||
<div class="image">
|
||||
<span class="border-wrap"><img src="/OCA/maintainer-tools/blob/master/template/module/static/description/icon.png?raw=true" alt="icon.png"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<a href="#jump-to-line" rel="facebox[.linejump]" data-hotkey="l" style="display:none">Jump to Line</a>
|
||||
<div id="jump-to-line" style="display:none">
|
||||
<form accept-charset="UTF-8" action="" class="js-jump-to-line-form" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /></div>
|
||||
<input class="linejump-input js-jump-to-line-field" type="text" placeholder="Jump to line…" autofocus>
|
||||
<button type="submit" class="btn">Go</button>
|
||||
</form></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div><!-- /.repo-container -->
|
||||
<div class="modal-backdrop"></div>
|
||||
</div><!-- /.container -->
|
||||
</div><!-- /.site -->
|
||||
|
||||
|
||||
</div><!-- /.wrapper -->
|
||||
|
||||
<div class="container">
|
||||
<div class="site-footer" role="contentinfo">
|
||||
<ul class="site-footer-links right">
|
||||
<li><a href="https://status.github.com/" data-ga-click="Footer, go to status, text:status">Status</a></li>
|
||||
<li><a href="https://developer.github.com" data-ga-click="Footer, go to api, text:api">API</a></li>
|
||||
<li><a href="https://training.github.com" data-ga-click="Footer, go to training, text:training">Training</a></li>
|
||||
<li><a href="https://shop.github.com" data-ga-click="Footer, go to shop, text:shop">Shop</a></li>
|
||||
<li><a href="https://github.com/blog" data-ga-click="Footer, go to blog, text:blog">Blog</a></li>
|
||||
<li><a href="https://github.com/about" data-ga-click="Footer, go to about, text:about">About</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
<a href="https://github.com" aria-label="Homepage">
|
||||
<span class="mega-octicon octicon-mark-github" title="GitHub"></span>
|
||||
</a>
|
||||
<ul class="site-footer-links">
|
||||
<li>© 2015 <span title="0.03254s from github-fe135-cp1-prd.iad.github.net">GitHub</span>, Inc.</li>
|
||||
<li><a href="https://github.com/site/terms" data-ga-click="Footer, go to terms, text:terms">Terms</a></li>
|
||||
<li><a href="https://github.com/site/privacy" data-ga-click="Footer, go to privacy, text:privacy">Privacy</a></li>
|
||||
<li><a href="https://github.com/security" data-ga-click="Footer, go to security, text:security">Security</a></li>
|
||||
<li><a href="https://github.com/contact" data-ga-click="Footer, go to contact, text:contact">Contact</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="fullscreen-overlay js-fullscreen-overlay" id="fullscreen_overlay">
|
||||
<div class="fullscreen-container js-suggester-container">
|
||||
<div class="textarea-wrap">
|
||||
<textarea name="fullscreen-contents" id="fullscreen-contents" class="fullscreen-contents js-fullscreen-contents" placeholder=""></textarea>
|
||||
<div class="suggester-container">
|
||||
<div class="suggester fullscreen-suggester js-suggester js-navigation-container"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fullscreen-sidebar">
|
||||
<a href="#" class="exit-fullscreen js-exit-fullscreen tooltipped tooltipped-w" aria-label="Exit Zen Mode">
|
||||
<span class="mega-octicon octicon-screen-normal"></span>
|
||||
</a>
|
||||
<a href="#" class="theme-switcher js-theme-switcher tooltipped tooltipped-w"
|
||||
aria-label="Switch themes">
|
||||
<span class="octicon octicon-color-mode"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="ajax-error-message" class="flash flash-error">
|
||||
<span class="octicon octicon-alert"></span>
|
||||
<a href="#" class="octicon octicon-x flash-close js-ajax-error-dismiss" aria-label="Dismiss error"></a>
|
||||
Something went wrong with that request. Please try again.
|
||||
</div>
|
||||
|
||||
|
||||
<script crossorigin="anonymous" src="https://assets-cdn.github.com/assets/frameworks-2c8ae50712a47d2b83d740cb875d55cdbbb3fdbccf303951cc6b7e63731e0c38.js"></script>
|
||||
<script async="async" crossorigin="anonymous" src="https://assets-cdn.github.com/assets/github-a612914f18d72984765c3aa8bf9dc71ff1da096692c5e14976f9910b2ec2fbda.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
23
account_payment_blocking/tests/__init__.py
Normal file
23
account_payment_blocking/tests/__init__.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Payment Blocking module for Odoo
|
||||
# Copyright (C) 2014-2015 ACSONE SA/NV (http://acsone.eu)
|
||||
# @author Adrien Peiffer <adrien.peiffer@acsone.eu>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from . import test_account_banking_payment_blocking
|
||||
@@ -0,0 +1,80 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Payment Blocking module for Odoo
|
||||
# Copyright (C) 2014-2015 ACSONE SA/NV (http://acsone.eu)
|
||||
# @author Adrien Peiffer <adrien.peiffer@acsone.eu>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import openerp.tests.common as common
|
||||
from openerp import workflow
|
||||
|
||||
DB = common.DB
|
||||
ADMIN_USER_ID = common.ADMIN_USER_ID
|
||||
|
||||
|
||||
def create_simple_invoice(self, cr, uid, context=None):
|
||||
partner_id = self.ref('base.res_partner_2')
|
||||
product_id = self.ref('product.product_product_4')
|
||||
return self.registry('account.invoice')\
|
||||
.create(cr, uid, {'partner_id': partner_id,
|
||||
'account_id':
|
||||
self.ref('account.a_recv'),
|
||||
'journal_id':
|
||||
self.ref('account.expenses_journal'),
|
||||
'invoice_line': [(0, 0, {'name': 'test',
|
||||
'account_id':
|
||||
self.ref('account.a_sale'),
|
||||
'price_unit': 2000.00,
|
||||
'quantity': 1,
|
||||
'product_id': product_id,
|
||||
}
|
||||
)
|
||||
],
|
||||
})
|
||||
|
||||
|
||||
class TestAccountBankingPaymentBlocking(common.TransactionCase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestAccountBankingPaymentBlocking, self).setUp()
|
||||
self.context = self.registry("res.users").context_get(self.cr,
|
||||
self.uid)
|
||||
|
||||
def test_invoice(self):
|
||||
invoice_obj = self.registry('account.invoice')
|
||||
move_line_obj = self.registry('account.move.line')
|
||||
invoice_id = create_simple_invoice(self, self.cr, self.uid,
|
||||
context=self.context)
|
||||
workflow.trg_validate(self.uid, 'account.invoice', invoice_id,
|
||||
'invoice_open', self.cr)
|
||||
invoice = invoice_obj.browse(self.cr, self.uid, [invoice_id],
|
||||
context=self.context)[0]
|
||||
move_line_ids = move_line_obj\
|
||||
.search(self.cr, self.uid, [('account_id.type', 'in',
|
||||
['payable', 'receivable']),
|
||||
('invoice.id', '=', invoice.id)])
|
||||
move_line = move_line_obj.browse(self.cr, self.uid, move_line_ids)[0]
|
||||
self.assertEqual(invoice.blocked, move_line.blocked,
|
||||
'Blocked values are not equals')
|
||||
move_line_obj.write(self.cr, self.uid, move_line_ids,
|
||||
{'blocked': True})
|
||||
invoice = invoice_obj.browse(self.cr, self.uid, [invoice_id],
|
||||
context=self.context)[0]
|
||||
move_line = move_line_obj.browse(self.cr, self.uid, move_line_ids)[0]
|
||||
self.assertEqual(invoice.blocked, move_line.blocked,
|
||||
'Blocked values are not equals')
|
||||
15
account_payment_blocking/view/account_invoice_view.xml
Normal file
15
account_payment_blocking/view/account_invoice_view.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="invoice_supplier_form" model="ir.ui.view">
|
||||
<field name="name">account.invoice.supplier.form (account_banking_payment_blocking)</field>
|
||||
<field name="model">account.invoice</field>
|
||||
<field name="inherit_id" ref="account.invoice_supplier_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="move_id" position="after">
|
||||
<field name="blocked"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
Reference in New Issue
Block a user