Compare commits
	
		
			2 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 243a5ca765 | |||
| f2048d66a2 | 
							
								
								
									
										37
									
								
								CONTRIBUIR.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								CONTRIBUIR.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,37 @@
 | 
				
			|||||||
 | 
					# CONTRIBUIR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### requerimientos tecnicos
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* python >= 3.9
 | 
				
			||||||
 | 
					* docker >= 20
 | 
				
			||||||
 | 
					* docker-compose >= 2
 | 
				
			||||||
 | 
					* pre-commit >= 2
 | 
				
			||||||
 | 
					* git >= 2.30
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### consideraciones
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* evito trabajo innecesario
 | 
				
			||||||
 | 
					* evito generalizar, primero hago pruebas y luego elimino duplicidad
 | 
				
			||||||
 | 
					* evito redundancia, si lo puedo automatizar lo automatizo
 | 
				
			||||||
 | 
					* evito usar `git add .`
 | 
				
			||||||
 | 
					* a todo momento hago expresivo lo escrito, renombro, muevo o elimino
 | 
				
			||||||
 | 
					* en todo momento debo poder ejecutar las pruebas
 | 
				
			||||||
 | 
					* en todo momento debo poder el programa
 | 
				
			||||||
 | 
					* en todo momento especulo, me ilustro y aprendo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### convencion commit
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ante cada commit el mensaje se clasifica en:
 | 
				
			||||||
 | 
					*  **feat(\<COMPONENTE\>)** una nueva funcionalidad accesible al usuario o sistema
 | 
				
			||||||
 | 
					*  **fix(\<COMPONENTE\>)** correcion de una funcionalidad ya entregada
 | 
				
			||||||
 | 
					*  **chore(\<COMPONENTE\>)** otros cambios que no impactan directamente al usuario, ejemplo renombramiento de archivo,clases,metodos,variables,carpetas,scripts, documentacion, recursos digitales, etc..
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					`COMPONENTE` nombre del directorio
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ejemplos:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					`git commit -m 'feat(<COMPONENTE>): venta de equipos opticos`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					`git commit -m 'fix(<COMPONENTE>): se adiciona boton faltante`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					`git commit -m 'chore(<COMPONENTE>): cambio de color en columna Producto`
 | 
				
			||||||
@@ -1,7 +0,0 @@
 | 
				
			|||||||
Analytic Operations Module
 | 
					 | 
				
			||||||
=========================
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
The *Analytic Operations Module* adds the concept of analytic account general
 | 
					 | 
				
			||||||
in invoice, purchase, sale. This allows added the account analytic to the lines of
 | 
					 | 
				
			||||||
operation more fast.
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										10
									
								
								__init__.py
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								__init__.py
									
									
									
									
									
								
							@@ -2,7 +2,7 @@
 | 
				
			|||||||
# this repository contains the full copyright notices and license terms.
 | 
					# this repository contains the full copyright notices and license terms.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from trytond.pool import Pool
 | 
					from trytond.pool import Pool
 | 
				
			||||||
from . import invoice, purchase, sale
 | 
					from . import purchase, sale
 | 
				
			||||||
 | 
					
 | 
				
			||||||
__all__ = ['register']
 | 
					__all__ = ['register']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -13,10 +13,8 @@ def register():
 | 
				
			|||||||
        purchase.PurchaseLine,
 | 
					        purchase.PurchaseLine,
 | 
				
			||||||
        sale.Sale,
 | 
					        sale.Sale,
 | 
				
			||||||
        sale.SaleLine,
 | 
					        sale.SaleLine,
 | 
				
			||||||
        invoice.Invoice,
 | 
					        module='analytic_operation', type_='model')
 | 
				
			||||||
        invoice.InvoiceLine,
 | 
					 | 
				
			||||||
        module='analytic_operations', type_='model')
 | 
					 | 
				
			||||||
    Pool.register(
 | 
					    Pool.register(
 | 
				
			||||||
        module='analytic_operations', type_='wizard')
 | 
					        module='analytic_operation', type_='wizard')
 | 
				
			||||||
    Pool.register(
 | 
					    Pool.register(
 | 
				
			||||||
        module='analytic_operations', type_='report')
 | 
					        module='analytic_operation', type_='report')
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,10 +1,6 @@
 | 
				
			|||||||
