clearcorp team mailing list archive
-
clearcorp team
-
Mailing list archive
-
Message #00195
lp:~as.clearcorp/openerp-ccorp-addons/6.1-account_invoice_journal_defaults into lp:openerp-ccorp-addons
Armando Soto Rodríguez has proposed merging lp:~as.clearcorp/openerp-ccorp-addons/6.1-account_invoice_journal_defaults into lp:openerp-ccorp-addons.
Requested reviews:
CLEARCORP drivers (clearcorp-drivers)
For more details, see:
https://code.launchpad.net/~as.clearcorp/openerp-ccorp-addons/6.1-account_invoice_journal_defaults/+merge/112851
[ADD] account_invoice_journal_defaults
--
https://code.launchpad.net/~as.clearcorp/openerp-ccorp-addons/6.1-account_invoice_journal_defaults/+merge/112851
Your team CLEARCORP development team is subscribed to branch lp:openerp-ccorp-addons.
=== added directory 'account_invoice_journal_defaults'
=== added file 'account_invoice_journal_defaults/__init__.py'
--- account_invoice_journal_defaults/__init__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_journal_defaults/__init__.py 2012-06-29 21:26:29 +0000
@@ -0,0 +1,25 @@
+#-*- coding:utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# d$
+#
+# 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 account_invoice_journal_defaults
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'account_invoice_journal_defaults/__openerp__.py'
--- account_invoice_journal_defaults/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_journal_defaults/__openerp__.py 2012-06-29 21:26:29 +0000
@@ -0,0 +1,48 @@
+#-*- coding:utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# d$
+#
+# 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_invoice_journal_defaults',
+ 'version': '1.0',
+ 'category': 'Accounting & Finance',
+ "sequence": 4,
+ 'complexity': "normal",
+ 'description': """
+account_invoice_journal_defaults.
+=======================
+ * Currency changed to readonly
+ * Change button removed
+ * account_id removed in onchange_partner
+ * account_id added in onchange_journal
+ """,
+ "author" : 'CLEARCORP S.A',
+ 'website':'http://www.clearcorp.co.cr',
+ "depends" : ['account'],
+ 'update_xml': [
+ 'account_invoice_journal_defaults_view.xml',
+ ],
+ "auto_install": False,
+ "application": False,
+ "installable": True,
+ 'license': 'AGPL-3',
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'account_invoice_journal_defaults/account_invoice_journal_defaults.py'
--- account_invoice_journal_defaults/account_invoice_journal_defaults.py 1970-01-01 00:00:00 +0000
+++ account_invoice_journal_defaults/account_invoice_journal_defaults.py 2012-06-29 21:26:29 +0000
@@ -0,0 +1,73 @@
+#-*- coding:utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# d$
+#
+# 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 netsvc
+from osv import fields, osv
+import tools
+from tools.translate import _
+
+class account_invoice(osv.osv):
+ _inherit = 'account.invoice'
+ _name = 'account.invoice'
+ _description = 'Invoice'
+
+ def onchange_partner_id(self, cr, uid, ids, type, partner_id,\
+ date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False):
+
+ result = super(account_invoice, self).onchange_partner_id(cr, uid, ids, type, partner_id, date_invoice, payment_term, partner_bank_id, company_id)
+
+ del result['value']['account_id']
+
+ return result
+
+ def onchange_journal_id(self, cr, uid, ids, journal_id=False, context=None):
+ result = super(account_invoice, self).onchange_journal_id(cr, uid, ids, journal_id, context)
+
+ journal = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context)
+
+ if journal.type == 'sale':
+ acc_id = journal.default_receivable_account_id.id
+ elif journal.type == 'purchase':
+ acc_id = journal.default_payable_account_id.id
+ elif journal.type == 'sale_refund':
+ acc_id = journal.default_payable_account_id.id
+ elif journal.type == 'purchase_refund':
+ acc_id = journal.default_receivable_account_id.id
+
+ result['value']['account_id'] = acc_id
+
+ return result
+
+class account_journal(osv.osv):
+ _inherit = 'account.journal'
+ _name = 'account.journal'
+ _description = 'Journal'
+
+ _columns = {
+ 'default_receivable_account_id': fields.many2one('account.account', 'Default Receivable Account', domain="[('type','!=','view')]", help="It acts as a default receivable account"),
+ 'default_payable_account_id': fields.many2one('account.account', 'Default Payable Account', domain="[('type','!=','view')]", help="It acts as a default payable account"),
+ }
+
+
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'account_invoice_journal_defaults/account_invoice_journal_defaults_view.xml'
--- account_invoice_journal_defaults/account_invoice_journal_defaults_view.xml 1970-01-01 00:00:00 +0000
+++ account_invoice_journal_defaults/account_invoice_journal_defaults_view.xml 2012-06-29 21:26:29 +0000
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!-- Supplier Invoice -->
+ <record id="account_invoice_journal_defalut_supplier_form" model="ir.ui.view">
+ <field name="name">account.invoice.journal.defalut.supplier.form</field>
+ <field name="model">account.invoice</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="account.invoice_supplier_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <field name = "currency_id" position = "replace">
+ <field name="currency_id" width="50" readonly="1"/>
+ </field>
+ <field name = "account_id" position = "replace">
+ <field domain="[('company_id', '=', company_id), ('type', '=', 'payable')]" name="account_id" readonly="1" groups="account.group_account_user"/>
+ </field>
+ <button string="Change" position = "replace">
+ <button invisible = "True" type="action" icon="terp-stock_effects-object-colorize" string="Change" groups="account.group_account_user"/>
+ </button>
+ </data>
+ </field>
+ </record>
+ <!-- End Supplier Invoice -->
+
+ <!-- Customer Invoice -->
+ <record id="account_invoice_journal_defalut_customer_form" model="ir.ui.view">
+ <field name="name">account.invoice.journal.defalut.customer.form</field>
+ <field name="model">account.invoice</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="account.invoice_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <field name = "currency_id" position = "replace">
+ <field name="currency_id" width="50" readonly="1"/>
+ </field>
+ <field name = "account_id" position = "replace">
+ <field domain="[('company_id', '=', company_id),('type','=', 'receivable')]" name="account_id" readonly="1" groups="account.group_account_user"/>
+ </field>
+ <button string="Change" position = "replace">
+ <button invisible = "True" type="action" icon="terp-stock_effects-object-colorize" string="Change" groups="account.group_account_user"/>
+ </button>
+ </data>
+ </field>
+ </record>
+ <!-- End Customer Invoice -->
+
+ <!-- Account Journal -->
+ <record id="account_invoice_journal_defalut_journal_form" model="ir.ui.view">
+ <field name="name">account.invoice.journal.defalut.journal.form</field>
+ <field name="model">account.journal</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="account.view_account_journal_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <field name="default_credit_account_id" position = "after">
+ <group colspan="2" col="2" attrs="{'invisible':[('type','not in', ('sale', 'purchase', 'sale_refund', 'purchase_refund'))]}">
+ <separator string="Default Accounts Receivable/Payable" colspan="4"/>
+ <field name="default_receivable_account_id" attrs="{'required':[('type','in', ('sale', 'purchase', 'sale_refund', 'purchase_refund'))]}" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
+ <field name="default_payable_account_id" attrs="{'required':[('type','in', ('sale', 'purchase', 'sale_refund', 'purchase_refund'))]}" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
+ </group>
+ </field>
+ </data>
+ </field>
+ </record>
+ <!-- End Account Journal -->
+ </data>
+</openerp>
=== added directory 'account_invoice_journal_defaults/i18n'
=== added file 'account_invoice_journal_defaults/i18n/es_CR.po'
--- account_invoice_journal_defaults/i18n/es_CR.po 1970-01-01 00:00:00 +0000
+++ account_invoice_journal_defaults/i18n/es_CR.po 2012-06-29 21:26:29 +0000
@@ -0,0 +1,77 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * account_invoice_journal_defaults
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-06-29 18:46+0000\n"
+"PO-Revision-Date: 2012-06-29 18:46+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: account_invoice_journal_defaults
+#: sql_constraint:account.invoice:0
+msgid "Invoice Number must be unique per Company!"
+msgstr "¡El número de factura debe ser único por empresa!"
+
+#. module: account_invoice_journal_defaults
+#: field:account.journal,default_payable_account_id:0
+msgid "Default Payable Account"
+msgstr "Cuenta por pagar por defecto"
+
+#. module: account_invoice_journal_defaults
+#: model:ir.model,name:account_invoice_journal_defaults.model_account_journal
+msgid "Journal"
+msgstr "Diario"
+
+#. module: account_invoice_journal_defaults
+#: sql_constraint:account.journal:0
+msgid "The name of the journal must be unique per company !"
+msgstr "¡El nombre del diaro debe ser único por compañía!"
+
+#. module: account_invoice_journal_defaults
+#: view:account.journal:0
+msgid "Default Accounts Receivable/Payable"
+msgstr "Cuentas por Defecto por Cobrar/Pagar"
+
+#. module: account_invoice_journal_defaults
+#: constraint:account.journal:0
+msgid "Configuration error! The currency chosen should be shared by the default accounts too."
+msgstr "¡Error de configuración! La moneda elegida debería ser también la misma en las cuentas por defecto"
+
+#. module: account_invoice_journal_defaults
+#: help:account.journal,default_receivable_account_id:0
+msgid "It acts as a default receivable account"
+msgstr "Actúa como cuenta por cobrar por defecto"
+
+#. module: account_invoice_journal_defaults
+#: model:ir.model,name:account_invoice_journal_defaults.model_account_invoice
+msgid "Invoice"
+msgstr "Factura"
+
+#. module: account_invoice_journal_defaults
+#: sql_constraint:account.journal:0
+msgid "The code of the journal must be unique per company !"
+msgstr "¡El código del diario debe ser único por compañía!"
+
+#. module: account_invoice_journal_defaults
+#: field:account.journal,default_receivable_account_id:0
+msgid "Default Receivable Account"
+msgstr "Cuenta por cobrar por defecto"
+
+#. module: account_invoice_journal_defaults
+#: view:account.invoice:0
+msgid "Change"
+msgstr "Cambiar"
+
+#. module: account_invoice_journal_defaults
+#: help:account.journal,default_payable_account_id:0
+msgid "It acts as a default payable account"
+msgstr "Actúa como cuenta por pagar por defecto"
+
Follow ups