[tryton-debian-vcs] tryton-modules-analytic-purchase branch upstream updated. upstream/3.4.1-1-gecc80b9

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Thu Apr 23 16:02:42 UTC 2015


The following commit has been merged in the upstream branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-analytic-purchase.git;a=commitdiff;h=upstream/3.4.1-1-gecc80b9

commit ecc80b92edbfa617ad11c478e4d45cdbcdd3ace1
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Thu Apr 23 16:59:53 2015 +0200

    Adding upstream version 3.6.0.
    
    Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>

diff --git a/CHANGELOG b/CHANGELOG
index ce6497a..87af13c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,7 @@
-Version 3.4.1 - 2015-03-01
+Version 3.6.0 - 2015-04-20
 * Bug fixes (see mercurial logs for details)
+* Add support for PyPy
+* Use One2Many for analytic accounts
 
 Version 3.4.0 - 2014-10-20
 * Bug fixes (see mercurial logs for details)
diff --git a/PKG-INFO b/PKG-INFO
index c59ccdd..8d5fd01 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_analytic_purchase
-Version: 3.4.1
+Version: 3.6.0
 Summary: Tryton module to add analytic accounting on purchase
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: issue_tracker at tryton.org
 License: GPL-3
-Download-URL: http://downloads.tryton.org/3.4/
+Download-URL: http://downloads.tryton.org/3.6/
 Description: trytond_analytic_purchase
         =========================
         
@@ -64,5 +64,7 @@ Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Classifier: Programming Language :: Python :: Implementation :: PyPy
 Classifier: Topic :: Office/Business
 Classifier: Topic :: Office/Business :: Financial :: Accounting
diff --git a/__init__.py b/__init__.py
index ebcaece..4918734 100644
--- a/__init__.py
+++ b/__init__.py
@@ -1,5 +1,5 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# 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
 from .purchase import *
@@ -9,5 +9,5 @@ def register():
     Pool.register(
         Purchase,
         PurchaseLine,
-        Account,
+        AnalyticAccountEntry,
         module='analytic_purchase', type_='model')
diff --git a/locale/bg_BG.po b/locale/bg_BG.po
index b811beb..581fd35 100644
--- a/locale/bg_BG.po
+++ b/locale/bg_BG.po
@@ -2,10 +2,18 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
+msgctxt "error:purchase.line:"
+msgid "Some mandatory root account are missing on \"%(name)s\""
+msgstr ""
+
 msgctxt "error:purchase.purchase:"
-msgid "Analytic account is required on line \"%s\"."
+msgid "Analytic account is required for \"%(roots)s\" on line \"%(line)s\"."
 msgstr ""
 
 msgctxt "field:purchase.line,analytic_accounts:"
 msgid "Analytic Accounts"
 msgstr "Аналитични сметки"
+
+msgctxt "field:purchase.line,analytic_accounts_size:"
+msgid "Analytic Accounts Size"
+msgstr ""
diff --git a/locale/ca_ES.po b/locale/ca_ES.po
index c012aab..38f22b7 100644
--- a/locale/ca_ES.po
+++ b/locale/ca_ES.po
@@ -2,10 +2,18 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
+msgctxt "error:purchase.line:"
+msgid "Some mandatory root account are missing on \"%(name)s\""
+msgstr "Falten alguns comptes analítics obligatoris a \"%(name)s\"."
+
 msgctxt "error:purchase.purchase:"
-msgid "Analytic account is required on line \"%s\"."
-msgstr "El compte analític a la línia \"%s\" és obligatori."
+msgid "Analytic account is required for \"%(roots)s\" on line \"%(line)s\"."
+msgstr "El compte analític de \"%(roots)s\" és obligatori a la línia \"%(line)s\"."
 
 msgctxt "field:purchase.line,analytic_accounts:"
 msgid "Analytic Accounts"
 msgstr "Comptes analítics"
+
+msgctxt "field:purchase.line,analytic_accounts_size:"
+msgid "Analytic Accounts Size"
+msgstr "Mida dels comptes analítics"
diff --git a/locale/cs_CZ.po b/locale/cs_CZ.po
index 2f65fc6..76fa821 100644
--- a/locale/cs_CZ.po
+++ b/locale/cs_CZ.po
@@ -2,10 +2,18 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
+msgctxt "error:purchase.line:"
+msgid "Some mandatory root account are missing on \"%(name)s\""
+msgstr ""
+
 msgctxt "error:purchase.purchase:"
-msgid "Analytic account is required on line \"%s\"."
+msgid "Analytic account is required for \"%(roots)s\" on line \"%(line)s\"."
 msgstr ""
 
 msgctxt "field:purchase.line,analytic_accounts:"
 msgid "Analytic Accounts"
 msgstr ""
+
+msgctxt "field:purchase.line,analytic_accounts_size:"
+msgid "Analytic Accounts Size"
+msgstr ""
diff --git a/locale/de_DE.po b/locale/de_DE.po
index 35a90c3..c61e928 100644
--- a/locale/de_DE.po
+++ b/locale/de_DE.po
@@ -2,10 +2,18 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
+msgctxt "error:purchase.line:"
+msgid "Some mandatory root account are missing on \"%(name)s\""
+msgstr "Erforderliches Wurzelkonto für \"%(name)s\" fehlt"
+
 msgctxt "error:purchase.purchase:"
-msgid "Analytic account is required on line \"%s\"."
-msgstr "Kostenstelle ist erforderlich auf Zeile \"%s\"."
+msgid "Analytic account is required for \"%(roots)s\" on line \"%(line)s\"."
+msgstr "Kostenstelle ist erforderlich \"%(roots)s\" für Zeile \"%(line)s\""
 
 msgctxt "field:purchase.line,analytic_accounts:"
 msgid "Analytic Accounts"
 msgstr "Kostenstellen"
+
+msgctxt "field:purchase.line,analytic_accounts_size:"
+msgid "Analytic Accounts Size"
+msgstr "Kostenstellengröße"
diff --git a/locale/es_AR.po b/locale/es_AR.po
index f3b5cb0..579e1af 100644
--- a/locale/es_AR.po
+++ b/locale/es_AR.po
@@ -2,9 +2,14 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
+msgctxt "error:purchase.line:"
+msgid "Some mandatory root account are missing on \"%(name)s\""
+msgstr "Falta una cuenta root obligatoria en «%(name)s»"
+
 msgctxt "error:purchase.purchase:"
-msgid "Analytic account is required on line \"%s\"."
-msgstr "Se requiere la cuenta analítica en la línea «%s»."
+msgid "Analytic account is required for \"%(roots)s\" on line \"%(line)s\"."
+msgstr ""
+"Se requiere la cuenta analítica para «%(roots)s» en la línea «%(line)s»."
 
 msgctxt "field:analytic_account.account,active:"
 msgid "Active"