######################
 | 
					#########################
 | 
				
			||||||
Analytic Operations Module
 | 
					Analytic Operation Module
 | 
				
			||||||
######################
 | 
					#########################
 | 
				
			||||||
 | 
					 | 
				
			||||||
The *Analytic Operations Module* adds the concept of analytic account general
 | 
					 | 
				
			||||||
in invoice, purchase, sale. This allows added the account analytic to the lines of
 | 
					 | 
				
			||||||
operation more fast.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
.. toctree::
 | 
					.. toctree::
 | 
				
			||||||
   :maxdepth: 2
 | 
					   :maxdepth: 2
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										39
									
								
								invoice.py
									
									
									
									
									
								
							
							
						
						
									
										39
									
								
								invoice.py
									
									
									
									
									
								
							@@ -1,39 +0,0 @@
 | 
				
			|||||||
# This file is part of Tryton.  The COPYRIGHT file at the top level of
 | 
					 | 
				
			||||||
# this repository contains the full copyright notices and license terms.
 | 
					 | 
				
			||||||
from trytond.pool import Pool, PoolMeta
 | 
					 | 
				
			||||||
from trytond.model import ModelView, ModelSQL, fields
 | 
					 | 
				
			||||||
from trytond.pyson import Eval
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from trytond.exceptions import UserError
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
class Invoice(metaclass=PoolMeta):
 | 
					 | 
				
			||||||
    'Account Invoice'
 | 
					 | 
				
			||||||
    __name__ = 'account.invoice'
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    _states = {
 | 
					 | 
				
			||||||
        'readonly': Eval('state') != 'draft',
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    account_analytic = fields.Many2One('analytic_account.account', 'Analytic Account',
 | 
					 | 
				
			||||||
                                       domain=[('type', '=', 'normal')],
 | 
					 | 
				
			||||||
                                       states=_states)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
class InvoiceLine(metaclass=PoolMeta):
 | 
					 | 
				
			||||||
      'Invoice Line'
 | 
					 | 
				
			||||||
      __name__ = 'account.invoice.line'
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      @fields.depends('product', 'unit', '_parent_invoice.type', 'analytic_accounts',
 | 
					 | 
				
			||||||
                      '_parent_invoice.party', 'party', 'invoice', 'invoice_type',
 | 
					 | 
				
			||||||
                      '_parent_invoice.account_analytic', '_parent_invoice.invoice_date',
 | 
					 | 
				
			||||||
                      '_parent_invoice.accounting_date','company', methods=['_get_tax_rule_pattern'])
 | 
					 | 
				
			||||||
      def on_change_product(self):
 | 
					 | 
				
			||||||
          super(InvoiceLine, self).on_change_product()
 | 
					 | 
				
			||||||
          self.analytic_accounts = tuple()
 | 
					 | 
				
			||||||
          try:
 | 
					 | 
				
			||||||
              self.analytic_accounts += ({'root': self.invoice.account_analytic.root,
 | 
					 | 
				
			||||||
                                          'account': self.invoice.account_analytic},) 
 | 
					 | 
				
			||||||
          except:
 | 
					 | 
				
			||||||
              pass
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
							
								
								
									
										11
									
								
								invoice.xml
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								invoice.xml
									
									
									
									
									
								
							@@ -1,11 +0,0 @@
 | 
				
			|||||||
<?xml version="1.0"?>
 | 
					 | 
				
			||||||
<!--This file file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
 | 
					 | 
				
			||||||
<tryton>
 | 
					 | 
				
			||||||
    <data>
 | 
					 | 
				
			||||||
	<record model="ir.ui.view" id="invoice_view_form">
 | 
					 | 
				
			||||||
	    <field name="model">account.invoice</field>
 | 
					 | 
				
			||||||
	    <field name="inherit" ref="account_invoice.invoice_view_form"/>
 | 
					 | 
				
			||||||
	    <field name="name">invoice_form</field>		
 | 
					 | 
				
			||||||
    	</record>
 | 
					 | 
				
			||||||
    </data>
 | 
					 | 
				
			||||||
</tryton>
 | 
					 | 
				
			||||||
							
								
								
									
										15
									
								
								locale/es.po
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								locale/es.po
									
									
									
									
									
								
							@@ -1,15 +0,0 @@
 | 
				
			|||||||
#
 | 
					 | 
				
			||||||
msgid ""
 | 
					 | 
				
			||||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
msgctxt "field:account.invoice,account_analytic:"
 | 
					 | 
				
			||||||
msgid "Analytic Account"
 | 
					 | 
				
			||||||
msgstr "Cuenta Analítica"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
msgctxt "field:purchase.purchase,account_analytic:"
 | 
					 | 
				
			||||||
msgid "Analytic Account"
 | 
					 | 
				
			||||||
msgstr "Cuenta Analítica"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
msgctxt "field:sale.sale,account_analytic:"
 | 
					 | 
				
			||||||
msgid "Analytic Account"
 | 
					 | 
				
			||||||
msgstr "Cuenta Analítica"
 | 
					 | 
				
			||||||
							
								
								
									
										12
									
								
								purchase.py
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								purchase.py
									
									
									
									
									
								
							@@ -10,13 +10,11 @@ class Purchase(metaclass=PoolMeta):
 | 
				
			|||||||
    'Purchase Analytic Operation'
 | 
					    'Purchase Analytic Operation'
 | 
				
			||||||
    __name__ = 'purchase.purchase'
 | 
					    __name__ = 'purchase.purchase'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    _states = {
 | 
					    account_analytic = fields.Many2One('analytic_account.account',
 | 
				
			||||||
        'readonly': Eval('state') != 'draft',
 | 
					                                       'Analytic Account', required=True,
 | 
				
			||||||
        }
 | 
					                                       domain=[
 | 
				
			||||||
 | 
					                                           ('type', '=', 'normal'),
 | 
				
			||||||
    account_analytic = fields.Many2One('analytic_account.account', 'Analytic Account', required=True,
 | 
					                                       ])
 | 
				
			||||||
                                       domain=[('type', '=', 'normal')],
 | 
					 | 
				
			||||||
                                       states=_states)
 | 
					 | 
				
			||||||
class PurchaseLine(metaclass=PoolMeta):
 | 
					class PurchaseLine(metaclass=PoolMeta):
 | 
				
			||||||
    'Purchase Line Analytic Operation'
 | 
					    'Purchase Line Analytic Operation'
 | 
				
			||||||
    __name__ =  'purchase.line'
 | 
					    __name__ =  'purchase.line'
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1
									
								
								sale.py
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								sale.py
									
									
									
									
									
								
							@@ -15,7 +15,6 @@ class Sale(metaclass=PoolMeta):
 | 
				
			|||||||
                                       domain=[
 | 
					                                       domain=[
 | 
				
			||||||
                                           ('type', '=', 'normal'),
 | 
					                                           ('type', '=', 'normal'),
 | 
				
			||||||
                                       ])
 | 
					                                       ])
 | 
				
			||||||
 | 
					 | 
				
			||||||
