Skip to content

Commit

Permalink
Added a check and change the domain of populate function
Browse files Browse the repository at this point in the history
  • Loading branch information
idelapoza-sidoo committed Sep 12, 2024
1 parent cac6032 commit 95d76ac
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions payment_order_transactions_summary/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
# For copyright and license notices, see __manifest__.py file in root directory
###############################################################################
from . import models
from . import wizards
1 change: 1 addition & 0 deletions payment_order_transactions_summary/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
],
'data': [
'views/account_payment_order_views.xml',
'wizards/account_payment_line_create_view.xml',
'report/print_account_payment_order_document.xml',
],
}
10 changes: 10 additions & 0 deletions payment_order_transactions_summary/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: payment_order_transactions_summary
#: model:ir.model.fields,field_description:payment_order_transactions_summary.field_account_payment_line_create__allow_normal
msgid "Allow Normal Move Lines"
msgstr "Incluir apuntes normales"

#. module: payment_order_transactions_summary
#: model:ir.model.fields,help:payment_order_transactions_summary.field_account_payment_line_create__allow_normal
msgid "Allow normal move lines (No Blocked or Returned)"
msgstr "Incluye apuntes que no sean en litigio o devueltos"

#. module: payment_order_transactions_summary
#: model:ir.model.fields,field_description:payment_order_transactions_summary.field_account_payment_line__invoice_date
#: model_terms:ir.ui.view,arch_db:payment_order_transactions_summary.print_account_payment_order_document_sdi
Expand Down
4 changes: 4 additions & 0 deletions payment_order_transactions_summary/wizards/__init__.py
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
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
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>

0 comments on commit 95d76ac

Please sign in to comment.