@@ -12,7 +17,7 @@ msgstr "Activa"
 
 msgctxt "field:analytic_account.account,balance:"
 msgid "Balance"
-msgstr "Balance"
+msgstr "Saldo"
 
 msgctxt "field:analytic_account.account,childs:"
 msgid "Children"
@@ -36,7 +41,7 @@ msgstr "Moneda"
 
 msgctxt "field:analytic_account.account,currency_digits:"
 msgid "Currency Digits"
-msgstr "Dígitos de moneda"
+msgstr "Decimales de moneda"
 
 msgctxt "field:analytic_account.account,debit:"
 msgid "Debit"
@@ -44,7 +49,7 @@ msgstr "Debe"
 
 msgctxt "field:analytic_account.account,display_balance:"
 msgid "Display Balance"
-msgstr "Mostrar balance"
+msgstr "Mostrar saldo"
 
 msgctxt "field:analytic_account.account,mandatory:"
 msgid "Mandatory"
@@ -86,6 +91,10 @@ msgctxt "field:purchase.line,analytic_accounts:"
 msgid "Analytic Accounts"
 msgstr "Cuentas analíticas"
 
+msgctxt "field:purchase.line,analytic_accounts_size:"
+msgid "Analytic Accounts Size"
+msgstr "Tamaño de cuentas analíticas"
+
 msgctxt "field:purchase.line,description:"
 msgid "Description"
 msgstr "Descripción"
@@ -152,7 +161,7 @@ msgstr "Unidad"
 
 msgctxt "field:purchase.line,unit_digits:"
 msgid "Unit Digits"
-msgstr "Dígitos de unidad"
+msgstr "Decimales de unidad"
 
 msgctxt "field:purchase.line,unit_price:"
 msgid "Unit Price"
@@ -172,7 +181,7 @@ msgstr "Moneda"
 
 msgctxt "field:purchase.purchase,currency_digits:"
 msgid "Currency Digits"
-msgstr "Dígitos de moneda"
+msgstr "Decimales de moneda"
 
 msgctxt "field:purchase.purchase,description:"
 msgid "Description"
@@ -256,7 +265,7 @@ msgstr "Base imponible"
 
 msgctxt "field:purchase.purchase,warehouse:"
 msgid "Warehouse"
-msgstr "Depósito"
+msgstr "Almacén"
 
 msgctxt "model:analytic_account.account,name:"
 msgid "Analytic Account"
@@ -280,7 +289,7 @@ msgstr "Debe - Haber"
 
 msgctxt "selection:analytic_account.account,state:"
 msgid "Closed"
-msgstr "Cerrado"
+msgstr "Cerrada"
 
 msgctxt "selection:analytic_account.account,state:"
 msgid "Draft"
diff --git a/locale/es_CO.po b/locale/es_CO.po
index e7e713b..4e8ef2c 100644
--- a/locale/es_CO.po
+++ b/locale/es_CO.po
@@ -2,9 +2,13 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
+msgctxt "error:purchase.line:"
+msgid "Some mandatory root account are missing on \"%(name)s\""
+msgstr "Alguna cuenta raíz obligatoria falta en \"%(name)s\""
+
 msgctxt "error:purchase.purchase:"
-msgid "Analytic account is required on line \"%s\"."
-msgstr "Cuenta analítica es requerida en la línea \"%s\"."
+msgid "Analytic account is required for \"%(roots)s\" on line \"%(line)s\"."
+msgstr ""
 
 msgctxt "field:analytic_account.account,active:"
 msgid "Active"
@@ -86,6 +90,11 @@ msgctxt "field:purchase.line,analytic_accounts:"
 msgid "Analytic Accounts"
 msgstr "Cuentas Analíticas"
 
+#, fuzzy
+msgctxt "field:purchase.line,analytic_accounts_size:"
+msgid "Analytic Accounts Size"
+msgstr "Tamaño de Centro de Costos"
+
 msgctxt "field:purchase.line,description:"
 msgid "Description"
 msgstr "Descripción"
diff --git a/locale/es_EC.po b/locale/es_EC.po
index 9ae336d..b01946e 100644
--- a/locale/es_EC.po
+++ b/locale/es_EC.po
@@ -2,10 +2,374 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
+msgctxt "error:purchase.line:"
+msgid "Some mandatory root account are missing on \"%(name)s\""
+msgstr "Faltan algunas cuentas raíz obligatorias en \"%(name)s\""
+
 msgctxt "error:purchase.purchase:"
-msgid "Analytic account is required on line \"%s\"."
-msgstr "Se requiere la cuenta analítica en la línea \"%s\"."
+msgid "Analytic account is required for \"%(roots)s\" on line \"%(line)s\"."
+msgstr "Se requiere la cuenta analítica para \"%(roots)s\" en la línea \"%(line)s\"."
+
+msgctxt "field:analytic_account.account,active:"
+msgid "Active"
+msgstr "Activa"
+
+msgctxt "field:analytic_account.account,balance:"
+msgid "Balance"
+msgstr "Balance"
+
+msgctxt "field:analytic_account.account,childs:"
+msgid "Children"
+msgstr "Hijos"
+
+msgctxt "field:analytic_account.account,code:"
+msgid "Code"
+msgstr "Código"
+
+msgctxt "field:analytic_account.account,company:"
+msgid "Company"
+msgstr "Empresa"
+
+msgctxt "field:analytic_account.account,credit:"
+msgid "Credit"
+msgstr "Crédito"
+
+msgctxt "field:analytic_account.account,currency:"
+msgid "Currency"
+msgstr "Moneda"
+
+msgctxt "field:analytic_account.account,currency_digits:"
+msgid "Currency Digits"
+msgstr "Decimales de moneda"
+
+msgctxt "field:analytic_account.account,debit:"
+msgid "Debit"
+msgstr "Débito"
+
+msgctxt "field:analytic_account.account,display_balance:"
+msgid "Display Balance"
+msgstr "Mostrar balance"
+
+msgctxt "field:analytic_account.account,mandatory:"
+msgid "Mandatory"
+msgstr "Obligatorio"
+
+msgctxt "field:analytic_account.account,name:"
+msgid "Name"
+msgstr "Nombre"
+
+msgctxt "field:analytic_account.account,note:"
+msgid "Note"
+msgstr "Nota"
+
+msgctxt "field:analytic_account.account,parent:"
+msgid "Parent"
+msgstr "Padre"
+
+msgctxt "field:analytic_account.account,rec_name:"
+msgid "Name"
+msgstr "Nombre"
+
+msgctxt "field:analytic_account.account,root:"
+msgid "Root"
+msgstr "Raíz"
+
+msgctxt "field:analytic_account.account,state:"
+msgid "State"
+msgstr "Estado"
+
+msgctxt "field:analytic_account.account,type:"
+msgid "Type"
+msgstr "Tipo"
+
+msgctxt "field:purchase.line,amount:"
+msgid "Amount"
+msgstr "Importe"
 
 msgctxt "field:purchase.line,analytic_accounts:"
 msgid "Analytic Accounts"
