Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions oca_dependencies.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# list the OCA project dependencies, one per line
# add a github url if you need a forked version
project
reporting-engine
1 change: 1 addition & 0 deletions project_billing_utils/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Contributors
* Alexandre Fayolle <alexandre.fayolle@camptocamp.com>
* Vincent Renaville <vincent.renaville@camptocamp.com>
* Damien Crier <damien.crier@camptocamp.com>
* Serpent Consulting Services Pvt. Ltd. <contact@serpentcs.com>

Maintainer
----------
Expand Down
4 changes: 1 addition & 3 deletions project_billing_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,5 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from . import project
from . import models
from . import wizard
from . import invoice
from . import analytic
17 changes: 9 additions & 8 deletions project_billing_utils/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,23 @@
##############################################################################
{
'name': 'Analytic and project wizard for service companies',
'version': '8.0.1.4',
'version': '10.0.1.0.0',
'category': 'Generic Modules/Projects & Services',
'author': "Camptocamp,Odoo Community Association (OCA)",
'website': 'http://www.camptocamp.com',
'author': "Camptocamp,Odoo Community Association (OCA),"
"Serpent Consulting Services Pvt. Ltd.",
'license': 'AGPL-3',
'website': 'https://www.camptocamp.com',
'depends': ['project',
'hr_timesheet_invoice',
'project_analytic_line_view'],
'hr_timesheet'],
'data': [
'invoice_view.xml',
'project_view.xml',
'views/invoice_view.xml',
'views/project_view.xml',
'wizard/associate_aal_view.xml',
'wizard/dissociate_aal_view.xml',
'wizard/open_invoices_view.xml',
'wizard/blank_invoice_view.xml',
],
'installable': False,
'installable': True,
'auto_install': False,
'application': False,
}
13 changes: 0 additions & 13 deletions project_billing_utils/invoice_view.xml

This file was deleted.

6 changes: 6 additions & 0 deletions project_billing_utils/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import analytic
from . import invoice
from . import project
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################
"""Changes to allow the dissociate analytic lines wizard to work."""

from openerp import models, api
from odoo import models, api, fields


class AccountAnalyticLine(models.Model):
Expand All @@ -29,6 +29,8 @@ class AccountAnalyticLine(models.Model):

_inherit = 'account.analytic.line'

invoice_id = fields.Many2one("account.invoice", "Invoice")

@api.multi
def write(self, vals):
"""Put a key in the vals, since we have no context. Return super."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, api
from odoo import models, api


class AccountInvoice(models.Model):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, api, _
from openerp import exceptions
from odoo import models, api, _
from odoo import exceptions


class ProjectProject(models.Model):
Expand All @@ -36,7 +36,6 @@ def unlink(self):
# If we found line linked with account we raise an error
if account_lines:
raise exceptions.Warning(
_('Invalid Action'),
_('You cannot delete account %s as there are analytic '
'lines linked to it') % project.name)
else:
Expand Down
18 changes: 0 additions & 18 deletions project_billing_utils/project_view.xml

This file was deleted.

22 changes: 22 additions & 0 deletions project_billing_utils/views/invoice_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<odoo>

<act_window
id="act_aal_account_invoice_opened"
name="Analytic Lines"
res_model="account.analytic.line"
domain="[('invoice_id', '=', [active_id])]"
src_model="account.invoice"/>

<record id="view_account_analytic_line_project_invoice_inherit" model="ir.ui.view">
<field name="name">account.analytic.line.form.project.invoice</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="account.view_account_analytic_line_form_inherit_account"/>
<field name="arch" type="xml">
<field name="move_id" position="after">
<field name="invoice_id"/>
</field>
</field>
</record>

</odoo>
16 changes: 16 additions & 0 deletions project_billing_utils/views/project_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<odoo>

<!-- set partner_id required -->
<record id="edit_project" model="ir.ui.view">
<field name="name">project.project.form</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project.edit_project" />
<field name="arch" type="xml">
<field name="partner_id" position="attributes">
<attribute name="required">1</attribute>
</field>
</field>
</record>

</odoo>
2 changes: 1 addition & 1 deletion project_billing_utils/wizard/associate_aal.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, api, fields, _
from odoo import models, api, fields, _


class AssociateInvoice(models.TransientModel):
Expand Down
14 changes: 6 additions & 8 deletions project_billing_utils/wizard/associate_aal_view.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<odoo>

<record id="view_associate_aal_to_invoice" model="ir.ui.view">
<field name="name">Associate To Invoice</field>
<field name="model">associate.aal.to.invoice</field>
<field name="arch" type="xml">
<form string="Associate Analytic Lines" version="7.0">
<group>
<form string="Associate Analytic Lines">
<group colspan="4" col="4">
<separator string="Associate Analytic Lines to invoice ?" colspan="4"/>
<field name="invoice_id" context="{'special_search':True}" domain="[('type','in',('out_invoice','in_invoice'))]"/>
</group>
<footer>
<button special="cancel" string="_Cancel" icon="gtk-cancel" />
<button name="associate_aal" string="_Ok" type="object" icon="gtk-ok"/>
<button special="cancel" string="_Cancel" class="fa fa-times" />
<button name="associate_aal" string="_Ok" type="object" class="fa fa-check"/>
</footer>
</form>
</field>
Expand All @@ -29,5 +28,4 @@
target="new"
id="action_associate_invoice"/>

</data>
</openerp>
</odoo>
23 changes: 8 additions & 15 deletions project_billing_utils/wizard/blank_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, api, fields, _
from openerp.tools.safe_eval import safe_eval
from openerp import exceptions
from odoo import models, api, fields, _
from odoo.tools.safe_eval import safe_eval
from odoo import exceptions

import time

Expand All @@ -38,20 +38,13 @@ def _prepare_invoice(self, project):
"""
if not project.partner_id:
raise exceptions.Warning(
_('UserError'),
_('The Partner is missing on the project:\n%s') % project.name)

