Skip to content

Commit

Permalink
Merge de4cfe1 into 63dc370
Browse files Browse the repository at this point in the history
  • Loading branch information
charbeljc committed Jun 11, 2015
2 parents 63dc370 + de4cfe1 commit ba2a1ec
Show file tree
Hide file tree
Showing 52 changed files with 42 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pyc
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@
"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.
File renamed without changes.
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
File renamed without changes.
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 @@ -3,7 +3,7 @@
<data>

<record model="ir.ui.view" id="team_form">
<field name="inherit_id" ref="crm.crm_case_section_view_form"/>
<field name="inherit_id" ref="sales_team.crm_case_section_view_form"/>
<field name="model">crm.case.section</field>
<field name="arch" type="xml">
<notebook position="inside">
Expand Down
File renamed without changes.
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 @@ -46,10 +46,34 @@ def invoice_create(self, cr, uid, ids, product, partner, context=None):
invoice_id = invoice_obj.create(cr, uid, invoice_data, context)

for budget_line in self.browse(cr, uid, ids, context):
product_onchange_result = invoice_line_obj.product_id_change(
cr, uid, [],
product.id,
uom_id=False,
qty=0,
name=budget_line.name or u'/',
type='in_invoice',
partner_id=partner.id,
fposition_id=False,
price_unit=budget_line.amount,
currency_id=False,
context=context,
company_id=(budget_line.analytic_account_id and
budget_line.analytic_account_id.company_id.id or
None),
)
invoice_line_data = {
'product_id': product.id,
'account_id': product_onchange_result['value']['account_id'],
'name': budget_line.name or u'/',
'uos_id': product_onchange_result['value']['uos_id'],
'price_unit': budget_line.amount,
'invoice_id': invoice_id,
'invoice_line_tax_id': [
(6, 0,
product_onchange_result['value']['invoice_line_tax_id'])
],
'account_analytic_id': budget_line.analytic_account_id.id,
}
invoice_line_obj.create(cr, uid, invoice_line_data, context)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit ba2a1ec

Please sign in to comment.