-msgstr "Cuentas Analíticas"
+msgstr "Cuentas analíticas"
+
+msgctxt "field:purchase.line,analytic_accounts_size:"
+msgid "Analytic Accounts Size"
+msgstr "Tamaño de cuentas analíticas"
+
+msgctxt "field:purchase.line,description:"
+msgid "Description"
+msgstr "Descripción"
+
+msgctxt "field:purchase.line,invoice_lines:"
+msgid "Invoice Lines"
+msgstr "Líneas de factura"
+
+msgctxt "field:purchase.line,move_done:"
+msgid "Moves Done"
+msgstr "Movimientos realizados"
+
+msgctxt "field:purchase.line,move_exception:"
+msgid "Moves Exception"
+msgstr "Exepción de movimientos"
+
+msgctxt "field:purchase.line,moves:"
+msgid "Moves"
+msgstr "Movimientos"
+
+msgctxt "field:purchase.line,moves_ignored:"
+msgid "Ignored Moves"
+msgstr "Movimientos ignorados"
+
+msgctxt "field:purchase.line,moves_recreated:"
+msgid "Recreated Moves"
+msgstr "Movimientos recreados"
+
+msgctxt "field:purchase.line,note:"
+msgid "Note"
+msgstr "Nota"
+
+msgctxt "field:purchase.line,product:"
+msgid "Product"
+msgstr "Producto"
+
+msgctxt "field:purchase.line,purchase:"
+msgid "Purchase"
+msgstr "Compra"
+
+msgctxt "field:purchase.line,quantity:"
+msgid "Quantity"
+msgstr "Cantidad"
+
+msgctxt "field:purchase.line,rec_name:"
+msgid "Name"
+msgstr "Nombre"
+
+msgctxt "field:purchase.line,sequence:"
+msgid "Sequence"
+msgstr "Secuencia"
+
+msgctxt "field:purchase.line,taxes:"
+msgid "Taxes"
+msgstr "Impuestos"
+
+msgctxt "field:purchase.line,type:"
+msgid "Type"
+msgstr "Tipo"
+
+msgctxt "field:purchase.line,unit:"
+msgid "Unit"
+msgstr "Unidad"
+
+msgctxt "field:purchase.line,unit_digits:"
+msgid "Unit Digits"
+msgstr "Decimales de unidad"
+
+msgctxt "field:purchase.line,unit_price:"
+msgid "Unit Price"
+msgstr "Precio unitario"
+
+msgctxt "field:purchase.purchase,comment:"
+msgid "Comment"
+msgstr "Comentario"
+
+msgctxt "field:purchase.purchase,company:"
+msgid "Company"
+msgstr "Empresa"
+
+msgctxt "field:purchase.purchase,currency:"
+msgid "Currency"
+msgstr "Moneda"
+
+msgctxt "field:purchase.purchase,currency_digits:"
+msgid "Currency Digits"
+msgstr "Decimales de moneda"
+
+msgctxt "field:purchase.purchase,description:"
+msgid "Description"
+msgstr "Descripción"
+
+msgctxt "field:purchase.purchase,invoice_address:"
+msgid "Invoice Address"
+msgstr "Dirección de facturación"
+
+msgctxt "field:purchase.purchase,invoice_method:"
+msgid "Invoice Method"
+msgstr "Método de facturación"
+
+msgctxt "field:purchase.purchase,invoice_state:"
+msgid "Invoice State"
+msgstr "Estado de factura"
+
+msgctxt "field:purchase.purchase,invoices:"
+msgid "Invoices"
+msgstr "Facturas"
+
+msgctxt "field:purchase.purchase,invoices_ignored:"
+msgid "Ignored Invoices"
+msgstr "Facturas ignoradas"
+
+msgctxt "field:purchase.purchase,invoices_recreated:"
+msgid "Recreated Invoices"
+msgstr "Facturas recreadas"
+
+msgctxt "field:purchase.purchase,lines:"
+msgid "Lines"
+msgstr "Líneas"
+
+msgctxt "field:purchase.purchase,moves:"
+msgid "Moves"
+msgstr "Movimientos"
+
+msgctxt "field:purchase.purchase,party:"
+msgid "Party"
+msgstr "Tercero"
+
+msgctxt "field:purchase.purchase,party_lang:"
+msgid "Party Language"
+msgstr "Idioma del tercero"
+
+msgctxt "field:purchase.purchase,payment_term:"
+msgid "Payment Term"
+msgstr "Término de pago"
+
+msgctxt "field:purchase.purchase,purchase_date:"
+msgid "Purchase Date"
+msgstr "Fecha de compra"
+
+msgctxt "field:purchase.purchase,rec_name:"
+msgid "Name"
+msgstr "Nombre"
+
+msgctxt "field:purchase.purchase,reference:"
+msgid "Reference"
+msgstr "Referencia"
+
+msgctxt "field:purchase.purchase,state:"
+msgid "State"
+msgstr "Estado"
+
+msgctxt "field:purchase.purchase,supplier_reference:"
+msgid "Supplier Reference"
+msgstr "Referencia del proveedor"
+
+msgctxt "field:purchase.purchase,tax_amount:"
+msgid "Tax"
+msgstr "Impuesto"
+
+msgctxt "field:purchase.purchase,total_amount:"
+msgid "Total"
+msgstr "Total"
+
+msgctxt "field:purchase.purchase,untaxed_amount:"
+msgid "Untaxed"
+msgstr "Base"
+
+msgctxt "field:purchase.purchase,warehouse:"
+msgid "Warehouse"
+msgstr "Depósito"
+
+msgctxt "model:analytic_account.account,name:"
+msgid "Analytic Account"
+msgstr "Cuenta analítica"
+
+msgctxt "model:purchase.line,name:"
+msgid "Purchase Line"
+msgstr "Línea de compra"
+
+msgctxt "model:purchase.purchase,name:"
+msgid "Purchase"
+msgstr "Compra"
+
+msgctxt "selection:analytic_account.account,display_balance:"
+msgid "Credit - Debit"
+msgstr "Crédito - Débito"
+
+msgctxt "selection:analytic_account.account,display_balance:"
+msgid "Debit - Credit"
+msgstr "Débito - Crédito"
+
+msgctxt "selection:analytic_account.account,state:"
+msgid "Closed"
+msgstr "Cerrada"
+
+msgctxt "selection:analytic_account.account,state:"
+msgid "Draft"
+msgstr "Borrador"
+
+msgctxt "selection:analytic_account.account,state:"
+msgid "Opened"
+msgstr "Abierta"
+
+msgctxt "selection:analytic_account.account,type:"
+msgid "Normal"
+msgstr "Normal"
+
+msgctxt "selection:analytic_account.account,type:"
+msgid "Root"
+msgstr "Raíz"
+
+msgctxt "selection:analytic_account.account,type:"
+msgid "View"
+msgstr "Vista"
+
+msgctxt "selection:purchase.line,type:"
+msgid "Comment"
+msgstr "Comentario"
+
+msgctxt "selection:purchase.line,type:"
+msgid "Line"
+msgstr "Línea"
+
+msgctxt "selection:purchase.line,type:"
+msgid "Subtotal"
+msgstr "Subtotal"
+
+msgctxt "selection:purchase.line,type:"
+msgid "Title"
+msgstr "Título"
+
+msgctxt "selection:purchase.purchase,invoice_method:"
+msgid "Based On Order"
+msgstr "Basado en la orden"
+
+msgctxt "selection:purchase.purchase,invoice_method:"
+msgid "Based On Shipment"
+msgstr "Basado en el envío"
+
+msgctxt "selection:purchase.purchase,invoice_method:"
+msgid "Manual"
+msgstr "Manual"
+
+msgctxt "selection:purchase.purchase,invoice_state:"
+msgid "Exception"
+msgstr "Excepción"
+
+msgctxt "selection:purchase.purchase,invoice_state:"
+msgid "None"
+msgstr "Ninguno"
+
+msgctxt "selection:purchase.purchase,invoice_state:"
+msgid "Paid"
+msgstr "Pagada"
+
+msgctxt "selection:purchase.purchase,invoice_state:"
+msgid "Waiting"
+msgstr "En espera"
+
+msgctxt "selection:purchase.purchase,state:"
+msgid "Canceled"
+msgstr "Anulada"
+
+msgctxt "selection:purchase.purchase,state:"
+msgid "Confirmed"
+msgstr "Confirmada"
+
+msgctxt "selection:purchase.purchase,state:"
+msgid "Done"
+msgstr "Realizada"
+
+msgctxt "selection:purchase.purchase,state:"
+msgid "Draft"
+msgstr "Borrador"
+
+msgctxt "selection:purchase.purchase,state:"
+msgid "Quotation"
+msgstr "Cotización"
diff --git a/locale/es_ES.po b/locale/es_ES.po
index f299d41..a6ecdb8 100644
--- a/locale/es_ES.po
+++ b/locale/es_ES.po
@@ -2,9 +2,13 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
+msgctxt "error:purchase.line:"
+msgid "Some mandatory root account are missing on \"%(name)s\""
+msgstr "Faltan algunas cuentas analíticas obligatorias en \"%(name)s\"."
+
 msgctxt "error:purchase.purchase:"