class SaleLine(metaclass=PoolMeta):
 | 
					class SaleLine(metaclass=PoolMeta):
 | 
				
			||||||
    'Sale Line Analytic Operation'
 | 
					    'Sale Line Analytic Operation'
 | 
				
			||||||
    __name__ =  'sale.line'
 | 
					    __name__ =  'sale.line'
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,4 +8,3 @@ depends:
 | 
				
			|||||||
xml:
 | 
					xml:
 | 
				
			||||||
    purchase.xml
 | 
					    purchase.xml
 | 
				
			||||||
    sale.xml
 | 
					    sale.xml
 | 
				
			||||||
    invoice.xml
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,10 +0,0 @@
 | 
				
			|||||||
<?xml version="1.0"?>
 | 
					 | 
				
			||||||
<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
 | 
					 | 
				
			||||||
this repository contains the full copyright notices and license terms. -->
 | 
					 | 
				
			||||||
<data>
 | 
					 | 
				
			||||||
 <xpath
 | 
					 | 
				
			||||||
     expr="/form/field[@name='reference']" position="after">
 | 
					 | 
				
			||||||
       <label name="account_analytic"/>
 | 
					 | 
				
			||||||
       <field name="account_analytic" xexpand="1"/>
 | 
					 | 
				
			||||||
  </xpath>
 | 
					 | 
				
			||||||
</data>
 | 
					 | 
				
			||||||
		Reference in New Issue
	
	Block a user