Skip to content

Commit

Permalink
Merge c492796 into 03f22cd
Browse files Browse the repository at this point in the history
  • Loading branch information
jjscarafia committed May 20, 2018
2 parents 03f22cd + c492796 commit 5eabf94
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 80 deletions.
2 changes: 1 addition & 1 deletion account_check/models/account_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def get_journal_dashboard_datas(self):
domain_holding_third_checks)

num_checks_to_numerate = False
if self.env['ir.actions.report.xml'].search(
if self.env['ir.actions.report'].search(
[('report_name', '=', 'check_report')]):
num_checks_to_numerate = self.env['account.payment'].search_count([
('journal_id', '=', self.id),
Expand Down
6 changes: 3 additions & 3 deletions account_check/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ class ResCompany(models.Model):

rejected_check_account_id = fields.Many2one(
'account.account',
'Rejected Check Account',
'Rejected Checks Account',
help='Rejection Checks account, for eg. "Rejected Checks"',
)
deferred_check_account_id = fields.Many2one(
'account.account',
'Deferred Check Account',
'Deferred Checks Account',
help='Deferred Checks account, for eg. "Deferred Checks"',
)
holding_check_account_id = fields.Many2one(
'account.account',
'Holding Check Account',
'Holding Checks Account',
help='Holding Checks account for third checks, '
'for eg. "Holding Checks"',
)
Expand Down
2 changes: 1 addition & 1 deletion account_check/views/account_check_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<field name="amount"/>
<field name="amount_currency" attrs="{'invisible': [('amount_currency', '=', 0.0)]}"/>
</group>
<group>
<group>
<field name="state"/>
<field name="owner_name" attrs="{'invisible':[('type','!=','third_check')],'required':[('type','=','third_check')]}"/>
<field name="owner_vat" attrs="{'invisible':[('type','!=','third_check')],'required':[('type','=','third_check')]}"/>
Expand Down
16 changes: 0 additions & 16 deletions account_check/views/res_company_view.xml

This file was deleted.

1 change: 0 additions & 1 deletion account_check/wizard/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from odoo import fields, models
# from odoo.exceptions import UserError

Expand Down
38 changes: 23 additions & 15 deletions account_check/wizard/res_config_settings_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,30 @@
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="account.res_config_settings_view_form"/>
<field name="arch" type="xml">
<div id="bank_cash">
<label for="id" string="Checks Configuration"/>
<div name="checks_configuration">
<div>
<label for="rejected_check_account_id" string="Rejected Account"/>
<field name="rejected_check_account_id" class="oe_inline"/>
<div id="account_yodlee" position="before">
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane"/>
<div class="o_setting_right_pane">
<label string="Checks Accounts"/>
<div class="text-muted">
Accounts used on checks operations
</div>
<div class="content-group">
<div class="row mt16">
<label for="rejected_check_account_id" class="col-md-3 o_light_label"/>
<field name="rejected_check_account_id" attrs="{'required': [('has_chart_of_accounts','=',True)]}"/>
</div>
<div class="row mt16">
<label for="deferred_check_account_id" class="col-md-3 o_light_label"/>
<field name="deferred_check_account_id" attrs="{'required': [('has_chart_of_accounts','=',True)]}"/>
</div>
<!-- la ocultamos porque la idea es depreciarla y que si se usa cheques de terceros y manual en mismo diario, siempre se use la misma cuenta, la dejamos por compatibilidad para clientes que ya la tienen en uso -->
<!-- <div class="row mt16">
<label for="holding_check_account_id" class="col-md-3 o_light_label"/>
<field name="holding_check_account_id" attrs="{'required': [('has_chart_of_accounts','=',True)]}"/>
</div> -->
</div>
</div>
<div>
<label for="deferred_check_account_id" string="Deferred Account"/>
<field name="deferred_check_account_id" class="oe_inline"/>
</div>
<!-- la ocultamos porque la idea es depreciarla y que si se usa cheques de terceros y manual en mismo diario, siempre se use la misma cuenta, la dejamos por compatibilidad para clientes que ya la tienen en uso -->
<!-- <div>
<label for="holding_check_account_id"/>
<field name="holding_check_account_id" class="oe_inline"/>
</div> -->
</div>
</div>
</field>
Expand Down
2 changes: 1 addition & 1 deletion account_payment_group/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
'security/security.xml',
'security/ir.model.access.csv',
'wizards/account_payment_group_invoice_wizard_view.xml',
'wizards/res_config_view.xml',
'wizards/res_config_settings_views.xml',
'views/account_payment_view.xml',
'views/account_move_line_view.xml',
'views/account_payment_group_view.xml',
Expand Down
6 changes: 3 additions & 3 deletions account_payment_group/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ class AccountPayment(models.Model):
)
signed_amount = fields.Monetary(
string='Payment Amount',
compute='compute_signed_amount',
compute='_compute_signed_amount',
)
signed_amount_company_currency = fields.Monetary(
string='Payment Amount on Company Currency',
compute='compute_signed_amount',
compute='_compute_signed_amount',
currency_field='company_currency_id',
)
amount_company_currency = fields.Monetary(
Expand Down Expand Up @@ -67,7 +67,7 @@ class AccountPayment(models.Model):
@api.multi
@api.depends(
'amount', 'payment_type', 'partner_type', 'amount_company_currency')
def compute_signed_amount(self):
def _compute_signed_amount(self):
for rec in self:
sign = 1.0
if (
Expand Down
15 changes: 0 additions & 15 deletions account_payment_group/views/res_company_view.xml

This file was deleted.

2 changes: 1 addition & 1 deletion account_payment_group/wizards/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import account_payment_group_invoice_wizard
from . import res_config
from . import res_config_settings
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def confirm(self):
line_values['account_analytic_id'] = self.account_analytic_id.id
invoice.write({'invoice_line_ids': [(0, 0, line_values)]})
invoice.compute_taxes()
invoice.signal_workflow('invoice_open')
invoice.action_invoice_open()

# TODO this FIX is to be removed on v11. This is to fix reconcilation
# of the invoice with secondary_currency and the debit note without
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<!-- supplier payments section -->
<xpath expr="//div[@data-key='account_invoicing']//div[@class='row mt16 o_settings_container'][5]">
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="col-xs-12 col-md-6 o_setting_box" name="double_validation">
<div class="o_setting_left_pane">
<field name="double_validation" widget="upgrade_boolean"/>
</div>
Expand Down
1 change: 0 additions & 1 deletion account_payment_group_document/hooks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging
from openerp import api, SUPERUSER_ID
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __manifest__.py file in root directory
##############################################################################
Expand Down Expand Up @@ -31,25 +30,6 @@ class AccountPaymentGroupInvoiceWizard(models.TransientModel):
string='Available Journal Document Types',
)

@api.multi
def onchange(self, values, field_name, field_onchange):
"""
Idea obtenida de aca
https://github.com/odoo/odoo/issues/16072#issuecomment-289833419
por el cambio que se introdujo en esa mimsa conversación, TODO en v11
no haría mas falta, simplemente domain="[('id', 'in', x2m_field)]"
Otras posibilidades que probamos pero no resultaron del todo fue:
* agregar onchange sobre campos calculados y que devuelvan un dict con
domain. El tema es que si se entra a un registro guardado el onchange
no se ejecuta
* usae el modulo de web_domain_field que esta en un pr a la oca
"""
for field in field_onchange.keys():
if field.startswith('available_journal_document_type_ids.'):
del field_onchange[field]
return super(AccountPaymentGroupInvoiceWizard, self).onchange(
values, field_name, field_onchange)

@api.multi
@api.depends('journal_id')
def _compute_available_journal_document_types(self):
Expand Down

0 comments on commit 5eabf94

Please sign in to comment.