-msgid "Analytic account is required on line \"%s\"."
-msgstr "Se requiere la cuenta analítica en la línea \"%s\"."
+msgid "Analytic account is required for \"%(roots)s\" on line \"%(line)s\"."
+msgstr "La cuenta analítica de \"%(root)s\" es obligatoria en la línea \"%(line)s\"."
 
 msgctxt "field:analytic_account.account,active:"
 msgid "Active"
@@ -86,6 +90,10 @@ msgctxt "field:purchase.line,analytic_accounts:"
 msgid "Analytic Accounts"
 msgstr "Cuentas analíticas"
 
+msgctxt "field:purchase.line,analytic_accounts_size:"
+msgid "Analytic Accounts Size"
+msgstr "Tamaño de cuentas analíticas"
+
 msgctxt "field:purchase.line,description:"
 msgid "Description"
 msgstr "Descripción"
@@ -96,7 +104,7 @@ msgstr "Líneas de factura"
 
 msgctxt "field:purchase.line,move_done:"
 msgid "Moves Done"
-msgstr "Movimientos realizados"
+msgstr "Movimientos finalizados"
 
 msgctxt "field:purchase.line,move_exception:"
 msgid "Moves Exception"
@@ -356,7 +364,7 @@ msgstr "Confirmada"
 
 msgctxt "selection:purchase.purchase,state:"
 msgid "Done"
-msgstr "Realizada"
+msgstr "Finalizada"
 
 msgctxt "selection:purchase.purchase,state:"
 msgid "Draft"
diff --git a/locale/fr_FR.po b/locale/fr_FR.po
index 71747e6..1dedfc8 100644
--- a/locale/fr_FR.po
+++ b/locale/fr_FR.po
@@ -2,10 +2,19 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
+msgctxt "error:purchase.line:"
+msgid "Some mandatory root account are missing on \"%(name)s\""
+msgstr "Certains comptes racines obligatoires manquent sur « %(name)s »"
+
 msgctxt "error:purchase.purchase:"
-msgid "Analytic account is required on line \"%s\"."
-msgstr "Le compte analytique est requis sur la ligne « %s »."
+msgid "Analytic account is required for \"%(roots)s\" on line \"%(line)s\"."
+msgstr ""
+"Un compte analytique est requis pour « %(root)s » sur la ligne « %(line)s »."
 
 msgctxt "field:purchase.line,analytic_accounts:"
 msgid "Analytic Accounts"
 msgstr "Comptes analytiques"
+
+msgctxt "field:purchase.line,analytic_accounts_size:"
+msgid "Analytic Accounts Size"
+msgstr "Taille des comptes analytiques"
diff --git a/locale/nl_NL.po b/locale/nl_NL.po
index 2f65fc6..76fa821 100644
--- a/locale/nl_NL.po
+++ b/locale/nl_NL.po
@@ -2,10 +2,18 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
+msgctxt "error:purchase.line:"
+msgid "Some mandatory root account are missing on \"%(name)s\""
+msgstr ""
+
 msgctxt "error:purchase.purchase:"
-msgid "Analytic account is required on line \"%s\"."
+msgid "Analytic account is required for \"%(roots)s\" on line \"%(line)s\"."
 msgstr ""
 
 msgctxt "field:purchase.line,analytic_accounts:"
 msgid "Analytic Accounts"
 msgstr ""
