diff --git a/contract/README.rst b/contract/README.rst index 878fc31d..1c10286e 100644 --- a/contract/README.rst +++ b/contract/README.rst @@ -6,8 +6,13 @@ Contracts for recurrent invoicing ================================= - * This module forward-port to v9 the contracts management with recurring - invoicing functions. +This module forward-port to v9 the contracts management with recurring +invoicing functions. + +Configuration +============= + +To view discount field set *Discount on lines* in user access rights. Usage ===== @@ -17,12 +22,11 @@ To use this module, you need to: #. Go to Sales -> Contracts and select or create a new contract. #. Check *Generate recurring invoices automatically*. #. Fill fields and add new lines. You have the possibility to use markers in - in description field to show init date and end of invoiced period. -#. To view discount field set *Discount on lines* in user access rights. + the description field to show the start and end date of the invoiced period. #. A cron is created with daily interval, but if you are in debug mode can click on *Create invoices* to force this action. -#. Click *Show invoices* link to show all invoices created by the contract. -#. Press *Invoices* button to show all invoices related with the contract. +#. Click *Show recurring invoices* link to show all invoices created by the + contract. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot diff --git a/contract/i18n/es.po b/contract/i18n/es.po index 72b6c85d..5557f41c 100644 --- a/contract/i18n/es.po +++ b/contract/i18n/es.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo 9.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-03-25 23:49+0000\n" -"PO-Revision-Date: 2016-03-26 00:49+0100\n" +"POT-Creation-Date: 2016-03-28 19:26+0000\n" +"PO-Revision-Date: 2016-03-28 21:28+0100\n" "Last-Translator: Carlos Incaser \n" "Language-Team: \n" "Language: es_ES\n" @@ -49,7 +49,6 @@ msgstr "Contrato" #. module: contract #: model:ir.actions.act_window,name:contract.action_account_analytic_overdue_all -#: model:ir.model.fields,field_description:contract.field_account_invoice_analytic_account_ids #: model:ir.ui.menu,name:contract.menu_action_account_analytic_overdue_all msgid "Contracts" msgstr "Contratos" @@ -72,7 +71,7 @@ msgstr "Creado en" #. module: contract #: model:ir.model.fields,field_description:contract.field_account_analytic_account_recurring_next_date msgid "Date of Next Invoice" -msgstr "Próximo fecha de factura" +msgstr "Próxima fecha de factura" #. module: contract #: model:ir.model.fields,field_description:contract.field_account_analytic_account_date_start @@ -95,7 +94,7 @@ msgid "Discount (%)" msgstr "Descuento (%)" #. module: contract -#: code:addons/contract/models/contract.py:56 +#: code:addons/contract/models/contract.py:59 #, python-format msgid "Discount should be less or equal to 100" msgstr "El descuento debería ser menor o igual a 100" @@ -140,17 +139,10 @@ msgid "Invoice Lines" msgstr "Líneas de factura" #. module: contract -#: model:ir.actions.act_window,name:contract.act_analytic_invoices #: model:ir.actions.act_window,name:contract.act_recurring_invoices -#: model:ir.ui.view,arch_db:contract.account_analytic_account_recurring_form_form msgid "Invoices" msgstr "Facturas" -#. module: contract -#: model:ir.ui.view,arch_db:contract.account_analytic_account_recurring_form_form -msgid "Invoices related with this contract" -msgstr "Facturas relacionadas con este contrato" - #. module: contract #: model:ir.model.fields,field_description:contract.field_account_analytic_account_journal_id msgid "Journal" @@ -188,7 +180,7 @@ msgid "Next Invoice" msgstr "Próxima factura" #. module: contract -#: code:addons/contract/models/contract.py:194 +#: code:addons/contract/models/contract.py:197 #, python-format msgid "Please define a sale journal for the company '%s'." msgstr "Por favor define un diario de ventas para la compañía '%s'." @@ -260,7 +252,7 @@ msgid "Year(s)" msgstr "Año(s)" #. module: contract -#: code:addons/contract/models/contract.py:186 +#: code:addons/contract/models/contract.py:189 #, python-format msgid "You must first select a Customer for Contract %s!" msgstr "¡Seleccione un cliente para este contrato %s!" @@ -272,12 +264,11 @@ msgstr "account.analytic.invoice.line" #. module: contract #: model:ir.ui.view,arch_db:contract.account_analytic_account_recurring_form_form -msgid "⇒ Show invoices" -msgstr "⇒ Mostrar facturas" +msgid "⇒ Show recurring invoices" +msgstr "⇒ Mostrar facturas recurrentes" -#, fuzzy -#~ msgid "Recurring Invoice" -#~ msgstr "Recurring Invoice" +#~ msgid "Invoices related with this contract" +#~ msgstr "Facturas relacionadas con este contrato" #~ msgid "" #~ "Use contracts to follow tasks, issues, timesheets or invoicing based on\n" diff --git a/contract/models/contract.py b/contract/models/contract.py index 4de2182a..add71894 100644 --- a/contract/models/contract.py +++ b/contract/models/contract.py @@ -1,5 +1,8 @@ # -*- coding: utf-8 -*- # © 2016 Incaser Informatica S.L. - Carlos Dauden +# © 2015 Serv. Tecnol. Avanzados - Pedro M. Baeza +# © 2014 Domatix Technologies S.L. - Angel Moya +# © 2004-2010 OpenERP SA () # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from dateutil.relativedelta import relativedelta diff --git a/contract/models/invoice.py b/contract/models/invoice.py index 9d2dd050..f8365f06 100644 --- a/contract/models/invoice.py +++ b/contract/models/invoice.py @@ -2,7 +2,7 @@ # © 2016 Incaser Informatica S.L. - Carlos Dauden # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html -from openerp import api, fields, models +from openerp import fields, models class AccountInvoice(models.Model): @@ -11,16 +11,3 @@ class AccountInvoice(models.Model): contract_id = fields.Many2one( 'account.analytic.account', string='Contract') - analytic_account_ids = fields.Many2many( - comodel_name='account.analytic.account', - compute='_compute_analytic_account_ids', - store=True, - string='Contracts') - - @api.multi - @api.depends('invoice_line_ids.account_analytic_id') - def _compute_analytic_account_ids(self): - for invoice in self: - invoice.analytic_account_ids = invoice.mapped( - 'invoice_line_ids.account_analytic_id' - ) diff --git a/contract/views/contract.xml b/contract/views/contract.xml index 277d929e..ca5d34ff 100644 --- a/contract/views/contract.xml +++ b/contract/views/contract.xml @@ -13,28 +13,12 @@ - - {'search_default_analytic_account_ids': - [active_id], 'default_analytic_account_ids': active_id} - Invoices - account.invoice - [('analytic_account_ids','=',active_id)] - - - - account.analytic.account.invoice.recurring.form.inherit account.analytic.account - - -
@@ -46,7 +30,7 @@ groups="base.group_no_one"/>