Merge lp:~vauxoo/addons-vauxoo/account_invoice_regular_validation_dev_luis into lp:addons-vauxoo

Proposed by Luis Torres - http://www.vauxoo.com
Status: Merged
Merged at revision: 394
Proposed branch: lp:~vauxoo/addons-vauxoo/account_invoice_regular_validation_dev_luis
Merge into: lp:addons-vauxoo
Diff against target: 194 lines (+168/-0)
5 files modified
account_invoice_regular_validation/__init__.py (+26/-0)
account_invoice_regular_validation/__openerp__.py (+46/-0)
account_invoice_regular_validation/account_invoice.py (+41/-0)
account_invoice_regular_validation/account_invoice_view.xml (+16/-0)
account_invoice_regular_validation/i18n/es.po (+39/-0)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/account_invoice_regular_validation_dev_luis
Reviewer Review Type Date Requested Status
Moisés López - http://www.vauxoo.com Approve
Luis Torres - http://www.vauxoo.com Needs Resubmitting
Julio Serna-http://www.vauxoo.com Pending
Review via email: mp+119001@code.launchpad.net

Description of the change

Se modifico el domain para que en las líneas de la factura unicamente muestre los tipos de cuenta que sean de tipo 'other', y que no se pueda validar la factura algun producto tiene una cuenta diferente a esta.

To post a comment you must log in.
Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

Luis,
Está perfecto y funcional
Ahora solo atacar los guidelines

Cambia la línea
  for lin in self.browse(cr,uid,ids)
  a
  for invoice in self.browse(cr, uid, ids, context=context)

Cambia la línea
  for lins in lin.invoice_line:
  a
  for line in invoice.invoice_line:

Para atacar el guideline fish to fish

Elimina la clase
class account_invoice_line(osv.osv):
Con agregar el domain en la vista, es suficiente.

review: Needs Fixing
Revision history for this message
Luis Torres - http://www.vauxoo.com (luis-cleto-) wrote :

Se elimino la clase account_invoice_line, que no se ocupaba, y se cambiaron los nombres a algunas variables

