Compare commits
	
		
			9 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					eab8349aee | ||
| 90f641766a | |||
| de0cf3f450 | |||
| 464e261493 | |||
| 733c8861fe | |||
| 43648e0c5c | |||
| f8d3c1b03d | |||
| 1285df0ffd | |||
| 5c38127f37 | 
@@ -1,37 +0,0 @@
 | 
				
			|||||||
# 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`
 | 
					 | 
				
			||||||
@@ -0,0 +1,7 @@
 | 
				
			|||||||
 | 
					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 purchase, sale
 | 
					from . import invoice, purchase, sale
 | 
				
			||||||
 | 
					
 | 
				
			||||||
__all__ = ['register']
 | 
					__all__ = ['register']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -13,8 +13,10 @@ def register():
 | 
				
			|||||||
        purchase.PurchaseLine,
 | 
					        purchase.PurchaseLine,
 | 
				
			||||||
        sale.Sale,
 | 
					        sale.Sale,
 | 
				
			||||||
        sale.SaleLine,
 | 
					        sale.SaleLine,
 | 
				
			||||||
        module='analytic_operation', type_='model')
 | 
					        invoice.Invoice,
 | 
				
			||||||
 | 
					        invoice.InvoiceLine,
 | 
				
			||||||
 | 
					        module='analytic_operations', type_='model')
 | 
				
			||||||
    Pool.register(
 | 
					    Pool.register(
 | 
				
			||||||
        module='analytic_operation', type_='wizard')
 | 
					        module='analytic_operations', type_='wizard')
 | 
				
			||||||
    Pool.register(
 | 
					    Pool.register(
 | 
				
			||||||
        module='analytic_operation', type_='report')
 | 
					        module='analytic_operations', type_='report')
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,10 @@
 | 
				
			|||||||
#########################
 | 
					######################
 | 
				
			||||||
Analytic Operation Module
 | 
					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.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.. toctree::
 | 
					.. toctree::
 | 
				
			||||||
   :maxdepth: 2
 | 
					   :maxdepth: 2
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										39
									
								
								invoice.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								invoice.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,39 @@
 | 
				
			|||||||
 | 
					# 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
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								invoice.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
				
			|||||||
 | 
					<?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
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								locale/es.po
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					#
 | 
				
			||||||
 | 
					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,11 +10,13 @@ class Purchase(metaclass=PoolMeta):
 | 
				
			|||||||
    'Purchase Analytic Operation'
 | 
					    'Purchase Analytic Operation'
 | 
				
			||||||
    __name__ = 'purchase.purchase'
 | 
					    __name__ = 'purchase.purchase'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    account_analytic = fields.Many2One('analytic_account.account',
 | 
					    _states = {
 | 
				
			||||||
                                       'Analytic Account', required=True,
 | 
					        'readonly': Eval('state') != 'draft',
 | 
				
			||||||
                                       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,6 +15,7 @@ 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'
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
[tryton]
 | 
					[tryton]
 | 
				
			||||||
version=6.4
 | 
					version=7.0.0
 | 
				
			||||||
depends:
 | 
					depends:
 | 
				
			||||||
    ir
 | 
					    ir
 | 
				
			||||||
    purchase
 | 
					    purchase
 | 
				
			||||||
@@ -8,3 +8,4 @@ depends:
 | 
				
			|||||||
xml:
 | 
					xml:
 | 
				
			||||||
    purchase.xml
 | 
					    purchase.xml
 | 
				
			||||||
    sale.xml
 | 
					    sale.xml
 | 
				
			||||||
 | 
					    invoice.xml
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										10
									
								
								view/invoice_form.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								view/invoice_form.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
				
			|||||||
 | 
					<?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