+
+msgctxt "field:purchase.line,analytic_accounts_size:"
+msgid "Analytic Accounts Size"
+msgstr ""
diff --git a/locale/ru_RU.po b/locale/ru_RU.po
index 105bb4d..d123138 100644
--- a/locale/ru_RU.po
+++ b/locale/ru_RU.po
@@ -2,10 +2,18 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
+msgctxt "error:purchase.line:"
+msgid "Some mandatory root account are missing on \"%(name)s\""
+msgstr ""
+
 msgctxt "error:purchase.purchase:"
-msgid "Analytic account is required on line \"%s\"."
-msgstr "Счет аналитики необходим для строки \"%s\"."
+msgid "Analytic account is required for \"%(roots)s\" on line \"%(line)s\"."
+msgstr ""
 
 msgctxt "field:purchase.line,analytic_accounts:"
 msgid "Analytic Accounts"
 msgstr "Счета аналитики"
+
+msgctxt "field:purchase.line,analytic_accounts_size:"
+msgid "Analytic Accounts Size"
+msgstr ""
diff --git a/locale/sl_SI.po b/locale/sl_SI.po
index f63eff5..8d63dba 100644
--- a/locale/sl_SI.po
+++ b/locale/sl_SI.po
@@ -2,10 +2,18 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
+msgctxt "error:purchase.line:"
+msgid "Some mandatory root account are missing on \"%(name)s\""
+msgstr "Pri \"%(name)s\" manjkajo nekateri korenski konti."
+
 msgctxt "error:purchase.purchase:"
-msgid "Analytic account is required on line \"%s\"."
-msgstr "Na postavki \"%s\" je obvezen analitični konto."
+msgid "Analytic account is required for \"%(roots)s\" on line \"%(line)s\"."
+msgstr "Analitični konto je obvezen za \"%(roots)s\" na postavki \"%(line)s\"."
 
 msgctxt "field:purchase.line,analytic_accounts:"
 msgid "Analytic Accounts"
 msgstr "Analitični konti"
+
+msgctxt "field:purchase.line,analytic_accounts_size:"
+msgid "Analytic Accounts Size"
+msgstr "Število analitičnih kontov"
diff --git a/purchase.py b/purchase.py
index eed89e9..99c75cb 100644
--- a/purchase.py
+++ b/purchase.py
@@ -1,12 +1,11 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# 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.model import fields
-from trytond.pyson import Eval
-from trytond.transaction import Transaction
 from trytond.pool import Pool, PoolMeta
-from trytond.exceptions import UserError
 
-__all__ = ['Purchase', 'PurchaseLine', 'Account']
+from trytond.modules.analytic_account import AnalyticMixin
+
+__all__ = ['Purchase', 'PurchaseLine', 'AnalyticAccountEntry']
 __metaclass__ = PoolMeta
 
 
@@ -18,240 +17,65 @@ class Purchase:
         super(Purchase, cls).__setup__()
         cls._error_messages.update({
                 'analytic_account_required': ('Analytic account is required '
-                    'on line "%s".'),
+                    'for "%(roots)s" on line "%(line)s".'),
                 })
 
     def check_for_quotation(self):
-        AccountSelection = Pool().get('analytic_account.account.selection')
+        pool = Pool()
+        Account = pool.get('analytic_account.account')
+        mandatory_roots = {a for a in Account.search([
+                ('type', '=', 'root'),
+                ('mandatory', '=', True),
+                ])}
 
         super(Purchase, self).check_for_quotation()
 
-        try:
-            AccountSelection.check_root(
-                [x.analytic_accounts for x in self.lines
-                    if x.analytic_accounts])
-        except UserError:
-            for line in self.lines:
-                if line.type != 'line':
-                    continue
-                try:
-                    AccountSelection.check_root([line.analytic_accounts])
-                except UserError:
-                    self.raise_user_error('analytic_account_required',
-                            (line.rec_name,))
-            raise
+        for line in self.lines:
+            if line.type != 'line':
+                continue
+            analytic_roots = {e.root for e in line.analytic_accounts
+                if e.account}
+            if not mandatory_roots <= analytic_roots:
+                self.raise_user_error('analytic_account_required', {
+                        'line': line.rec_name,
+                        'roots': ', '.join(x.rec_name
+                            for x in mandatory_roots - analytic_roots),
+                        })
 
 
-class PurchaseLine:
+class PurchaseLine(AnalyticMixin):
     __name__ = 'purchase.line'