review: Needs Resubmitting
Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'account_invoice_regular_validation'
=== added file 'account_invoice_regular_validation/__init__.py'
--- account_invoice_regular_validation/__init__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_regular_validation/__init__.py 2012-08-09 18:32:19 +0000
@@ -0,0 +1,26 @@
1# -*- encoding: utf-8 -*-
2###########################################################################
3# Module Writen to OpenERP, Open Source Management Solution
4#
5# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
6# All Rights Reserved.
7# info Vauxoo (info@vauxoo.com)
8############################################################################
9# Coded by: Luis Torres (luis_t@vauxoo.com)
10############################################################################
11#
12# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero General Public License as
14# published by the Free Software Foundation, either version 3 of the
15# License, or (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see <http://www.gnu.org/licenses/>.
24#
25##############################################################################
26import account_invoice
027
=== added file 'account_invoice_regular_validation/__openerp__.py'
--- account_invoice_regular_validation/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_invoice_regular_validation/__openerp__.py 2012-08-09 18:32:19 +0000
@@ -0,0 +1,46 @@
1# -*- encoding: utf-8 -*-
2###########################################################################
3# Module Writen to OpenERP, Open Source Management Solution
4#
5# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
6# All Rights Reserved.
7# info Vauxoo (info@vauxoo.com)
8############################################################################
9# Coded by: Luis Torres (luis_t@vauxoo.com)
10############################################################################
11#
12# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero General Public License as
14# published by the Free Software Foundation, either version 3 of the
15# License, or (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see <http://www.gnu.org/licenses/>.
24#
25##############################################################################
26
27{
28 "name" : "Invoice Regular Validation",
29 "version" : "1.0",
30 "author" : "Vauxoo",
31 "category" : "Generic Modules",
32 "description" : """
33 This module validate that the lines don't have account type different to regular
34 """,
35 "website" : "http://www.vauxoo.com/",
36 "license" : "AGPL-3",
37 "depends" : ["base","account"
38 ],
39 "init_xml" : [],
40 "demo_xml" : [],
41 "update_xml" : [
42 "account_invoice_view.xml",
43 ],
44 "installable" : True,
45 "active" : False,
46}
047
=== added file 'account_invoice_regular_validation/account_invoice.py'
--- account_invoice_regular_validation/account_invoice.py 1970-01-01 00:00:00 +0000
+++ account_invoice_regular_validation/account_invoice.py 2012-08-09 18:32:19 +0000
@@ -0,0 +1,41 @@
1# -*- encoding: utf-8 -*-
2###########################################################################
3# Module Writen to OpenERP, Open Source Management Solution
4#
5# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
6# All Rights Reserved.
7# info Vauxoo (info@vauxoo.com)
8############################################################################
9# Coded by: Luis Torres (luis_t@vauxoo.com)
10############################################################################
11#
12# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero General Public License as
14# published by the Free Software Foundation, either version 3 of the
15# License, or (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see <http://www.gnu.org/licenses/>.
24#
25##############################################################################
26from osv import fields, osv
27from tools.translate import _
28
29class account_invoice(osv.osv):
30 _inherit='account.invoice'
31
32 def action_move_create(self, cr, uid, ids, context=None):
33 if not context:
34 context={}
35 for invoice in self.browse(cr, uid, ids, context=context):
36 for line in invoice.invoice_line:
37 if line.account_id.type<>'other':
38 raise osv.except_osv(_('Error!'),_("Can not be used different types of accounts to 'other' in the lines of the invoice!"))
39 res = super(account_invoice,self).action_move_create(cr, uid, ids, context=context)
40 return res
41account_invoice()
042
=== added file 'account_invoice_regular_validation/account_invoice_view.xml'
--- account_invoice_regular_validation/account_invoice_view.xml 1970-01-01 00:00:00 +0000
+++ account_invoice_regular_validation/account_invoice_view.xml 2012-08-09 18:32:19 +0000
@@ -0,0 +1,16 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record model="ir.ui.view" id="view_account_invoice_line_inherit_account_id_form">
5 <field name="name">view.account.invoice.line.inherit.account.id.form</field>
6 <field name="model">account.invoice.line</field>
7 <field name="type">form</field>
8 <field name="inherit_id" ref="account.view_invoice_line_form"/>
9 <field name="arch" type="xml">
10 <xpath expr="/form/field[@name='account_id']" position="replace">
11 <field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '=', 'other')]" name="account_id" on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/>
12 </xpath>
13 </field>
14 </record>
15 </data>
16</openerp>
017
=== added directory 'account_invoice_regular_validation/i18n'
=== added file 'account_invoice_regular_validation/i18n/es.po'
--- account_invoice_regular_validation/i18n/es.po 1970-01-01 00:00:00 +0000
+++ account_invoice_regular_validation/i18n/es.po 2012-08-09 18:32:19 +0000
@@ -0,0 +1,39 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * account_invoice_regular_validation
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.1\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2012-08-08 22:50+0000\n"
10"PO-Revision-Date: 2012-08-08 22:50+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: account_invoice_regular_validation
19#: code:addons/account_invoice_regular_validation/account_invoice.py:38
20#, python-format
21msgid "Error!"
22msgstr "Error!"
23
24#. module: account_invoice_regular_validation
25#: sql_constraint:account.invoice:0
26msgid "Invoice Number must be unique per Company!"
27msgstr "¡El número de factura debe ser único por compañía!"
28
29#. module: account_invoice_regular_validation
30#: code:addons/account_invoice_regular_validation/account_invoice.py:38
31#, python-format
32msgid "Can not be used different types of accounts to 'other' in the lines of the invoice!"
33msgstr "No se pueden utilizar tipos de cuenta diferentes a 'regular' en las líneas de la factura!"
34
35#. module: account_invoice_regular_validation
36#: model:ir.model,name:account_invoice_regular_validation.model_account_invoice
37msgid "Invoice"
38msgstr "Factura"
39