Skip to content

Commit

Permalink
[MERGE] merge 10.0 into 11.0 (#86)
Browse files Browse the repository at this point in the history
* [MIG] Make modules uninstallable

* [MIG] Rename manifest files

* [MIG] Update metafiles

* [10.0] merge changes from v9 (#60)

* FIX account payment group search viewx

* OCA Transbot updated translations from Transifex

* IMP order on payments

* IMP check migration

* IMP checks migration

* FIX wizard payment group invoice (#59)

* OCA Transbot updated translations from Transifex

* [9.0] Fix onchange of m2m computed fields used in domains

* [9.0] Fix onchange of m2m computed fields used in domains

* [10.0] MIG checks, payment groups, withholdings, etc

* REF migrate

* FIX hooks

* IMP

* REF

* REF

* REF

* [10.0][IMP] rename menu id due to odoo warnings (#62)

* REF use unicode if needed

* [FIX] clean merge dirty

* [FIX] merge

* [FIX] merge

* [ADD] oca deps. repos

* [REL] account_payment_fix on v11

* [IMP]
  • Loading branch information
jjscarafia committed May 17, 2018
1 parent be93234 commit 5142a43
Show file tree
Hide file tree
Showing 44 changed files with 674 additions and 991 deletions.
7 changes: 3 additions & 4 deletions account_check/__manifest__.py
Expand Up @@ -19,11 +19,10 @@
##############################################################################
{
'name': 'Account Check Management',
'version': '9.0.1.24.0',
'version': '11.0.1.0.0',
'category': 'Accounting',
'summary': 'Accounting, Payment, Check, Third, Issue',
'author': "OpenERP Team de Localizacion Argentina,"
"Odoo Community Association (OCA)",
'author': 'ADHOC SA,Odoo Community Association (OCA)',
'license': 'AGPL-3',
'images': [
],
Expand All @@ -42,7 +41,7 @@
'views/account_journal_dashboard_view.xml',
'views/account_journal_view.xml',
'views/account_checkbook_view.xml',
'views/res_company_view.xml',
'views/res_config_view.xml',
'views/account_chart_template_view.xml',
'security/ir.model.access.csv',
'security/account_check_security.xml',
Expand Down
1 change: 1 addition & 0 deletions account_check/models/__init__.py
Expand Up @@ -10,3 +10,4 @@
from . import res_company
from . import account_chart_template
from . import account_bank_statement_line
from . import res_config
27 changes: 14 additions & 13 deletions account_check/models/account_checkbook.py
Expand Up @@ -122,19 +122,20 @@ def create(self, vals):
rec._create_sequence()
return rec

@api.one
@api.multi
def _create_sequence(self):
""" Create a check sequence for the checkbook """
self.sequence_id = self.env['ir.sequence'].sudo().create({
'name': '%s - %s' % (self.journal_id.name, self.name),
'implementation': 'no_gap',
'padding': 8,
'number_increment': 1,
'code': 'issue_check',
# si no lo pasamos, en la creacion se setea 1
'number_next_actual': self.next_number,
'company_id': self.journal_id.company_id.id,
})
for rec in self:
rec.sequence_id = rec.env['ir.sequence'].sudo().create({
'name': '%s - %s' % (rec.journal_id.name, rec.name),
'implementation': 'no_gap',
'padding': 8,
'number_increment': 1,
'code': 'issue_check',
# si no lo pasamos, en la creacion se setea 1
'number_next_actual': rec.next_number,
'company_id': rec.journal_id.company_id.id,
})

@api.multi
def _compute_name(self):
Expand All @@ -147,9 +148,9 @@ def _compute_name(self):
name += _(' up to %s') % rec.range_to
rec.name = name

@api.one
@api.multi
def unlink(self):
if self.issue_check_ids:
if self.mapped('issue_check_ids'):
raise ValidationError(
_('You can drop a checkbook if it has been used on checks!'))
return super(AccountCheckbook, self).unlink()
11 changes: 6 additions & 5 deletions account_check/models/account_journal.py
Expand Up @@ -26,13 +26,14 @@ def create(self, vals):
rec._create_checkbook()
return rec

@api.one
@api.multi
def _create_checkbook(self):
""" Create a check sequence for the journal """
checkbook = self.checkbook_ids.create({
'journal_id': self.id,
})
checkbook.state = 'active'
for rec in self:
checkbook = rec.checkbook_ids.create({
'journal_id': rec.id,
})
checkbook.state = 'active'

@api.model
def _enable_issue_check_on_bank_journals(self):
Expand Down
1 change: 0 additions & 1 deletion account_check/models/account_payment.py
Expand Up @@ -215,7 +215,6 @@ def onchange_check_owner_vat(self):
[('check_owner_vat', '=', self.check_owner_vat)],
limit=1).check_owner_name

@api.one
@api.onchange('partner_id', 'payment_method_code')
def onchange_partner_check(self):
commercial_partner = self.partner_id.commercial_partner_id
Expand Down
17 changes: 17 additions & 0 deletions account_check/models/res_config.py
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
from odoo import fields, models
# from odoo.exceptions import UserError


class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'

rejected_check_account_id = fields.Many2one(
related='company_id.rejected_check_account_id',
)
deferred_check_account_id = fields.Many2one(
related='company_id.deferred_check_account_id',
)
holding_check_account_id = fields.Many2one(
related='company_id.holding_check_account_id',
)
24 changes: 11 additions & 13 deletions account_check/views/account_chart_template_view.xml
@@ -1,17 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_account_chart_template_form" model="ir.ui.view">
<field name="name">account.chart.template.form</field>
<field name="model">account.chart.template</field>
<field name="inherit_id" ref="account.view_account_chart_template_form"/>
<field name="arch" type="xml">
<field name="property_account_income_id" position="after">
<field name="rejected_check_account_id"/>
<field name="deferred_check_account_id"/>
<field name="holding_check_account_id"/>
</field>
<record id="view_account_chart_template_form" model="ir.ui.view">
<field name="name">account.chart.template.form</field>
<field name="model">account.chart.template</field>
<field name="inherit_id" ref="account.view_account_chart_template_form"/>
<field name="arch" type="xml">
<field name="property_account_income_id" position="after">
<field name="rejected_check_account_id"/>
<field name="deferred_check_account_id"/>
<field name="holding_check_account_id"/>
</field>
</record>
</data>
</field>
</record>
</odoo>
6 changes: 2 additions & 4 deletions account_check/views/account_check_view.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>

<!-- Checks -->
<record model="ir.ui.view" id="view_account_check_tree">
Expand Down Expand Up @@ -211,7 +210,7 @@
action="action_third_check"
id="menu_third_check"
sequence="40"
parent="account.menu_finance_bank_and_cash"/>
parent="account_payment_fix.menu_finance_bank_and_cash"/>

<!-- Issued Check Menu -->
<record model="ir.actions.act_window" id="action_issue_check">
Expand All @@ -227,7 +226,6 @@
action="action_issue_check"
id="menu_issue_check"
sequence="50"
parent="account.menu_finance_bank_and_cash"/>
parent="account_payment_fix.menu_finance_bank_and_cash"/>

</data>
</odoo>
82 changes: 40 additions & 42 deletions account_check/views/account_checkbook_view.xml
@@ -1,46 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>

<record id="view_account_checkbook_tree" model="ir.ui.view">
<field name="name">account.checkbook.tree</field>
<field name="model">account.checkbook</field>
<field name="arch" type="xml">
<tree string="Checkbooks" colors="blue:state == 'draft';black:state in ('active');red:state == 'hrejected';gray:state == 'used'" editable="bottom">
<field name="issue_check_subtype"/>
<field name="name"/>
<field name="next_number"/>
<field name="range_to"/>
<field name="numerate_on_printing"/>
<!-- <field name="block_manual_number"/> -->
<field name="state"/>
</tree>
</field>
</record>
<record id="view_account_checkbook_tree" model="ir.ui.view">
<field name="name">account.checkbook.tree</field>
<field name="model">account.checkbook</field>
<field name="arch" type="xml">
<tree string="Checkbooks" colors="blue:state == 'draft';black:state in ('active');red:state == 'hrejected';gray:state == 'used'" editable="bottom">
<field name="issue_check_subtype"/>
<field name="name"/>
<field name="next_number"/>
<field name="range_to"/>
<field name="numerate_on_printing"/>
<!-- <field name="block_manual_number"/> -->
<field name="state"/>
</tree>
</field>
</record>

<record id="view_account_checkbook_form" model="ir.ui.view">
<field name="name">account.checkbook.form</field>
<field name="model">account.checkbook</field>
<field name="arch" type="xml">
<form string="Checkbooks">
<header string="Checkbooks">
<field name="state" widget="statusbar" clickable="True"/>
</header>
<sheet string="Checkbooks">
<group>
<field name="name" invisible="1"/>
<field name="sequence_id" groups="base.group_no_one"/>
<field name="next_number"/>
<field name="issue_check_subtype"/>
<field name="range_to"/>
<field name="numerate_on_printing"/>
<!-- <field name="block_manual_number"/> -->
<field name="report_template"/>
</group>
</sheet>
</form>
</field>
</record>

</data>
</odoo>
<record id="view_account_checkbook_form" model="ir.ui.view">
<field name="name">account.checkbook.form</field>
<field name="model">account.checkbook</field>
<field name="arch" type="xml">
<form string="Checkbooks">
<header string="Checkbooks">
<field name="state" widget="statusbar" clickable="True"/>
</header>
<sheet string="Checkbooks">
<group>
<field name="name" invisible="1"/>
<field name="sequence_id" groups="base.group_no_one"/>
<field name="next_number"/>
<field name="issue_check_subtype"/>
<field name="range_to"/>
<field name="numerate_on_printing"/>
<!-- <field name="block_manual_number"/> -->
<field name="report_template"/>
</group>
</sheet>
</form>
</field>
</record>

</odoo>
94 changes: 46 additions & 48 deletions account_check/views/account_journal_dashboard_view.xml
@@ -1,57 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="account_journal_dashboard_kanban_view_inherited" model="ir.ui.view">
<field name="name">account.journal.dashboard.kanban.inherited</field>
<field name="model">account.journal</field>
<field name="inherit_id" ref="account.account_journal_dashboard_kanban_view" />
<field name="arch" type="xml">
<xpath expr="//t[@t-name='JournalBodyBankCash']//div[contains(@class, 'o_kanban_primary_right')]" position="inside">
<div t-if="dashboard.show_third_checks">
<div class="row">
<div class="col-xs-6">
<a type="object" name="open_action_checks" context="{'check_type': 'third_check'}">
<t t-esc="dashboard.num_holding_third_checks"/>
<t>Third Check(s) on hand</t>
</a>
</div>
<div class="col-xs-6 text-right">
<span><t t-esc="dashboard.holding_amount"/></span>
</div>
<record id="account_journal_dashboard_kanban_view_inherited" model="ir.ui.view">
<field name="name">account.journal.dashboard.kanban.inherited</field>
<field name="model">account.journal</field>
<field name="inherit_id" ref="account.account_journal_dashboard_kanban_view" />
<field name="arch" type="xml">
<xpath expr="//t[@t-name='JournalBodyBankCash']//div[contains(@class, 'o_kanban_primary_right')]" position="inside">
<div t-if="dashboard.show_third_checks">
<div class="row">
<div class="col-xs-6">
<a type="object" name="open_action_checks" context="{'check_type': 'third_check'}">
<t t-esc="dashboard.num_holding_third_checks"/>
<t>Third Check(s) on hand</t>
</a>
</div>
<!-- not so usefull -->
<div class="col-xs-6 text-right">
<span><t t-esc="dashboard.holding_amount"/></span>
</div>
</div>
</div>
<!-- not so usefull -->
<!-- <div class="row">
<div class="col-xs-12">
<a type="object" name="open_transfer_money">Checks Deposits</a>
</div>
</div> -->
<div class="col-xs-12">
<a type="object" name="open_transfer_money">Checks Deposits</a>
</div>
<div t-if="dashboard.show_issue_checks">
<div class="row">
<div class="col-xs-6">
<a type="object" name="open_action_checks" context="{'check_type': 'issue_check'}">
<t t-esc="dashboard.num_handed_issue_checks"/>
<t>Issue Check(s) handed</t>
</a>
</div>
<div class="col-xs-6 text-right">
<span><t t-esc="dashboard.handed_amount"/></span>
</div>
</div>
</div> -->
</div>
<div t-if="dashboard.show_issue_checks">
<div class="row">
<div class="col-xs-6">
<a type="object" name="open_action_checks" context="{'check_type': 'issue_check'}">
<t t-esc="dashboard.num_handed_issue_checks"/>
<t>Issue Check(s) handed</t>
</a>
</div>
<div class="col-xs-6 text-right">
<span><t t-esc="dashboard.handed_amount"/></span>
</div>
<div t-if="dashboard.num_checks_to_numerate">
<div class="row">
<div class="col-xs-12">
<a type="object" name="action_checks_to_numerate">
<t t-esc="dashboard.num_checks_to_numerate"/>
<t t-if="dashboard.num_checks_to_numerate == 1">Check to print and numerate</t>
<t t-if="dashboard.num_checks_to_numerate != 1">Checks to print and numerate</t>
</a>
</div>
</div>
<div t-if="dashboard.num_checks_to_numerate">
<div class="row">
<div class="col-xs-12">
<a type="object" name="action_checks_to_numerate">
<t t-esc="dashboard.num_checks_to_numerate"/>
<t t-if="dashboard.num_checks_to_numerate == 1">Check to print and numerate</t>
<t t-if="dashboard.num_checks_to_numerate != 1">Checks to print and numerate</t>
</a>
</div>
</div>
</xpath>
</field>
</record>
</data>
</div>
</xpath>
</field>
</record>
</odoo>
24 changes: 11 additions & 13 deletions account_check/views/account_journal_view.xml
@@ -1,16 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_account_check_journal_form" model="ir.ui.view">
<field name="name">account_check.account.journal.form</field>
<field name="model">account.journal</field>
<field name="inherit_id" ref="account.view_account_journal_form"/>
<field name="arch" type="xml">
<page name="bank_account">
<label for="checkbook_ids"/>
<field name="checkbook_ids" attrs="{'invisible': [('type', '!=', 'bank')]}" context="{'company_id':company_id}"/>
</page>
</field>
</record>
</data>
<record id="view_account_check_journal_form" model="ir.ui.view">
<field name="name">account_check.account.journal.form</field>
<field name="model">account.journal</field>
<field name="inherit_id" ref="account.view_account_journal_form"/>
<field name="arch" type="xml">
<page name="bank_account">
<label for="checkbook_ids"/>
<field name="checkbook_ids" attrs="{'invisible': [('type', '!=', 'bank')]}" context="{'company_id':company_id}"/>
</page>
</field>
</record>
</odoo>

0 comments on commit 5142a43

Please sign in to comment.