-    analytic_accounts = fields.Many2One('analytic_account.account.selection',
-        'Analytic Accounts',
-        states={
-            'invisible': Eval('type') != 'line',
-            }, depends=['type'])
-
-    @classmethod
-    def _view_look_dom_arch(cls, tree, type, field_children=None):
-        AnalyticAccount = Pool().get('analytic_account.account')
-        AnalyticAccount.convert_view(tree)
-        arch, fields = super(PurchaseLine, cls)._view_look_dom_arch(tree,
-            type, field_children=field_children)
-        return arch, fields
-
-    @classmethod
-    def fields_get(cls, fields_names=None):
-        AnalyticAccount = Pool().get('analytic_account.account')
-
-        res = super(PurchaseLine, cls).fields_get(fields_names)
-
-        analytic_accounts_field = super(PurchaseLine, cls).fields_get(
-                ['analytic_accounts'])['analytic_accounts']
-
-        res.update(AnalyticAccount.analytic_accounts_fields_get(
-                analytic_accounts_field, fields_names,
-                states=cls.analytic_accounts.states,
-                required_states=Eval('type') == 'line'))
-        return res
-
-    @classmethod
-    def default_get(cls, fields, with_rec_name=True):
-        fields = [x for x in fields if not x.startswith('analytic_account_')]
-        return super(PurchaseLine, cls).default_get(fields,
-            with_rec_name=with_rec_name)
-
-    @classmethod
-    def read(cls, ids, fields_names=None):
-        if fields_names:
-            fields_names2 = [x for x in fields_names
-                    if not x.startswith('analytic_account_')]
-        else:
-            fields_names2 = fields_names
-
-        res = super(PurchaseLine, cls).read(ids, fields_names=fields_names2)
-
-        if not fields_names:
-            fields_names = cls._fields.keys()
-
-        root_ids = []
-        for field in fields_names:
-            if field.startswith('analytic_account_') and '.' not in field:
-                root_ids.append(int(field[len('analytic_account_'):]))
-        if root_ids:
-            id2record = {}
-            for record in res:
-                id2record[record['id']] = record
-            lines = cls.browse(ids)
-            for line in lines:
-                for root_id in root_ids:
-                    id2record[line.id]['analytic_account_'
-                        + str(root_id)] = None
-                if line.type != 'line':
-                    continue
-                if not line.analytic_accounts:
-                    continue
-                for account in line.analytic_accounts.accounts:
-                    if account.root.id in root_ids:
-                        id2record[line.id]['analytic_account_'
-                            + str(account.root.id)] = account.id
-                        for field in fields_names:
-                            if field.startswith('analytic_account_'
-                                    + str(account.root.id) + '.'):
-                                ham, field2 = field.split('.', 1)
-                                id2record[line.id][field] = account[field2]
-        return res
-
-    @classmethod
-    def create(cls, vlist):
-        Selection = Pool().get('analytic_account.account.selection')
-        vlist = [x.copy() for x in vlist]
-        for vals in vlist:
-            selection_vals = {}
-            for field in vals.keys():
-                if field.startswith('analytic_account_'):
-                    if vals[field]:
-                        selection_vals.setdefault('accounts', [])
-                        selection_vals['accounts'].append(('add',
-                                [vals[field]]))
-                    del vals[field]
-            if vals.get('analytic_accounts'):
-                Selection.write([Selection(vals['analytic_accounts'])],
-                    selection_vals)
-            elif vals.get('type', 'line') == 'line':
-                selection, = Selection.create([selection_vals])
-                vals['analytic_accounts'] = selection.id
-        return super(PurchaseLine, cls).create(vlist)
-
-    @classmethod
-    def write(cls, *args):
-        Selection = Pool().get('analytic_account.account.selection')
-
-        actions = iter(args)
-        args = []
-        for lines, values in zip(actions, actions):
-            values = values.copy()
-            selection_vals = {}
-            for field, value in values.items():
-                if field.startswith('analytic_account_'):
-                    root_id = int(field[len('analytic_account_'):])
-                    selection_vals[root_id] = value
-                    del values[field]
-            if selection_vals:
-                for line in lines:
-                    if line.type != 'line':
-                        continue
-                    accounts = []
-                    if not line.analytic_accounts:
-                        # Create missing selection
-                        selection, = Selection.create([{}])
-                        cls.write([line], {
-                            'analytic_accounts': selection.id,
-                            })
-                    for account in line.analytic_accounts.accounts:
-                        if account.root.id in selection_vals:
-                            value = selection_vals[account.root.id]
-                            if value:
-                                accounts.append(value)
-                        else:
-                            accounts.append(account.id)
-                    for account_id in selection_vals.values():
-                        if account_id \
-                                and account_id not in accounts:
-                            accounts.append(account_id)
-                    to_remove = list(
-                        set((a.id for a in line.analytic_accounts.accounts))
-                        - set(accounts))
-                    Selection.write([line.analytic_accounts], {
-                            'accounts': [
-                                ('remove', to_remove),
-                                ('add', accounts),
-                                ],
-                            })
-            args.extend((lines, values))
-        return super(PurchaseLine, cls).write(*args)
-
-    @classmethod
-    def delete(cls, lines):
-        Selection = Pool().get('analytic_account.account.selection')
-
-        selections = []
-        for line in lines:
-            if line.analytic_accounts:
-                selections.append(line.analytic_accounts)
-
-        super(PurchaseLine, cls).delete(lines)
-        Selection.delete(selections)
-
-    @classmethod
-    def copy(cls, lines, default=None):
-        Selection = Pool().get('analytic_account.account.selection')
-
-        new_lines = super(PurchaseLine, cls).copy(lines, default=default)
-
-        for line in lines:
-            if line.analytic_accounts:
-                selection, = Selection.copy([line.analytic_accounts])
-                cls.write([line], {
-                    'analytic_accounts': selection.id,
-                    })
-        return new_lines
 
     def get_invoice_line(self, invoice_type):
-        AccountSelection = Pool().get('analytic_account.account.selection')
+        pool = Pool()
+        AnalyticAccountEntry = pool.get('analytic.account.entry')
 
         invoice_lines = super(PurchaseLine, self).get_invoice_line(
             invoice_type)
-        if not invoice_lines:
-            return invoice_lines
-
-        selection = None
-        if self.analytic_accounts:
-            selection, = AccountSelection.copy([self.analytic_accounts])
         for invoice_line in invoice_lines:
-            invoice_line.analytic_accounts = selection
+            new_entries = AnalyticAccountEntry.copy(self.analytic_accounts,
+                default={
+                    'origin': None,
+                    })
+            invoice_line.analytic_accounts = new_entries
         return invoice_lines
 
 
-class Account:
-    __name__ = 'analytic_account.account'
-
-    @classmethod
-    def delete(cls, accounts):
-        PurchaseLine = Pool().get('purchase.line')
-        super(Account, cls).delete(accounts)
-        # Restart the cache on the fields_view_get method of purchase.line
-        PurchaseLine._fields_view_get_cache.clear()
-
-    @classmethod
-    def create(cls, vlist):
-        PurchaseLine = Pool().get('purchase.line')
-        accounts = super(Account, cls).create(vlist)
-        # Restart the cache on the fields_view_get method of purchase.line
-        PurchaseLine._fields_view_get_cache.clear()
-        return accounts
+class AnalyticAccountEntry:
+    __name__ = 'analytic.account.entry'
 
     @classmethod
-    def write(cls, accounts, values, *args):
-        PurchaseLine = Pool().get('purchase.line')
-        super(Account, cls).write(accounts, values, *args)
-        # Restart the cache on the fields_view_get method of purchase.line
-        PurchaseLine._fields_view_get_cache.clear()
+    def _get_origin(cls):
+        origins = super(AnalyticAccountEntry, cls)._get_origin()
+        return origins + ['purchase.line']
+
+    @fields.depends('origin')
+    def on_change_with_required(self, name=None):
+        pool = Pool()
+        PurchaseLine = pool.get('purchase.line')
+        required = super(AnalyticAccountEntry, self).on_change_with_required(
+            name)
+        if (self.origin and isinstance(self.origin, PurchaseLine)
+                and self.origin.purchase.state in ['cancel', 'draft']):
+            return False
+        return required
diff --git a/setup.py b/setup.py
index f69fff3..b010f36 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
-#This file is part of Tryton.  The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# 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 setuptools import setup
 import re
@@ -47,6 +47,12 @@ for dep in info.get('depends', []):
         requires.append(get_require_version('trytond_%s' % dep))
 requires.append(get_require_version('trytond'))
 
