[FIX] Misc Fixes and better design

bzr revid: fp@tinyerp.com-20140125182719-wfhn8n2um1f81m15
This commit is contained in:
Fabien Pinckaers 2014-01-25 19:27:19 +01:00
parent a73244b92e
commit 9a8048bb9c
5 changed files with 24 additions and 200 deletions

View File

@ -27,7 +27,7 @@
</record>
<record id="public_user" model="res.users">
<field name="name">public</field>
<field name="name">Anonymous</field>
<field name="login">public</field>
<field name="password">public</field>
<!-- Avoid auto-including this demo user in any default group -->

View File

@ -37,13 +37,13 @@ class sale_quote(http.Controller):
# use SUPERUSER_ID allow to access/view order for public user
# only if he knows the private token
order = request.registry.get('sale.order').browse(request.cr, token and SUPERUSER_ID or request.uid, order_id)
if token:
if token and not message:
assert token == order.access_token, 'Access denied!'
body=_('Quotation viewed by customer')
self.__message_post(body, order_id, type='comment')
days = 0
if order.validity_date:
days = (datetime.datetime.strptime(order.validity_date, '%Y-%m-%d') - datetime.datetime.now()).days
days = (datetime.datetime.strptime(order.validity_date, '%Y-%m-%d') - datetime.datetime.now()).days + 1
values = {
'quotation': order,
'message': message,

View File

@ -52,23 +52,6 @@
<field name="default_code">QF13</field>
</record>
<record id="product_template_quote_4" model="product.template">
<field name="name">Advanced Account Functional </field>
<field name="categ_id" ref="product.product_category_6"/>
<field name="public_categ_id" ref="product.Computer_all_in_one"/>
<field name="standard_price">50000.0</field>
<field name="list_price">750000.0</field>
<field name="type">service</field>
<field name="uom_id" ref="product.product_uom_unit"/>
<field name="uom_po_id" ref="product.product_uom_unit"/>
<field name="description_sale">Learn directly from our team and network of OpenERP experts. Choose from the available training sessions for a better functional understanding of OpenERP</field>
</record>
<record id="product_product_quote_4" model="product.product">
<field name="product_tmpl_id" ref="product_template_quote_4"/>
<field name="default_code">QF14</field>
</record>
<record id="website_quote_template_1" model="sale.quote.template">
<field name="name">Partnership Contract</field>
<field name="website_description" type="xml">
@ -152,31 +135,6 @@
</div>
</section>
<section data-snippet-id="text-block">
<h2>Enterprise commissions</h2>
<p>
As an official partner, you benefit from OpenERP Enterprise
commissions, according to your partner grade, as well as
dedicated services restricted to partners like the technical
support.
</p>
<table class="table table-hover">
<tr>
<th>Grade</th>
<th>Your Commission</th>
</tr><tr>
<td>Ready</td>
<td></td>
</tr><tr>
<td>Silver</td>
<td></td>
</tr><tr>
<td>Gold</td>
<td></td>
</tr>
</table>
</section>
<section data-snippet-id="text-block">
<h2>A Dedicated Account Manager</h2>
<p>
@ -294,6 +252,7 @@
<field name="name">Functional Training</field>
<field name="product_id" ref="product_product_quote_1"/>
<field name="product_uom_qty">1</field>
<field name="product_uom_id" ref="product.product_uom_unit"/>
<field name="price_unit">12950.00</field>
<field name="discount">10.00</field>
<field name="website_description" type="html">
@ -338,6 +297,7 @@
<field name="name">Technical Training</field>
<field name="product_id" ref="product_product_quote_2"/>
<field name="product_uom_qty">1</field>
<field name="product_uom_id" ref="product.product_uom_unit"/>
<field name="price_unit">00.00</field>
<field name="website_description" type="html">
<section data-snippet-id="title">
@ -466,6 +426,7 @@
<field name="product_id" ref="product_product_quote_3"/>
<field name="quantity">1</field>
<field name="uom_id" ref="product.product_uom_unit"/>
<field name="product_uom_id" ref="product.product_uom_unit"/>
<field name="price_unit">9000.00</field>
<field name="discount">10</field>
<field name="website_description" type="html">
@ -566,145 +527,5 @@
</field>
</record>
<record id="website_sale_option_line_2" model="sale.quote.option">
<field name="template_id" ref="website_quote_template_1"/>
<field name="name">Functional Webinar</field>
<field name="product_id" ref="product_product_quote_4"/>
<field name="quantity">1</field>
<field name="uom_id" ref="product.product_uom_unit"/>
<field name="price_unit">18000.00</field>
<field name="website_description" type="html">
<section data-snippet-id="title">
<h1>Functional Webinar</h1>
</section>
<section data-snippet-id="text-image">
<div class="container">
<div class="row">
<div class="col-md-12 text-center mb8 mt0" data-snippet-id="colmd">
<h2>Course Summary</h2>
</div>
<div class="col-md-12 mt16 mb0" data-snippet-id="colmd">
<p><span style="text-align: -webkit-center; ">This course is dedicated to developers who need to grasp knowledge of the <strong>business applications development </strong>process. This course is for new developers or for IT professionals eager to learn more about technical aspects.</span></p>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-12 text-center mt0 mb16" data-snippet-id="colmd">
<h2>What you will learn?</h2>
</div>
<div class="col-md-4" data-snippet-id="colmd">
<div class="panel panel-info">
<div class="panel-heading text-center">
<h2 style="margin: 0">Day 1</h2>
<p class="text-muted" style="margin: 0">Introduction to Javascript</p>
</div>
<ul class="list-group">
<li class="list-group-item">Hello World</li>
<li class="list-group-item">Variables &amp; Operators</li>
<li class="list-group-item">Dive into Strings</li>
<li class="list-group-item">Functions</li>
<li class="list-group-item">Loops</li>
<li class="list-group-item">Arrays</li>
</ul>
<div class="panel-footer text-center">
<p class="text-muted"><i>You will be able to develop simple dynamic compenents in HTML pages.</i></p>
</div>
</div>
</div>
<div class="col-md-4" data-snippet-id="colmd">
<div class="panel panel-info">
<div class="panel-heading text-center">
<h2 style="margin: 0">Day 2</h2>
<p class="text-muted" style="margin: 0">OpenERP Web Client</p>
</div>
<ul class="list-group">
<li class="list-group-item">Introduction to JQuery</li>
<li class="list-group-item">Advanced JQuery</li>
<li class="list-group-item">Underscore</li>
<li class="list-group-item">Introduction to QWeb</li>
<li class="list-group-item">Controlers and Views</li>
<li class="list-group-item">Bootstrap CSS</li>
<li class="list-group-item">Calling the ORM</li>
</ul>
<div class="panel-footer text-center">
<p class="text-muted"><i>You will be able to create dynamic page interacting with the ORM.</i></p>
</div>
</div>
</div>
<div class="col-md-4" data-snippet-id="colmd">
<div class="panel panel-info">
<div class="panel-heading text-center">
<h2 style="margin: 0">Day 3</h2>
<p class="text-muted" style="margin: 0">Building a Full Application</p>
</div>
<ul class="list-group">
<li class="list-group-item">Modules</li>
<li class="list-group-item">Python Objects</li>
<li class="list-group-item">Report Engine</li>
<li class="list-group-item">Workflows</li>
<li class="list-group-item">Training Center Module</li>
<li class="list-group-item">Integrated Help</li>
<li class="list-group-item">How to Debug</li>
</ul>
<div class="panel-footer text-center">
<p class="text-muted"><i>You will be able to develop a full application with backend and user interface.</i></p>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-12 text-center mb16 mt0" data-snippet-id="colmd">
<h2>Requirements</h2>
</div>
<div class="col-md-12 mb16 mt16" data-snippet-id="colmd">
<p><strong>Objectives:</strong></p>
<p><strong>Having attended this course, participants should be able to:</strong></p>
<ul>
<li>Understand the development concepts and architecture;</li>
<li>Install and administer your own server;</li>
<li>Develop a new module for a particular application.</li>
</ul><p></p>
<p><strong>Our prices include:</strong></p>
<ul>
<li>drinks and lunch;</li>
<li>training material.</li>
</ul><p></p>
<p><strong>Requirements:</strong></p>
<ul>
<li>Bring your own laptop.</li>
<li>Participants are expected to have some knowledge in programming. A basic knowledge of the Python programming is recommended.</li>
<li>Participants preferably have a functional knowledge of our software (see Functional Training).</li>
</ul><p></p>
<p>To get more information, visit the <a href="http://openerp.com/">OpenERP Official Website</a>.</p>
</div>
</div>
</div>
</section>
</field>
</record>
</data>
</openerp>

View File

@ -55,6 +55,7 @@ class sale_quote_line(osv.osv):
'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Product Price')),
'discount': fields.float('Discount (%)', digits_compute= dp.get_precision('Discount')),
'product_uom_qty': fields.float('Quantity', required=True, digits_compute= dp.get_precision('Product UoS')),
'product_uom_id': fields.many2one('product.uom', 'Unit of Measure ', required=True),
}
_defaults = {
'product_uom_qty': 1,
@ -104,7 +105,8 @@ class sale_order(osv.osv):
'website_description': fields.html('Description'),
'options' : fields.one2many('sale.order.option', 'order_id', 'Optional Products Lines'),
'validity_date': fields.date('Validity Date'),
'before_discount': fields.function(_get_total, string='Amount Before Discount', type="float")
'before_discount': fields.function(_get_total, string='Amount Before Discount', type="float",
digits_compute=dp.get_precision('Account'))
}
_defaults = {
'access_token': lambda self, cr, uid, ctx={}: str(uuid.uuid4())

View File

@ -11,7 +11,7 @@
<tr>
<th>Products</th>
<th>Quantity</th>
<th>Discount(%)</th>
<th></th>
<th class="text-right">Unit Price</th>
<th class="text-right">Price</th>
</tr>
@ -23,13 +23,14 @@
</td>
<td>
<div id="quote_qty">
<t t-esc="line.product_uom_qty"/>
<span t-field="line.product_uom_qty"/>
<span t-field="line.product_uom"/>
</div>
</td>
<td>
<div id="quote_discount" t-if="line.discount">
<t t-esc="line.discount"/>
</div>
<strong t-if="line.discount" class="text-info">
<t t-esc="((line.discount % 1) and '%s' or '%d') % line.discount"/>% discount
</strong>
</td>
<td>
<strong class="text-right">
@ -39,7 +40,7 @@
t-att-class="line.discount and 'text-danger' or ''"/>
<!-- TODO: apply monetary widget formating -->
<div t-if="line.discount">
<t t-esc="'%.2f' % ((1-line.discount) * line.price_unit)"/>
<t t-esc="'%.2f' % ((1-line.discount / 100.0) * line.price_unit)"/>
</div>
</strong>
</td>
@ -175,7 +176,7 @@
<hr class="mt0 mb0"/>
<div t-if="order_valid" class="text-center hidden-print">
<input type="hidden" t-att-value="quotation.validity_date" id="validity_date"/>
<div class="mt8">
<div class="mt8" t-if="days_valid &gt; 0">
<strong>This offer expires in</strong>
<div class="fa fa-clock-o fa-2x day_counter mt8 mb16">
<t t-esc="days_valid"/>
@ -189,7 +190,7 @@
</div>
<div class="text-center mb16" t-if="quotation.before_discount > quotation.amount_total">
<div class="text-center mb16" t-if="quotation.before_discount &gt; quotation.amount_total">
<p class="text-muted mb8">Your advantage:</p>
<strong t-field="quotation.amount_total"
t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}'/>
@ -393,8 +394,8 @@
<thead>
<tr>
<th>Products</th>
<th>Discription</th>
<th>Discount(%)</th>
<th>Description</th>
<th></th>
<th class="text-right">Price</th>
</tr>
</thead>
@ -408,9 +409,9 @@
<div t-field="option.name"/>
</td>
<td>
<div id="quote_discount" t-if="option.discount">
<t t-esc="option.discount"/>
</div>
<strong t-if="option.discount" class="text-info">
<t t-esc="((option.discount % 1) and '%s' or '%d') % option.discount"/>% discount
</strong>
</td>
<td>
<strong class="text-right">
@ -419,7 +420,7 @@
t-att-style="option.discount and 'text-decoration: line-through' or ''"
t-att-class="option.discount and 'text-danger' or ''"/>
<div t-if="option.discount">
<t t-esc="'%.2f' % ((1-option.discount) * option.price_unit)"/>
<t t-esc="'%.2f' % ((1-option.discount / 100.0) * option.price_unit)"/>
</div>
</strong>
</td>