7 Commits
main ... 6.4

Author SHA1 Message Date
de0cf3f450 fix: Se quita cuenta analítica en factura como requerida 2023-07-30 21:32:28 -05:00
464e261493 clean home 2023-07-25 08:06:01 -05:00
733c8861fe update READMIN 2023-07-01 01:45:00 -05:00
43648e0c5c add operation analytic to invoice 2023-07-01 01:41:46 -05:00
f8d3c1b03d add operation analytic to invoice 2023-07-01 01:40:02 -05:00
1285df0ffd correction to name module in __init__ 2023-06-26 14:29:38 -05:00
5c38127f37 add traslations 2023-06-08 15:59:20 -05:00
11 changed files with 104 additions and 49 deletions

View File

@@ -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`

View File

@@ -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.

View File

@@ -2,7 +2,7 @@
# this repository contains the full copyright notices and license terms.
from trytond.pool import Pool
from . import purchase, sale
from . import invoice, purchase, sale
__all__ = ['register']
@@ -13,8 +13,10 @@ def register():
purchase.PurchaseLine,
sale.Sale,
sale.SaleLine,
module='analytic_operation', type_='model')
invoice.Invoice,
invoice.InvoiceLine,
module='analytic_operations', type_='model')
Pool.register(
module='analytic_operation', type_='wizard')
module='analytic_operations', type_='wizard')
Pool.register(
module='analytic_operation', type_='report')
module='analytic_operations', type_='report')

View File

@@ -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::
:maxdepth: 2

39
invoice.py Normal file
View 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
View 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
View 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"

View File

@@ -10,11 +10,13 @@ class Purchase(metaclass=PoolMeta):
'Purchase Analytic Operation'
__name__ = 'purchase.purchase'
account_analytic = fields.Many2One('analytic_account.account',
'Analytic Account', required=True,
domain=[
('type', '=', 'normal'),
])
_states = {
'readonly': Eval('state') != 'draft',
}
account_analytic = fields.Many2One('analytic_account.account', 'Analytic Account', required=True,
domain=[('type', '=', 'normal')],
states=_states)
class PurchaseLine(metaclass=PoolMeta):
'Purchase Line Analytic Operation'
__name__ = 'purchase.line'

View File

@@ -15,6 +15,7 @@ class Sale(metaclass=PoolMeta):
domain=[
('type', '=', 'normal'),
])
class SaleLine(metaclass=PoolMeta):
'Sale Line Analytic Operation'
__name__ = 'sale.line'

View File

@@ -8,3 +8,4 @@ depends:
xml:
purchase.xml
sale.xml
invoice.xml

10
view/invoice_form.xml Normal file
View 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>