-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a check and change the domain of populate function
- Loading branch information
1 parent
cac6032
commit 95d76ac
Showing
6 changed files
with
51 additions
and
0 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
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,4 @@ | ||
############################################################################### | ||
# For copyright and license notices, see __manifest__.py file in root directory | ||
############################################################################### | ||
from . import account_payment_line_create |
21 changes: 21 additions & 0 deletions
21
payment_order_transactions_summary/wizards/account_payment_line_create.py
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 @@ | ||
from odoo import api, fields, models | ||
|
||
|
||
class AccountPaymentLineCreate(models.TransientModel): | ||
_inherit = 'account.payment.line.create' | ||
|
||
allow_normal = fields.Boolean( | ||
string='Allow Normal Move Lines', | ||
help='Allow normal move lines (No Blocked or Returned)' | ||
) | ||
|
||
@api.multi | ||
def _prepare_move_line_domain(self): | ||
domain = super(AccountPaymentLineCreate, self)._prepare_move_line_domain() | ||
if not self.allow_normal: | ||
domain += [ | ||
'|', | ||
('blocked', '=', True), | ||
('invoice_id.returned_payment', '=', True) | ||
] | ||
return domain |
14 changes: 14 additions & 0 deletions
14
payment_order_transactions_summary/wizards/account_payment_line_create_view.xml
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,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
|
||
<record id="account_payment_line_create_form" model="ir.ui.view"> | ||
<field name="inherit_id" ref="account_payment_order.account_payment_line_create_form"/> | ||
<field name="model">account.payment.line.create</field> | ||
<field name="arch" type="xml"> | ||
<field name="invoice" position="after"> | ||
<field name="allow_normal"/> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
</odoo> |