+tests_require = [get_require_version('proteus')]
+dependency_links = []
+if minor_version % 2:
+    # Add development index for testing with proteus
+    dependency_links.append('https://trydevpi.tryton.org/')
+
 setup(name=name,
     version=version,
     description='Tryton module to add analytic accounting on purchase',
@@ -63,7 +69,7 @@ setup(name=name,
         ],
     package_data={
         'trytond.modules.analytic_purchase': (info.get('xml', [])
-            + ['tryton.cfg', 'view/*.xml', 'locale/*.po']),
+            + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']),
         },
     classifiers=[
         'Development Status :: 5 - Production/Stable',
@@ -85,11 +91,14 @@ setup(name=name,
         'Natural Language :: Spanish',
         'Operating System :: OS Independent',
         'Programming Language :: Python :: 2.7',
+        'Programming Language :: Python :: Implementation :: CPython',
+        'Programming Language :: Python :: Implementation :: PyPy',
         'Topic :: Office/Business',
         'Topic :: Office/Business :: Financial :: Accounting',
         ],
     license='GPL-3',
     install_requires=requires,
+    dependency_links=dependency_links,
     zip_safe=False,
     entry_points="""
     [trytond.modules]
@@ -97,4 +106,5 @@ setup(name=name,
     """,
     test_suite='tests',
     test_loader='trytond.test_loader:Loader',
+    tests_require=tests_require,
     )
diff --git a/tests/__init__.py b/tests/__init__.py
index 9d053e8..15f1d94 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -1,5 +1,5 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# 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 .test_analytic_purchase import suite
 
diff --git a/tests/scenario_analytic_purchase.rst b/tests/scenario_analytic_purchase.rst
new file mode 100644
index 0000000..3e2538a
--- /dev/null
+++ b/tests/scenario_analytic_purchase.rst
@@ -0,0 +1,195 @@
+==========================
+Analytic Purchase Scenario
+==========================
+
+Imports::
+
+    >>> import datetime
+    >>> from dateutil.relativedelta import relativedelta
+    >>> from decimal import Decimal
+    >>> from operator import attrgetter
+    >>> from proteus import config, Model, Wizard, Report
+    >>> from trytond.modules.company.tests.tools import create_company, \
+    ...     get_company
+    >>> from trytond.modules.account.tests.tools import create_fiscalyear, \
+    ...     create_chart, get_accounts
+    >>> from.trytond.modules.account_invoice.tests.tools import \
+    ...     set_fiscalyear_invoice_sequences, create_payment_term
+    >>> today = datetime.date.today()
+
+Create database::
+
+    >>> config = config.set_trytond()
+    >>> config.pool.test = True
+
+Install purchase::
+
+    >>> Module = Model.get('ir.module.module')
+    >>> analytic_purchase_module, = Module.find(
+    ...     [('name', '=', 'analytic_purchase')])
+    >>> analytic_purchase_module.click('install')
+    >>> Wizard('ir.module.module.install_upgrade').execute('upgrade')
+
+Create company::
+
+    >>> _ = create_company()
+    >>> company = get_company()
+
+Reload the context::
+
+    >>> User = Model.get('res.user')
+    >>> Group = Model.get('res.group')
+    >>> config._context = User.get_preferences(True, config.context)
+
+Create purchase user::
+
+    >>> purchase_user = User()
+    >>> purchase_user.name = 'Purchase'
+    >>> purchase_user.login = 'purchase'
+    >>> purchase_user.main_company = company
+    >>> purchase_group, = Group.find([('name', '=', 'Purchase')])
+    >>> purchase_user.groups.append(purchase_group)
+    >>> purchase_user.save()
+
+Create fiscal year::
+
+    >>> fiscalyear = set_fiscalyear_invoice_sequences(
+    ...     create_fiscalyear(company))
+    >>> fiscalyear.click('create_period')
+
+Create chart of accounts::
+
+    >>> _ = create_chart(company)
+    >>> accounts = get_accounts(company)
+    >>> revenue = accounts['revenue']
+    >>> expense = accounts['expense']
+
+Create analytic accounts::
+
+    >>> AnalyticAccount = Model.get('analytic_account.account')
+    >>> root = AnalyticAccount(type='root', name='Root')
+    >>> root.save()
+    >>> analytic_account = AnalyticAccount(root=root, parent=root,
+    ...     name='Analytic')
+    >>> analytic_account.save()
+    >>> mandatory_root = AnalyticAccount(type='root', name='Root',
+    ...     mandatory=True)
+    >>> mandatory_root.save()
+    >>> mandatory_analytic_account = AnalyticAccount(root=mandatory_root,
+    ...     parent=mandatory_root, name='Mandatory Analytic')
+    >>> mandatory_analytic_account.save()
+
+Create parties::
+
+    >>> Party = Model.get('party.party')
+    >>> supplier = Party(name='Supplier')
+    >>> supplier.save()
+
+Create product::
+
+    >>> ProductUom = Model.get('product.uom')
+    >>> unit, = ProductUom.find([('name', '=', 'Unit')])
+    >>> ProductTemplate = Model.get('product.template')
+    >>> Product = Model.get('product.product')
+    >>> product = Product()
+    >>> template = ProductTemplate()
+    >>> template.name = 'product'
+    >>> template.default_uom = unit
+    >>> template.type = 'goods'
+    >>> template.purchasable = True
+    >>> template.list_price = Decimal('10')
+    >>> template.cost_price = Decimal('5')
+    >>> template.cost_price_method = 'fixed'
+    >>> template.account_expense = expense
+    >>> template.account_revenue = revenue
+    >>> template.save()
+    >>> product.template = template
+    >>> product.save()
+
+Create payment term::
+
+    >>> payment_term = create_payment_term()
+    >>> payment_term.save()
+
+Purchase with analytic accounts::
+
+    >>> config.user = purchase_user.id
+    >>> Purchase = Model.get('purchase.purchase')
+    >>> purchase = Purchase()
+    >>> purchase.party = supplier
+    >>> purchase.payment_term = payment_term
+    >>> purchase.invoice_method = 'order'
+    >>> purchase_line = purchase.lines.new()
+    >>> entry, mandatory_entry = purchase_line.analytic_accounts
+    >>> entry.root == root
+    True
+    >>> bool(entry.required)
+    False
+    >>> entry.account = analytic_account
+    >>> mandatory_entry.root == mandatory_root
+    True
+    >>> bool(mandatory_entry.required)
+    True
+    >>> purchase_line.product = product
+    >>> purchase_line.quantity = 5
+    >>> mandatory_entry.account = mandatory_analytic_account
+    >>> purchase.click('quote')
+    >>> purchase.click('confirm')
+    >>> purchase.click('process')
+
+Check invoice analytic accounts::
+
+    >>> Invoice = Model.get('account.invoice')
+    >>> invoice = Invoice(purchase.invoices[0].id)
+    >>> invoice_line, = invoice.lines
+    >>> entry, mandatory_entry = invoice_line.analytic_accounts
+    >>> entry.account == analytic_account
+    True
+    >>> mandatory_entry.account == mandatory_analytic_account
+    True
+
+Purchase with an empty analytic account::
+
+    >>> config.user = purchase_user.id
+    >>> Purchase = Model.get('purchase.purchase')
+    >>> purchase = Purchase()
+    >>> purchase.party = supplier
+    >>> purchase.payment_term = payment_term
+    >>> purchase.invoice_method = 'order'
+    >>> purchase_line = purchase.lines.new()
+    >>> entry, mandatory_entry = purchase_line.analytic_accounts
+    >>> mandatory_entry.account = mandatory_analytic_account
+    >>> purchase_line.product = product
+    >>> purchase_line.quantity = 5
+    >>> purchase.click('quote')
+    >>> purchase.click('confirm')
+    >>> purchase.click('process')
+
+Check invoice analytic accounts::
+
+    >>> Invoice = Model.get('account.invoice')
+    >>> invoice = Invoice(purchase.invoices[0].id)
+    >>> invoice_line, = invoice.lines
+    >>> entry, mandatory_entry = invoice_line.analytic_accounts
+    >>> entry.account
+    >>> mandatory_entry.account == mandatory_analytic_account
+    True
+
+Analytic entries are not required until quotation::
+
+    >>> purchase = Purchase()
+    >>> purchase.party = supplier
+    >>> purchase.payment_term = payment_term
+    >>> purchase.invoice_method = 'order'
+    >>> purchase_line = purchase.lines.new()
+    >>> purchase_line.product = product
+    >>> purchase_line.quantity = 5
+    >>> purchase.save()
+    >>> purchase.click('quote')
+    Traceback (most recent call last):
+        ...
+    UserError: ('UserError', (u'Analytic account is required for "Root" on line "product".', ''))
+    >>> purchase_line, = purchase.lines
+    >>> entry, mandatory_entry = purchase_line.analytic_accounts
+    >>> mandatory_entry.account = mandatory_analytic_account
+    >>> purchase.click('quote')
diff --git a/tests/test_analytic_purchase.py b/tests/test_analytic_purchase.py
index 177f30b..e72a1b5 100644
--- a/tests/test_analytic_purchase.py
+++ b/tests/test_analytic_purchase.py
@@ -1,27 +1,22 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# This file is part of Tryton.  The COPYRIGHT file at the top level of
+# this repository contains the full copyright notices and license terms.
 import unittest
+import doctest
 import trytond.tests.test_tryton
-from trytond.tests.test_tryton import test_view, test_depends
+from trytond.tests.test_tryton import ModuleTestCase
+from trytond.tests.test_tryton import doctest_setup, doctest_teardown
 
 
-class AnalyticPurchaseTestCase(unittest.TestCase):
+class AnalyticPurchaseTestCase(ModuleTestCase):
     'Test AnalyticPurchase module'
-
-    def setUp(self):
-        trytond.tests.test_tryton.install_module('analytic_purchase')
-
-    def test0005views(self):
-        'Test views'
-        test_view('analytic_purchase')
-
-    def test0006depends(self):
-        'Test depends'
-        test_depends()
+    module = 'analytic_purchase'
 
 
 def suite():
     suite = trytond.tests.test_tryton.suite()
     suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
         AnalyticPurchaseTestCase))
