[MERGE] Merge from trunk addons
bzr revid: mra@mra-laptop-20101004131434-788c72ysnza76azr
This commit is contained in:
commit
f9401beb67
|
@ -23,6 +23,8 @@ from osv import osv, fields
|
|||
from osv.orm import intersect
|
||||
import tools.sql
|
||||
from tools.translate import _
|
||||
from decimal_precision import decimal_precision as dp
|
||||
|
||||
|
||||
class account_analytic_account(osv.osv):
|
||||
_name = "account.analytic.account"
|
||||
|
@ -351,22 +353,47 @@ class account_analytic_account(osv.osv):
|
|||
return res
|
||||
|
||||
_columns ={
|
||||
'ca_invoiced': fields.function(_ca_invoiced_calc, method=True, type='float', string='Invoiced Amount', help="Total customer invoiced amount for this account."),
|
||||
'total_cost': fields.function(_total_cost_calc, method=True, type='float', string='Total Costs', help="Total of costs for this account. It includes real costs (from invoices) and indirect costs, like time spent on timesheets."),
|
||||
'ca_to_invoice': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Uninvoiced Amount', help="If invoice from analytic account, the remaining amount you can invoice to the customer based on the total costs."),
|
||||
'ca_theorical': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Theorical Revenue', help="Based on the costs you had on the project, what would have been the revenue if all these costs have been invoiced at the normal sale price provided by the pricelist."),
|
||||
'hours_quantity': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Hours Tot', help="Number of hours you spent on the analytic account (from timesheet). It computes on all journal of type 'general'."),
|
||||
'last_invoice_date': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='date', string='Last Invoice Date', help="Date of the last invoice created for this analytic account."),
|
||||
'last_worked_invoiced_date': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='date', string='Date of Last Invoiced Cost', help="If invoice from the costs, this is the date of the latest work or cost that have been invoiced."),
|
||||
'last_worked_date': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='date', string='Date of Last Cost/Work', help="Date of the latest work done on this account."),
|
||||
'hours_qtt_non_invoiced': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Uninvoiced Hours', help="Number of hours (from journal of type 'general') that can be invoiced if you invoice based on analytic account."),
|
||||
'hours_qtt_invoiced': fields.function(_hours_qtt_invoiced_calc, method=True, type='float', string='Invoiced Hours', help="Number of hours that can be invoiced plus those that already have been invoiced."),
|
||||
'remaining_hours': fields.function(_remaining_hours_calc, method=True, type='float', string='Remaining Hours', help="Computed using the formula: Maximum Quantity - Hours Tot."),
|
||||
'remaining_ca': fields.function(_remaining_ca_calc, method=True, type='float', string='Remaining Revenue', help="Computed using the formula: Max Invoice Price - Invoiced Amount."),
|
||||
'revenue_per_hour': fields.function(_revenue_per_hour_calc, method=True, type='float', string='Revenue per Hours (real)', help="Computed using the formula: Invoiced Amount / Hours Tot."),
|
||||
'real_margin': fields.function(_real_margin_calc, method=True, type='float', string='Real Margin', help="Computed using the formula: Invoiced Amount - Total Costs."),
|
||||
'theorical_margin': fields.function(_theorical_margin_calc, method=True, type='float', string='Theorical Margin', help="Computed using the formula: Theorial Revenue - Total Costs"),
|
||||
'real_margin_rate': fields.function(_real_margin_rate_calc, method=True, type='float', string='Real Margin Rate (%)', help="Computes using the formula: (Real Margin / Total Costs) * 100."),
|
||||
'ca_invoiced': fields.function(_ca_invoiced_calc, method=True, type='float', string='Invoiced Amount',
|
||||
help="Total customer invoiced amount for this account.",
|
||||
digits_compute=dp.get_precision('Account')),
|
||||
'total_cost': fields.function(_total_cost_calc, method=True, type='float', string='Total Costs',
|
||||
help="Total of costs for this account. It includes real costs (from invoices) and indirect costs, like time spent on timesheets.",
|
||||
digits_compute=dp.get_precision('Account')),
|
||||
'ca_to_invoice': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Uninvoiced Amount',
|
||||
help="If invoice from analytic account, the remaining amount you can invoice to the customer based on the total costs.",
|
||||
digits_compute=dp.get_precision('Account')),
|
||||
'ca_theorical': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Theorical Revenue',
|
||||
help="Based on the costs you had on the project, what would have been the revenue if all these costs have been invoiced at the normal sale price provided by the pricelist.",
|
||||
digits_compute=dp.get_precision('Account')),
|
||||
'hours_quantity': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Hours Tot',
|
||||
help="Number of hours you spent on the analytic account (from timesheet). It computes on all journal of type 'general'."),
|
||||
'last_invoice_date': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='date', string='Last Invoice Date',
|
||||
help="Date of the last invoice created for this analytic account."),
|
||||
'last_worked_invoiced_date': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='date', string='Date of Last Invoiced Cost',
|
||||
help="If invoice from the costs, this is the date of the latest work or cost that have been invoiced."),
|
||||
'last_worked_date': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='date', string='Date of Last Cost/Work',
|
||||
help="Date of the latest work done on this account."),
|
||||
'hours_qtt_non_invoiced': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Uninvoiced Hours',
|
||||
help="Number of hours (from journal of type 'general') that can be invoiced if you invoice based on analytic account."),
|
||||
'hours_qtt_invoiced': fields.function(_hours_qtt_invoiced_calc, method=True, type='float', string='Invoiced Hours',
|
||||
help="Number of hours that can be invoiced plus those that already have been invoiced."),
|
||||
'remaining_hours': fields.function(_remaining_hours_calc, method=True, type='float', string='Remaining Hours',
|
||||
help="Computed using the formula: Maximum Quantity - Hours Tot."),
|
||||
'remaining_ca': fields.function(_remaining_ca_calc, method=True, type='float', string='Remaining Revenue',
|
||||
help="Computed using the formula: Max Invoice Price - Invoiced Amount.",
|
||||
digits_compute=dp.get_precision('Account')),
|
||||
'revenue_per_hour': fields.function(_revenue_per_hour_calc, method=True, type='float', string='Revenue per Hours (real)',
|
||||
help="Computed using the formula: Invoiced Amount / Hours Tot.",
|
||||
digits_compute=dp.get_precision('Account')),
|
||||
'real_margin': fields.function(_real_margin_calc, method=True, type='float', string='Real Margin',
|
||||
help="Computed using the formula: Invoiced Amount - Total Costs.",
|
||||
digits_compute=dp.get_precision('Account')),
|
||||
'theorical_margin': fields.function(_theorical_margin_calc, method=True, type='float', string='Theorical Margin',
|
||||
help="Computed using the formula: Theorial Revenue - Total Costs",
|
||||
digits_compute=dp.get_precision('Account')),
|
||||
'real_margin_rate': fields.function(_real_margin_rate_calc, method=True, type='float', string='Real Margin Rate (%)',
|
||||
help="Computes using the formula: (Real Margin / Total Costs) * 100.",
|
||||
digits_compute=dp.get_precision('Account')),
|
||||
'month_ids': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='many2many', relation='account_analytic_analysis.summary.month', string='Month'),
|
||||
'user_ids': fields.function(_analysis_all, method=True, multi='analytic_analysis', type="many2many", relation='account_analytic_analysis.summary.user', string='User'),
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ import operator
|
|||
from osv import fields, osv
|
||||
import decimal_precision as dp
|
||||
|
||||
|
||||
class account_analytic_account(osv.osv):
|
||||
_name = 'account.analytic.account'
|
||||
_description = 'Analytic Account'
|
||||
|
@ -272,7 +273,7 @@ class account_analytic_line(osv.osv):
|
|||
_columns = {
|
||||
'name' : fields.char('Description', size=256, required=True),
|
||||
'date' : fields.date('Date', required=True, select=1),
|
||||
'amount' : fields.float('Amount', required=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.'),
|
||||
'amount' : fields.float('Amount', required=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.', digits_compute=dp.get_precision('Account')),
|
||||
'unit_amount' : fields.float('Quantity', help='Specifies the amount of quantity to count.'),
|
||||
'account_id' : fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='cascade', select=True),
|
||||
'user_id' : fields.many2one('res.users', 'User'),
|
||||
|
|
|
@ -724,7 +724,7 @@ true, it will allow you to hide the event alarm information without removing it.
|
|||
if alarm_ids:
|
||||
alarm_obj.unlink(cr, uid, alarm_ids)
|
||||
cr.execute('Update %s set base_calendar_alarm_id=NULL, alarm_id=NULL\
|
||||
where id=%%d' % model_obj._table,(datas.id,))
|
||||
where id=%%s' % model_obj._table,(datas.id,))
|
||||
return True
|
||||
|
||||
res_alarm()
|
||||
|
|
|
@ -716,7 +716,7 @@ class basic_calendar_line(osv.osv):
|
|||
"""
|
||||
|
||||
cr.execute("SELECT COUNT(id) FROM basic_calendar_lines \
|
||||
WHERE name='%s' AND calendar_id=%s",
|
||||
WHERE name=%s AND calendar_id=%s",
|
||||
(vals.get('name'), vals.get('calendar_id')))
|
||||
res = cr.fetchone()
|
||||
if res:
|
||||
|
|
|
@ -28,6 +28,7 @@ import time
|
|||
import tools
|
||||
import decimal_precision as dp
|
||||
|
||||
|
||||
class event_type(osv.osv):
|
||||
""" Event Type """
|
||||
_name = 'event.type'
|
||||
|
@ -225,7 +226,7 @@ class event_event(osv.osv):
|
|||
'product_id': fields.many2one('product.product', 'Product', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="The invoices of this event registration will be created with this Product. Thus it allows you to set the default label and the accounting info you want by default on these invoices."),
|
||||
'note': fields.text('Notes', help="Description or Summary of Event", readonly=False, states={'done': [('readonly', True)]}),
|
||||
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', readonly=True, states={'draft': [('readonly', False)]}, help="Pricelist version for current event."),
|
||||
'unit_price': fields.related('product_id', 'list_price', type='float', string='Registration Cost', readonly=True, states={'draft':[('readonly',False)]}, help="This will be the default price used as registration cost when invoicing this event. Note that you can specify for each registration a specific amount if you want to"),
|
||||
'unit_price': fields.related('product_id', 'list_price', type='float', string='Registration Cost', readonly=True, states={'draft':[('readonly',False)]}, help="This will be the default price used as registration cost when invoicing this event. Note that you can specify for each registration a specific amount if you want to", digits_compute=dp.get_precision('Sale Price')),
|
||||
'main_speaker_id': fields.many2one('res.partner','Main Speaker', readonly=False, states={'done': [('readonly', True)]}, help="Speaker who are giving speech on event."),
|
||||
'speaker_ids':fields.many2many('res.partner', 'event_speaker_rel', 'speaker_id', 'partner_id', 'Other Speakers', readonly=False, states={'done': [('readonly', True)]}),
|
||||
'address_id': fields.many2one('res.partner.address','Location Address', readonly=False, states={'done': [('readonly', True)]}),
|
||||
|
@ -306,8 +307,8 @@ class event_registration(osv.osv):
|
|||
'partner_id': fields.many2one('res.partner', 'Partner', states={'done': [('readonly', True)]}),
|
||||
"partner_invoice_id": fields.many2one('res.partner', 'Partner Invoiced', readonly=True, states={'draft': [('readonly', False)]}),
|
||||
"contact_id": fields.many2one('res.partner.contact', 'Partner Contact', readonly=False, states={'done': [('readonly', True)]}), #TODO: filter only the contacts that have a function into the selected partner_id
|
||||
"unit_price": fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Event Price'), readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal', digits_compute= dp.get_precision('Event Price')),
|
||||
"unit_price": fields.float('Unit Price', required=True, digits_compute=dp.get_precision('Sale Price'), readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal', digits_compute=dp.get_precision('Sale Price')),
|
||||
"badge_ids": fields.one2many('event.registration.badge', 'registration_id', 'Badges', readonly=False, states={'done': [('readonly', True)]}),
|
||||
"event_product": fields.char("Invoice Name", size=128, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
"tobe_invoiced": fields.boolean("To be Invoiced", readonly=True, states={'draft': [('readonly', False)]}),
|
||||
|
|
|
@ -24,6 +24,7 @@ import netsvc
|
|||
import tools
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
from decimal_precision import decimal_precision as dp
|
||||
|
||||
|
||||
class partner_event_registration(osv.osv_memory):
|
||||
|
@ -36,7 +37,7 @@ class partner_event_registration(osv.osv_memory):
|
|||
_columns = {
|
||||
'event_id': fields.many2one('event.event', 'Event'),
|
||||
'event_type': fields.many2one('event.type', 'Type', readonly=True),
|
||||
'unit_price': fields.float('Registration Cost'),
|
||||
'unit_price': fields.float('Registration Cost', digits_compute=dp.get_precision('Sale Price')),
|
||||
'start_date': fields.datetime('Start date', required=True, help="Beginning Date of Event", readonly=True),
|
||||
'end_date': fields.datetime('Closing date', required=True, help="Closing Date of Event", readonly=True),
|
||||
'nb_register': fields.integer('Number of Registration'),
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
|
||||
from osv import fields,osv
|
||||
import tools
|
||||
from decimal_precision import decimal_precision as dp
|
||||
|
||||
|
||||
class report_analytic_account_close(osv.osv):
|
||||
_name = "report.analytic.account.close"
|
||||
|
@ -70,8 +72,8 @@ class report_account_analytic_line_to_invoice(osv.osv):
|
|||
'account_id':fields.many2one('account.analytic.account', 'Analytic account', readonly=True),
|
||||
'product_uom_id':fields.many2one('product.uom', 'UoM', readonly=True),
|
||||
'unit_amount': fields.float('Units', readonly=True),
|
||||
'sale_price': fields.float('Sale price', readonly=True),
|
||||
'amount': fields.float('Amount', readonly=True),
|
||||
'sale_price': fields.float('Sale price', readonly=True, digits_compute=dp.get_precision('Sale Price')),
|
||||
'amount': fields.float('Amount', readonly=True, digits_compute=dp.get_precision('Account')),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
|
||||
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
|
||||
}
|
||||
|
|
|
@ -84,8 +84,8 @@
|
|||
<field name="search_view_id" ref="view_campaign_analysis_search"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="Reporting" id="base.menu_report_association" parent="base.marketing_menu"/>
|
||||
<menuitem action="action_campaign_analysis_all" id="menu_action_campaign_analysis_all" parent="base.menu_report_association" sequence="2"/>
|
||||
<menuitem name="Reporting" id="base.menu_report_marketing" parent="base.marketing_menu"/>
|
||||
<menuitem action="action_campaign_analysis_all" id="menu_action_campaign_analysis_all" parent="base.menu_report_marketing" sequence="2"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -687,8 +687,9 @@ class mrp_repair_line(osv.osv, ProductChangeMixin):
|
|||
if type == 'add':
|
||||
stock_id = self.pool.get('stock.location').search(cr, uid, [('name','=','Stock')])[0]
|
||||
to_invoice = False
|
||||
if guarantee_limit and date.today() > datetime.strptime(guarantee_limit, '%Y-%m-%d'):
|
||||
if guarantee_limit and datetime.strptime(date.today().strftime('%Y-%m-%d'), '%Y-%m-%d') > datetime.strptime(guarantee_limit, '%Y-%m-%d'):
|
||||
to_invoice=True
|
||||
|
||||
return {'value': {
|
||||
'to_invoice': to_invoice,
|
||||
'location_id': stock_id,
|
||||
|
|
|
@ -33,9 +33,9 @@ class order(report_sxw.rml_parse):
|
|||
def total(self, repair):
|
||||
total = 0.0
|
||||
for operation in repair.operations:
|
||||
total+=operation.price_subtotal
|
||||
total += operation.price_subtotal
|
||||
for fee in repair.fees_lines:
|
||||
total+=fee.price_subtotal
|
||||
total += fee.price_subtotal
|
||||
total = total + repair.amount_tax
|
||||
return total
|
||||
|
||||
|
|
|
@ -343,7 +343,7 @@
|
|||
<para style="terp_default_9">Net Total :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P26">[[ formatLang(o.amount_untaxed)]] [[ o.pricelist_id.currency_id. symbol ]]</para>
|
||||
<para style="P26">[[ formatLang(o.amount_untaxed, digits=get_digits(dp='Sale Price'))]] [[ o.pricelist_id.currency_id. symbol ]]</para>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
@ -357,7 +357,7 @@
|
|||
<para style="terp_default_9">Taxes:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P26">[[ formatLang(o.amount_tax)]] [[ o.pricelist_id.currency_id. symbol ]]</para>
|
||||
<para style="P26">[[ formatLang(o.amount_tax, digits=get_digits(dp='Account'))]] [[ o.pricelist_id.currency_id. symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -370,7 +370,7 @@
|
|||
<para style="terp_tblheader_Details">Total :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_right_bold_9">[[ formatLang(total(o)) ]] [[ o.pricelist_id.currency_id. symbol ]]</para>
|
||||
<para style="terp_default_right_bold_9">[[ formatLang(total(o), digits=get_digits(dp='Sale Price')) ]] [[ o.pricelist_id.currency_id. symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
@ -391,4 +391,4 @@
|
|||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
||||
</document>
|
||||
|
|
|
@ -112,6 +112,7 @@ class project_work(osv.osv):
|
|||
timesheet_obj = self.pool.get('hr.analytic.timesheet')
|
||||
project_obj = self.pool.get('project.project')
|
||||
uom_obj = self.pool.get('product.uom')
|
||||
result = {}
|
||||
|
||||
if isinstance(ids, (long, int)):
|
||||
ids = [ids,]
|
||||
|
@ -139,7 +140,7 @@ class project_work(osv.osv):
|
|||
vals_line['unit_amount'] = vals['hours']
|
||||
prod_id = vals_line.get('product_id', line_id.product_id.id) # False may be set
|
||||
|
||||
if result['product_uom_id'] and (not result['product_uom_id'] == default_uom):
|
||||
if result.get('product_uom_id',False) and (not result['product_uom_id'] == default_uom):
|
||||
vals_line['unit_amount'] = uom_obj._compute_qty(cr, uid, default_uom, vals['hours'], result['product_uom_id'])
|
||||
|
||||
# Compute based on pricetype
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
from osv import osv, fields
|
||||
from tools.sql import drop_view_if_exists
|
||||
from decimal_precision import decimal_precision as dp
|
||||
|
||||
|
||||
class res_country(osv.osv):
|
||||
|
@ -69,7 +70,7 @@ class report_intrastat(osv.osv):
|
|||
'code': fields.char('Country code', size=2, readonly=True),
|
||||
'intrastat_id': fields.many2one('report.intrastat.code', 'Intrastat code', readonly=True),
|
||||
'weight': fields.float('Weight', readonly=True),
|
||||
'value': fields.float('Value', readonly=True),
|
||||
'value': fields.float('Value', readonly=True, digits_compute=dp.get_precision('Account')),
|
||||
'type': fields.selection([('import', 'Import'), ('export', 'Export')], 'Type'),
|
||||
'currency_id': fields.many2one('res.currency', "Currency", readonly=True),
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,12 +15,14 @@
|
|||
# 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/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
import tools
|
||||
from decimal_precision import decimal_precision as dp
|
||||
|
||||
|
||||
class sale_journal_picking_report(osv.osv):
|
||||
"""
|
||||
|
@ -30,32 +32,32 @@ class sale_journal_picking_report(osv.osv):
|
|||
_description = "Picking lists"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'name': fields.char('Year', size=64, required=False, readonly=True),
|
||||
'month': fields.selection([('01', 'January'), ('02', 'February'), ('03', 'March'), ('04', 'April'), ('05', 'May'), ('06', 'June'),
|
||||
('07', 'July'), ('08', 'August'), ('09', 'September'), ('10', 'October'), ('11', 'November'), ('12', 'December')], 'Month', readonly=True),
|
||||
'name': fields.char('Year', size=64, required=False, readonly=True),
|
||||
'month': fields.selection([('01', 'January'), ('02', 'February'), ('03', 'March'), ('04', 'April'), ('05', 'May'), ('06', 'June'),
|
||||
('07', 'July'), ('08', 'August'), ('09', 'September'), ('10', 'October'), ('11', 'November'), ('12', 'December')], 'Month', readonly=True),
|
||||
|
||||
'invoice_state':fields.selection([
|
||||
("invoiced", "invoiced"),
|
||||
("2binvoiced", "to be invoiced"),
|
||||
("invoiced", "invoiced"),
|
||||
("2binvoiced", "to be invoiced"),
|
||||
("none", "None")
|
||||
], "Invoice state", readonly=True),
|
||||
], "Invoice state", readonly=True),
|
||||
'state': fields.selection([
|
||||
('draft', 'draft'),
|
||||
('auto', 'waiting'),
|
||||
('confirmed', 'confirmed'),
|
||||
('assigned', 'assigned'),
|
||||
('done', 'done'),
|
||||
('cancel', 'cancel'),
|
||||
], 'State', readonly=True),
|
||||
'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoicing method', readonly=True),
|
||||
'journal_id': fields.many2one('sale_journal.picking.journal', 'Journal', readonly=True),
|
||||
'quantity': fields.float('Quantities', readonly=True),
|
||||
'price_total': fields.float('Total Price', readonly=True),
|
||||
'price_average': fields.float('Average Price', readonly=True),
|
||||
'count': fields.integer('# of Lines', readonly=True),
|
||||
('draft', 'draft'),
|
||||
('auto', 'waiting'),
|
||||
('confirmed', 'confirmed'),
|
||||
('assigned', 'assigned'),
|
||||
('done', 'done'),
|
||||
('cancel', 'cancel'),
|
||||
], 'State', readonly=True),
|
||||
'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoicing method', readonly=True),
|
||||
'journal_id': fields.many2one('sale_journal.picking.journal', 'Journal', readonly=True),
|
||||
'quantity': fields.float('Quantities', readonly=True),
|
||||
'price_total': fields.float('Total Price', readonly=True, digits_compute=dp.get_precision('Sale Price')),
|
||||
'price_average': fields.float('Average Price', readonly=True, digits_compute=dp.get_precision('Sale Price')),
|
||||
'count': fields.integer('# of Lines', readonly=True),
|
||||
}
|
||||
_order = 'journal_id, name desc, price_total desc'
|
||||
|
||||
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'sale_journal_picking_report')
|
||||
|
||||
|
@ -80,7 +82,7 @@ class sale_journal_picking_report(osv.osv):
|
|||
order by s.invoice_type_id, s.invoice_state, s.state
|
||||
)
|
||||
""")
|
||||
|
||||
|
||||
sale_journal_picking_report()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -167,10 +167,10 @@
|
|||
<para style="terp_default_Right_9">[[formatLang( p['prod_qty']) ]] [[ p['uom'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(p['price']) ]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(p['price'], digits=get_digits(dp='Account')) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(p['price_value']) ]] [[ o.company_id.currency_id.symbol]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(p['price_value'], digits=get_digits(dp='Account')) ]] [[ o.company_id.currency_id.symbol]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
@ -184,7 +184,7 @@
|
|||
<para style="terp_default_Bold_9">Total:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ formatLang(price_total()) ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
<para style="terp_tblheader_Details_Right">[[ formatLang(price_total(), digits=get_digits(dp='Account')) ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
@ -201,7 +201,7 @@
|
|||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ formatLang(grand_total_price()) ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
<para style="terp_tblheader_Details_Right">[[ formatLang(grand_total_price(), digits=get_digits(dp='Account')) ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
@ -209,4 +209,4 @@
|
|||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
||||
</document>
|
||||
|
|
|
@ -167,10 +167,10 @@
|
|||
<para style="terp_default_Right_9">[[formatLang( p['prod_qty']) ]] [[ p['uom'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(p['price']) ]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(p['price'], digits=get_digits(dp='Account')) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(p['price_value']) ]] [[ o.company_id.currency_id.symbol]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(p['price_value'], digits=get_digits(dp='Account')) ]] [[ o.company_id.currency_id.symbol]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
@ -184,7 +184,7 @@
|
|||
<para style="terp_default_Bold_9">Total:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ formatLang(price_total()) ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
<para style="terp_tblheader_Details_Right">[[ formatLang(price_total(), digits=get_digits(dp='Account')) ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
@ -201,7 +201,7 @@
|
|||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ formatLang(grand_total_price()) ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
<para style="terp_tblheader_Details_Right">[[ formatLang(grand_total_price(), digits=get_digits(dp='Account')) ]] [[ o.company_id.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
@ -209,4 +209,4 @@
|
|||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
||||
</document>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
import tools
|
||||
from osv import fields,osv
|
||||
from decimal_precision import decimal_precision as dp
|
||||
|
||||
|
||||
class report_stock_move(osv.osv):
|
||||
|
@ -44,7 +45,7 @@ class report_stock_move(osv.osv):
|
|||
'state': fields.selection([('draft', 'Draft'), ('waiting', 'Waiting'), ('confirmed', 'Confirmed'), ('assigned', 'Available'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, select=True),
|
||||
'product_qty_in':fields.integer('In Qty',readonly=True),
|
||||
'product_qty_out':fields.integer('Out Qty',readonly=True),
|
||||
'value' : fields.float('Total Value', required=True),
|
||||
'value' : fields.float('Total Value', required=True, digits_compute=dp.get_precision('Sale Price')),
|
||||
'day_diff2':fields.float('Delay (Days)',readonly=True, digits=(16,2), group_operator="avg"),
|
||||
'day_diff1':fields.float('Planned (Days)',readonly=True, digits=(16,2), group_operator="avg"),
|
||||
'day_diff':fields.float('Real (Days)',readonly=True, digits=(16,2), group_operator="avg"),
|
||||
|
@ -136,7 +137,7 @@ class report_stock_inventory(osv.osv):
|
|||
'prodlot_id': fields.many2one('stock.production.lot', 'Lot', readonly=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', readonly=True),
|
||||
'product_qty':fields.float('Qty', digits=(16,2), readonly=True),
|
||||
'value' : fields.float('Total Value', digits=(16,2), required=True),
|
||||
'value' : fields.float('Total Value', digits=(16,2), required=True, digits_compute=dp.get_precision('Sale Price')),
|
||||
'state': fields.selection([('draft', 'Draft'), ('waiting', 'Waiting'), ('confirmed', 'Confirmed'), ('assigned', 'Available'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, select=True,
|
||||
help='When the stock move is created it is in the \'Draft\' state.\n After that it is set to \'Confirmed\' state.\n If stock is available state is set to \'Avaiable\'.\n When the picking it done the state is \'Done\'.\
|
||||
\nThe state is \'Waiting\' if the move is waiting for another one.'),
|
||||
|
|
Loading…
Reference in New Issue