Skip to content

Commit

Permalink
Merge 12383f3 into 4a8ce0c
Browse files Browse the repository at this point in the history
  • Loading branch information
charbeljc committed Aug 17, 2015
2 parents 4a8ce0c + 12383f3 commit c59f693
Show file tree
Hide file tree
Showing 59 changed files with 398 additions and 192 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pyc
37 changes: 23 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
language: python
sudo: false
cache: pip

python:
- "2.7"

addons:
apt:
packages:
- expect-dev # provides unbuffer utility
- python-lxml # because pip installation is slow
- python-lxml # because pip installation is slow
- python-simplejson
- python-serial
- python-yaml

language: python
python:
- "2.7"

env:
global:
- VERSION="8.0" TESTS="0" LINT_CHECK="0" TRANSIFEX="0"
- TRANSIFEX_USER='transbot@odoo-community.org'

matrix:
- LINT_CHECK="1"
- TESTS="1" ODOO_REPO="odoo/odoo"
- TESTS="1" ODOO_REPO="OCA/OCB"

virtualenv:
system_site_packages: true

install:
- git clone https://github.com/OCA/maintainer-quality-tools.git $HOME/maintainer-quality-tools
- export PATH=$HOME/maintainer-quality-tools/travis:$PATH
- $HOME/maintainer-quality-tools/travis/travis_install_nightly master
- pip install coveralls flake8

services:
- postgresql
- git clone --depth=1 https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
- travis_install_nightly

script:
- travis_run_flake8
- travis_run_tests master
- travis_run_tests

after_success:
coveralls
- travis_after_tests_success
5 changes: 0 additions & 5 deletions __unported__/budget_crm/test/setup_team.yml

This file was deleted.

10 changes: 0 additions & 10 deletions __unported__/budget_crm/test/setup_user.yml

This file was deleted.

60 changes: 0 additions & 60 deletions __unported__/budget_crm/test/test_crm_to_budget.yml

This file was deleted.

30 changes: 0 additions & 30 deletions __unported__/budget_crm/test/test_update_crm_to_budget.yml

This file was deleted.

33 changes: 0 additions & 33 deletions __unported__/budget_invoice/test/test_invoice_budget_lines.yml

This file was deleted.

File renamed without changes.
12 changes: 7 additions & 5 deletions __unported__/budget/__openerp__.py → budget/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,20 @@
"account",
"analytic_multicurrency",
],
"data": ["budget_view.xml",
"data": ["security/security.xml",
"security/ir.model.access.csv",
"budget_view.xml",
"analytic_view.xml",
"security/security.xml",
"security/ir.model.access.csv"
],
"demo": [
"demo/setup_user.yml",
],
"test": [
"test/setup_user.yml",
"test/test_analytic_amount.yml",
"test/test_duplicate_budget.yml",
"test/test_default_end_date.yml",
"test/test_active_version.yml",
],
"installable": False,
"installable": True,
"application": True,
}
File renamed without changes.
8 changes: 8 additions & 0 deletions __unported__/budget/analytic.py → budget/analytic.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,11 @@ class account_analytic_account(orm.Model):
'analytic_account_id',
string='Budget Lines'),
}

def copy_data(self, cr, uid, id, default=None, context=None):
"""Remove budget lines when copying analytic account"""
if default is None:
default = {}
default.setdefault('budget_line_ids', False)
return super(account_analytic_account, self).copy_data(
cr, uid, id, default=default, context=context)
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions __unported__/budget/budget_line.py → budget/budget_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,15 +366,15 @@ def _get_applicable_cols(self):
return col_to_return

def read_group(self, cr, uid, domain, fields, groupby, offset=0,
limit=None, context=None, orderby=False):
limit=None, context=None, orderby=False, lazy=True):
""" Override in order to see useful values in group by allocation.
Compute all numerical values.
"""
res = super(budget_line, self).read_group(
cr, uid, domain, fields, groupby,
offset, limit, context, orderby
offset, limit, context, orderby, lazy
)

for result in res:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,9 @@
<field name="name">budget item allocation type list</field>
<field name="model">budget.allocation.type</field>
<field name="arch" type="xml">
<list version="7.0" string="Allocation">
<tree string="Allocation">
<field name="name"/>
</list>
</tree>
</field>
</record>

Expand All @@ -372,19 +372,22 @@

<!-- ACTION: click on Financial Management/Budgets/Budgets -->
<record model="ir.actions.act_window" id="open_budget_list">
<field name="name">Open Budget List</field>
<field name="res_model">budget.budget</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<!-- ACTION: click on Financial Management/Budgets/Budgets versions -->
<record model="ir.actions.act_window" id="open_budget_version_list">
<field name="name">Open Budget Versions</field>
<field name="res_model">budget.version</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_budget_version_list_from_menu"/>
</record>
<!-- ACTION: click on Financial Management/Budgets/Budgets lines -->
<record model="ir.actions.act_window" id="open_budget_lines_list">
<field name="name">Open Budget Lines</field>
<field name="res_model">budget.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
Expand All @@ -393,6 +396,7 @@
</record>
<!-- ACTION: click on Financial Management/Budgets/Budgets items -->
<record model="ir.actions.act_window" id="open_budget_items_list">
<field name="name">Open Budget Items</field>
<field name="res_model">budget.item</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@
!record {model: res.users, id: res_users_aurore}:
name: Aurore
login: aurore
-
I add groups to this user
-
!record {model: res.users, id: res_users_aurore}:
groups_id:
- budget.group_budget_responsible
-
I create a second user to run the tests in this module
I create a first user to run the tests in this module
-
!record {model: res.users, id: res_users_beth}:
name: Beth
login: beth
-
I add groups to this user
-
!record {model: res.users, id: res_users_beth}:
groups_id:
- budget.group_budget_responsible
- account.group_account_manager
- account.group_account_manager
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
I select for this file a user that is not admin
-
!context
uid: 'res_users_aurore'
uid: 'res_users_beth'
-
I first create a budget item
-
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,43 @@
-
!context
uid: 'res_users_beth'
-
I first create a budget item
-
!record {model: budget.item, id: budget_item_1}:
code: "BI1"
name: "Budget item 1"
account: [account.a_expense]
-
I then create a budget
-
!record {model: budget.budget, id: budget_test_1}:
name: "Budget test"
start_date: !eval "'%s-01-01' %(datetime.now().year)"
end_date: !eval "'%s-12-31' %(datetime.now().year)"
budget_item_id: budget_item_1
-
and a budget version
-
!record {model: budget.version, id: budget_version_1}:
name: "Budget Version 1"
budget_id: budget_test_1
currency_id: base.EUR
-
and a budget line
-
!record {model: budget.line, id: budget_line_1}:
analytic_account_id: account.analytic_agrolait
budget_item_id: budget_item_1
amount: -200.0
currency_id: base.EUR
budget_version_id: budget_version_1
-
The version we start with should have one line
-
!python {model: budget.version}: |
version = self.browse(cr, uid, ref('budget_version_1'), context=context)
assert len(version.budget_line_ids) == 1
-
I make it active
-
!python {model: budget.version}: |
model.make_active(cr, uid, [ref('budget_version_1')], context)
-
When I duplicate it, the new version should have no lines
-
Expand Down
File renamed without changes.
Loading

0 comments on commit c59f693

Please sign in to comment.