+    suite.addTests(doctest.DocFileSuite('scenario_analytic_purchase.rst',
+            setUp=doctest_setup, tearDown=doctest_teardown, encoding='utf-8',
+            optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
     return suite
diff --git a/tryton.cfg b/tryton.cfg
index eba254d..36abbac 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=3.4.1
+version=3.6.0
 depends:
     analytic_account
     analytic_invoice
diff --git a/trytond_analytic_purchase.egg-info/PKG-INFO b/trytond_analytic_purchase.egg-info/PKG-INFO
index f81d91d..afcf7d4 100644
--- a/trytond_analytic_purchase.egg-info/PKG-INFO
+++ b/trytond_analytic_purchase.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond-analytic-purchase
-Version: 3.4.1
+Version: 3.6.0
 Summary: Tryton module to add analytic accounting on purchase
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: issue_tracker at tryton.org
 License: GPL-3
-Download-URL: http://downloads.tryton.org/3.4/
+Download-URL: http://downloads.tryton.org/3.6/
 Description: trytond_analytic_purchase
         =========================
         
@@ -64,5 +64,7 @@ Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Classifier: Programming Language :: Python :: Implementation :: PyPy
 Classifier: Topic :: Office/Business
 Classifier: Topic :: Office/Business :: Financial :: Accounting
diff --git a/trytond_analytic_purchase.egg-info/SOURCES.txt b/trytond_analytic_purchase.egg-info/SOURCES.txt
index 4404b39..f42d676 100644
--- a/trytond_analytic_purchase.egg-info/SOURCES.txt
+++ b/trytond_analytic_purchase.egg-info/SOURCES.txt
@@ -24,6 +24,7 @@ tryton.cfg
 ./locale/ru_RU.po
 ./locale/sl_SI.po
 ./tests/__init__.py
+./tests/scenario_analytic_purchase.rst
 ./tests/test_analytic_purchase.py
 ./view/purchase_line_form.xml
 locale/bg_BG.po
diff --git a/trytond_analytic_purchase.egg-info/requires.txt b/trytond_analytic_purchase.egg-info/requires.txt
index d23de92..3715920 100644
--- a/trytond_analytic_purchase.egg-info/requires.txt
+++ b/trytond_analytic_purchase.egg-info/requires.txt
@@ -1,4 +1,4 @@
-trytond_analytic_account >= 3.4, < 3.5
-trytond_analytic_invoice >= 3.4, < 3.5
-trytond_purchase >= 3.4, < 3.5
-trytond >= 3.4, < 3.5
\ No newline at end of file
+trytond_analytic_account >= 3.6, < 3.7
+trytond_analytic_invoice >= 3.6, < 3.7
+trytond_purchase >= 3.6, < 3.7
+trytond >= 3.6, < 3.7
\ No newline at end of file
diff --git a/view/purchase_line_form.xml b/view/purchase_line_form.xml
index 4b4ef47..fa828e5 100644
--- a/view/purchase_line_form.xml
+++ b/view/purchase_line_form.xml
@@ -2,11 +2,7 @@
 <!-- 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/notebook/page/field[@name='amount']"
-        position="after">
-        <group col="4" colspan="4" name="analytic_accounts">
-            <field name="analytic_accounts"/>
-        </group>
+    <xpath expr="/form/notebook/page/field[@name='amount']" position="after">
+        <field name="analytic_accounts" colspan="4"/>
     </xpath>
 </data>
-- 
tryton-modules-analytic-purchase



More information about the tryton-debian-vcs mailing list