if not project.pricelist_id:
raise exceptions.Warning(
_('UserError'),
_('The Customer Pricelist is '
'missing on the project:\n%s') % project.name)

partner = project.partner_id

date_due = False
if partner.property_payment_term:
pterm_list = partner.property_payment_term.compute(
if partner.property_payment_term_id:
pterm_list = partner.property_payment_term_id.compute(
value=1,
date_ref=fields.Date.today())
if pterm_list:
Expand All @@ -64,9 +57,9 @@ def _prepare_invoice(self, project):
'type': 'out_invoice',
'date_due': date_due,
'partner_id': partner.id,
'payment_term': partner.property_payment_term.id or False,
'account_id': partner.property_account_receivable.id,
'currency_id': project.pricelist_id.currency_id.id,
'payment_term': partner.property_payment_term_id.id or False,
'account_id': partner.property_account_receivable_id.id,
'currency_id': project.currency_id.id,
}

@api.multi
Expand Down
10 changes: 4 additions & 6 deletions project_billing_utils/wizard/blank_invoice_view.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<odoo>

<record id="view_create_related_invoice" model="ir.ui.view">
<field name="name">Create blank invoice</field>
Expand All @@ -11,8 +10,8 @@
<separator string="Create a blank invoices ?" colspan="4"/>
</group>
<footer>
<button special="cancel" string="_Cancel" icon="gtk-cancel" />
<button name="create_invoices" string="_Ok" type="object" icon="gtk-ok"/>
<button special="cancel" string="_Cancel" class="fa fa-times"/>
<button name="create_invoices" string="_Ok" type="object" class="fa fa-check"/>
</footer>
</form>
</field>
Expand All @@ -27,5 +26,4 @@
context="{'inv_type':'out_invoice'}"
id="action_create_customer_invoice"/>

</data>
</openerp>
</odoo>
2 changes: 1 addition & 1 deletion project_billing_utils/wizard/dissociate_aal.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
##############################################################################
"""Introduce a wizard to dissociate an Analytic Line from an Invoice."""
from openerp import models, api
from odoo import models, api


class DissociateInvoice(models.TransientModel):
Expand Down
10 changes: 4 additions & 6 deletions project_billing_utils/wizard/dissociate_aal_view.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<odoo>

<record id="view_dissociate_aal_to_invoice" model="ir.ui.view">
<field name="name">Dissociate To Invoice</field>
Expand All @@ -11,8 +10,8 @@
<separator string="Dissociate Analytic Lines from invoice ?" colspan="4"/>
</group>
<footer>
<button special="cancel" string="_Cancel" icon="gtk-cancel" />
<button name="dissociate_aal" string="_Ok" type="object" icon="gtk-ok"/>
<button special="cancel" string="_Cancel" class="fa fa-times" />
<button name="dissociate_aal" string="_Ok" type="object" class="fa fa-check"/>
</footer>
</form>
</field>
Expand All @@ -28,5 +27,4 @@
target="new"
id="action_dissociate_aal_invoice"/>

</data>
</openerp>
</odoo>
4 changes: 2 additions & 2 deletions project_billing_utils/wizard/open_invoices.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, api
from openerp.tools.safe_eval import safe_eval
from odoo import models, api
from odoo.tools.safe_eval import safe_eval


class OpenInvoicesFromProject(models.TransientModel):
Expand Down
10 changes: 4 additions & 6 deletions project_billing_utils/wizard/open_invoices_view.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<odoo>

<record id="view_open_related_invoice" model="ir.ui.view">
<field name="name">Open Related Invoices</field>
Expand All @@ -11,8 +10,8 @@
<separator string="Open Related Project Invoices ?" colspan="4"/>
</group>
<footer>
<button special="cancel" string="_Cancel" icon="gtk-cancel" />
<button name="open_invoices" string="_Ok" type="object" icon="gtk-ok"/>
<button special="cancel" string="_Cancel" class="fa fa-times" />
<button name="open_invoices" string="_Ok" type="object" class="fa fa-check"/>
</footer>
</form>
</field>
Expand All @@ -37,5 +36,4 @@
id="action_open_supplier_invoice"/>

<!-- multi="True" -->
</data>
</openerp>
</odoo>