Skip to content

Commit

Permalink
Merge 0da835a into c5886fd
Browse files Browse the repository at this point in the history
  • Loading branch information
yvaucher committed Nov 14, 2014
2 parents c5886fd + 0da835a commit 6a002aa
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 14 deletions.
3 changes: 2 additions & 1 deletion logistic_budget/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#
#
{"name": "Logistics Budget",
"version": "0.2",
"version": "0.3",
"author": "Camptocamp",
"license": "AGPL-3",
"category": "Purchase Management",
Expand All @@ -42,6 +42,7 @@
],
"demo": [],
"data": ["view/logistic_requisition.xml",
"view/sale_order.xml",
"view/report_logistic_requisition.xml",
],
"auto_install": False,
Expand Down
1 change: 1 addition & 0 deletions logistic_budget/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
#
#
from . import logistic_requisition
from . import sale_order
47 changes: 47 additions & 0 deletions logistic_budget/model/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright 2013-2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, fields, api


class SaleOrder(models.Model):
_inherit = 'sale.order'

budget_holder_id = fields.Many2one(
'res.users',
string='Budget Holder')
date_budget_holder = fields.Datetime(
'Budget Holder Validation Date')
budget_holder_remark = fields.Text(
'Budget Holder Remark')
finance_officer_id = fields.Many2one(
'res.users',
string='Finance Officer')
date_finance_officer = fields.Datetime(
'Finance Officer Validation Date')
finance_officer_remark = fields.Text(
'Finance Officer Remark')

@api.onchange('budget_holder_id')
def onchange_set_date_budget_holder(self):
self.date_budget_holder = fields.Datetime.now()

@api.onchange('finance_officer_id')
def onchange_set_date_finance_officer(self):
self.date_finance_officer = fields.Datetime.now()
41 changes: 41 additions & 0 deletions logistic_budget/view/sale_order.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">

<record id="view_order_form" model="ir.ui.view">
<field name="name">sale.order.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//notebook" position="after">
<div class="oe_clear"/>
<group string="Validation">
<div colspan="4">
<label for="budget_holder_id"/>
<field name="budget_holder_id"/>
<label string=" validated on "
attrs="{'invisible': [('budget_holder_id', '=', False)]}" />
<field name="date_budget_holder"
attrs="{'invisible': [('budget_holder_id', '=', False)]}"
class="oe_inline"/>
<field name="budget_holder_remark"
attrs="{'invisible': [('budget_holder_id', '=', False)]}"/>
</div>
<div colspan="4">
<label for="finance_officer_id"/>
<field name="finance_officer_id"/>
<label string=" validated on "
attrs="{'invisible': [('finance_officer_id', '=', False)]}"/>
<field name="date_finance_officer"
attrs="{'invisible': [('finance_officer_id', '=', False)]}"
class="oe_inline"/>
<field name="finance_officer_remark"
attrs="{'invisible': [('finance_officer_id', '=', False)]}"/>
</div>
</group>
</xpath>
</field>
</record>

</data>
</openerp>
16 changes: 3 additions & 13 deletions logistic_order/view/sale_order_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_sales_order_filter"/>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="origin"/>
</field>
<search position="attributes">
<attribute name="string">Search Order</attribute>
</search>
Expand Down Expand Up @@ -158,19 +161,6 @@
</field>
</record>

<record id="view_order_form_delivery_time" model="ir.ui.view">
<field name="name">delivery time</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='sale_total']" position="after">
<group>
<field name="delivery_time" class="oe_inline"/>
</group>
</xpath>
</field>
</record>

<record id="view_quotation_tree" model="ir.ui.view">
<field name="name">sale.order.tree</field>
<field name="model">sale.order</field>
Expand Down

0 comments on commit 6a002aa

Please sign in to comment.