@@ -289,8 +289,6 @@ class account_account(osv.osv):
|
||||
'check_history': fields.boolean('Display History',
|
||||
help="Check this box if you want to print all entries when printing the General Ledger, "\
|
||||
"otherwise it will only print its balance."),
|
||||
'merge_invoice': fields.boolean('Merge Invoice Entries',help="Check this box if you want that all lines of "\
|
||||
"a customer or supplier invoice using this account are created in one line only"),
|
||||
}
|
||||
|
||||
def _default_company(self, cr, uid, context={}):
|
||||
@@ -2071,8 +2069,8 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
vals_journal['code'] = _('SAJ')
|
||||
|
||||
if obj_multi.chart_template_id.property_account_receivable:
|
||||
vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.chart_template_id.property_account_receivable.id]
|
||||
vals_journal['default_debit_account_id'] = acc_template_ref[obj_multi.chart_template_id.property_account_receivable.id]
|
||||
vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.chart_template_id.property_account_income_categ.id]
|
||||
vals_journal['default_debit_account_id'] = acc_template_ref[obj_multi.chart_template_id.property_account_income_categ.id]
|
||||
|
||||
obj_journal.create(cr,uid,vals_journal)
|
||||
|
||||
@@ -2082,8 +2080,8 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
vals_journal['code']=_('EXJ')
|
||||
|
||||
if obj_multi.chart_template_id.property_account_payable:
|
||||
vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.chart_template_id.property_account_payable.id]
|
||||
vals_journal['default_debit_account_id'] = acc_template_ref[obj_multi.chart_template_id.property_account_payable.id]
|
||||
vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.chart_template_id.property_account_expense_categ.id]
|
||||
vals_journal['default_debit_account_id'] = acc_template_ref[obj_multi.chart_template_id.property_account_expense_categ.id]
|
||||
|
||||
obj_journal.create(cr,uid,vals_journal)
|
||||
|
||||
|
||||
@@ -130,7 +130,6 @@
|
||||
<field name="reconcile"/>
|
||||
<field name="active" select="2"/>
|
||||
<field name="check_history"/>
|
||||
<field name="merge_invoice" select="2"/>
|
||||
<newline/>
|
||||
<newline/>
|
||||
<field colspan="4" name="tax_ids" domain="[('parent_id','=',False)]"/>
|
||||
|
||||
@@ -431,7 +431,6 @@ class account_invoice(osv.osv):
|
||||
def action_move_create(self, cr, uid, ids, *args):
|
||||
ait_obj = self.pool.get('account.invoice.tax')
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
acc_obj = self.pool.get('account.account')
|
||||
self.button_compute(cr, uid, ids, context={}, set_total=False)
|
||||
for inv in self.browse(cr, uid, ids):
|
||||
if inv.move_id:
|
||||
@@ -479,11 +478,7 @@ class account_invoice(osv.osv):
|
||||
# create one move line for the total and possibly adjust the other lines amount
|
||||
total = 0
|
||||
total_currency = 0
|
||||
key_line=[]
|
||||
for i in iml:
|
||||
if 'account_id' in i and 'taxes' in i:
|
||||
if not (i['account_id'],i['taxes']) in key_line:
|
||||
key_line.append((i['account_id'],i['taxes']))
|
||||
if inv.currency_id.id != company_currency:
|
||||
i['currency_id'] = inv.currency_id.id
|
||||
i['amount_currency'] = i['price']
|
||||
@@ -504,36 +499,6 @@ class account_invoice(osv.osv):
|
||||
acc_id = inv.account_id.id
|
||||
|
||||
name = inv['name'] or '/'
|
||||
iml_temp=[]
|
||||
move_list=[]
|
||||
|
||||
for item in key_line:
|
||||
move_temp={}
|
||||
if acc_obj.browse(cr,uid,item[0]).merge_invoice:
|
||||
repeat=False
|
||||
for move_line in iml:
|
||||
if (move_line.has_key('account_id') and move_line['account_id']==item[0]) and ('taxes' in move_line and move_line['taxes']==item[1]):
|
||||
move_list.append(move_line)
|
||||
if repeat:
|
||||
for key in move_line:
|
||||
if key in ['name','amount_currency','price_unit','price','quantity']:
|
||||
if key=='name':
|
||||
move_temp[key]=move_temp[key] + "," +move_line[key]
|
||||
else:
|
||||
move_temp[key] +=move_line[key]
|
||||
else:
|
||||
for key in move_line:
|
||||
move_temp[key]=move_line[key]
|
||||
repeat=True
|
||||
if move_temp:
|
||||
iml_temp.append(move_temp)
|
||||
|
||||
if len(iml_temp)<len(move_list):
|
||||
for old_elem in move_list:
|
||||
iml.remove(old_elem)
|
||||
for new_elem in iml_temp:
|
||||
iml.append(new_elem)
|
||||
|
||||
totlines = False
|
||||
if inv.payment_term:
|
||||
totlines = self.pool.get('account.payment.term').compute(cr,
|
||||
|
||||
@@ -350,7 +350,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Note">[[ format(l.note) or removeParentNode('tr') ]]</para>
|
||||
<para style="terp_default_Note">[[ format(l.note or removeParentNode('tr')) ]]</para>
|
||||
<para style="terp_default_Note">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
@@ -541,7 +541,7 @@
|
||||
<blockTable colWidths="530.0" style="Table_Coment_Payment_Term">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ format(o.comment) or removeParentNode('blockTable') ]]</para>
|
||||
<para style="terp_default_9">[[ format(o.comment or removeParentNode('blockTable')) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
@@ -551,7 +551,7 @@
|
||||
<blockTable colWidths="530.0" style="Table_Payment_Terms">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ format(o.payment_term and o.payment_term.note) or removeParentNode('blockTable') ]]</para>
|
||||
<para style="terp_default_9">[[ format(o.payment_term and o.payment_term.note or removeParentNode('blockTable')) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
@@ -559,4 +559,4 @@
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
||||
</document>
|
||||
|
||||
@@ -159,7 +159,6 @@ class account_report(osv.osv):
|
||||
('other','Others')],
|
||||
'Type', required=True),
|
||||
'expression': fields.char('Expression', size=240, required=True),
|
||||
# 'expression_status': fields.char('Status expression', size=240, required=True),
|
||||
'badness_limit' :fields.float('Badness Indicator Limit', digits=(16,2),help='This Value depicts the limit of badness.'),
|
||||
'goodness_limit' :fields.float('Goodness Indicator Limit', digits=(16,2),help='This Value depicts the limit of goodness.'),
|
||||
'parent_id': fields.many2one('account.report.report', 'Parent'),
|
||||
@@ -204,10 +203,7 @@ class account_report(osv.osv):
|
||||
return self.name_get(cr, user, ids, context=context)
|
||||
|
||||
_constraints = [
|
||||
#TODO Put an expression to valid expression and expression_status
|
||||
]
|
||||
_sql_constraints = [
|
||||
('code_uniq', 'unique (code)', 'The code of the report entry must be unique !')
|
||||
#TODO Put an expression to valid expression
|
||||
]
|
||||
|
||||
account_report()
|
||||
|
||||
@@ -23,6 +23,7 @@ import pooler
|
||||
import os
|
||||
import osv
|
||||
from tools import config
|
||||
from tools.translate import _
|
||||
|
||||
class abstract_quality_check(object):
|
||||
'''
|
||||
@@ -52,24 +53,28 @@ class abstract_quality_check(object):
|
||||
#Used to provide more details if necessary.
|
||||
self.result_details = ""
|
||||
|
||||
#This bool defines if the test can be run only if the module is installed.
|
||||
#This bool defines if the test can be run only if the module
|
||||
#is installed.
|
||||
#True => the module have to be installed.
|
||||
#False => the module can be uninstalled.
|
||||
self.bool_installed_only = True
|
||||
|
||||
#This variable is use to make result of test should have more weight (Some tests are more critical than others)
|
||||
#This variable is used to give result of test more weight,
|
||||
#because some tests are more critical than others.
|
||||
self.ponderation = 1.0
|
||||
|
||||
#Specify test got an error on module
|
||||
self.error = False
|
||||
|
||||
#The tests have to subscribe itselfs in this list, that contains all the test that have to be performed.
|
||||
#The tests have to subscribe itselfs in this list, that contains
|
||||
#all the test that have to be performed.
|
||||
self.tests = []
|
||||
self.list_folders = os.listdir(config['addons_path']+'/base_module_quality/')
|
||||
self.list_folders = os.listdir(config['addons_path'] +
|
||||
'/base_module_quality/')
|
||||
for item in self.list_folders:
|
||||
self.item = item
|
||||
path = config['addons_path']+'/base_module_quality/'+item
|
||||
if os.path.exists(path+'/'+item+'.py') and item not in ['report', 'wizard', 'security']:
|
||||
if os.path.exists(path + '/' + item + '.py') and item not in ['report', 'wizard', 'security']:
|
||||
item2 = 'base_module_quality.' + item +'.' + item
|
||||
x = __import__(item2)
|
||||
x2 = getattr(x, item)
|
||||
@@ -87,7 +92,8 @@ class abstract_quality_check(object):
|
||||
def get_objects(self, cr, uid, module):
|
||||
# This function returns all object of the given module..
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
ids2 = pool.get('ir.model.data').search(cr, uid, [('module','=', module), ('model','=','ir.model')])
|
||||
ids2 = pool.get('ir.model.data').search(cr, uid,
|
||||
[('module', '=', module), ('model', '=', 'ir.model')])
|
||||
model_list = []
|
||||
model_data = pool.get('ir.model.data').browse(cr, uid, ids2)
|
||||
for model in model_data:
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<openerp>
|
||||
<data>
|
||||
<!--<wizard id="base_module_quality" model="ir.module.module" name="base.module.quality" string="Check the Quality of module"/>-->
|
||||
<wizard id="quality_detail_save" model="ir.module.module" name="quality_detail_save" string="Report Save" menu="False"/>
|
||||
|
||||
<record id="view_wizard_quality_check_tree" model="ir.ui.view">
|
||||
<field name="name">Results of Quality Checks</field>
|
||||
@@ -45,7 +46,8 @@
|
||||
<field name="state" readonly="1"/>
|
||||
</page>
|
||||
<page string="Detail">
|
||||
<field name="detail" widget="html_tag" nolabel="1" colspan="4" readonly="1"/>
|
||||
<button name="%(quality_detail_save)d" string="Save Report" type="action"/>
|
||||
<field name="detail" widget="text_html" nolabel="1" colspan="4" readonly="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
import os
|
||||
import tools
|
||||
from tools.translate import _
|
||||
|
||||
from base_module_quality import base_module_quality
|
||||
import pooler
|
||||
@@ -30,9 +31,6 @@ import re
|
||||
class quality_test(base_module_quality.abstract_quality_check):
|
||||
|
||||
def __init__(self):
|
||||
# '''
|
||||
# This test checks the quality of __terp__.py file in the selected module.
|
||||
# '''
|
||||
super(quality_test, self).__init__()
|
||||
self.name = _("Terp Test")
|
||||
self.note = _("This test checks if the module satisfies the current coding standard used by OpenERP.")
|
||||
@@ -94,16 +92,15 @@ class quality_test(base_module_quality.abstract_quality_check):
|
||||
feel_bad_factor += 1
|
||||
else:
|
||||
if not res[key]:
|
||||
feel_bad_factor += 1
|
||||
feel_bad_factor += 1
|
||||
|
||||
if key == 'installable' and not res[key]: # installable tag is provided and True
|
||||
if key == 'installable' and not res[key]: # installable tag is provided and False
|
||||
feel_bad_factor +=1
|
||||
else:
|
||||
feel_bad_factor += 1
|
||||
|
||||
score = round((feel_good_factor) / float(feel_good_factor + feel_bad_factor),2)
|
||||
|
||||
# self.result += "__terp__.py : "+ str(self.score) + "/10\n"
|
||||
return [_('__terp__.py file'), score]
|
||||
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
##############################################################################
|
||||
|
||||
import module_quality_check
|
||||
import quality_save_report
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import wizard
|
||||
from osv import osv
|
||||
import pooler
|
||||
from tools.translate import _
|
||||
|
||||
import base64
|
||||
|
||||
form_rep = '''<?xml version="1.0"?>
|
||||
<form string="Standard entries">
|
||||
<field name="module_file"/>
|
||||
</form>'''
|
||||
|
||||
|
||||
fields_rep = {
|
||||
'module_file': {'string': 'Save report', 'type': 'binary', 'required': True},
|
||||
}
|
||||
|
||||
def get_detail(self, cr, uid, datas, context={}):
|
||||
data = pooler.get_pool(cr.dbname).get('quality.check.detail').browse(cr, uid, datas['id'])
|
||||
data.detail = base64.encodestring(data.detail)
|
||||
return {'module_file':data.detail}
|
||||
|
||||
class save_report(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [get_detail],
|
||||
'result': {'type': 'form', 'arch':form_rep, 'fields':fields_rep, 'state':[('end','Cancel')]}
|
||||
},
|
||||
}
|
||||
save_report('quality_detail_save')
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -135,6 +135,9 @@ class hr_timesheet_sheet(osv.osv):
|
||||
result[sheet_id] = emp.state
|
||||
return result
|
||||
|
||||
def copy(self, cr, uid, ids, *args, **argv):
|
||||
raise osv.except_osv(_('Error !'), _('You can not duplicate a timesheet !'))
|
||||
|
||||
def button_confirm(self, cr, uid, ids, context):
|
||||
for sheet in self.browse(cr, uid, ids, context):
|
||||
di = sheet.user_id.company_id.timesheet_max_difference
|
||||
|
||||
@@ -40,12 +40,23 @@
|
||||
|
||||
""",
|
||||
'author': 'Tiny',
|
||||
'depends': ['account', 'account_report', 'base_vat', 'base_iban', 'account_chart'],
|
||||
'depends': [
|
||||
'account',
|
||||
'account_report',
|
||||
'base_vat',
|
||||
'base_iban',
|
||||
'account_chart'
|
||||
],
|
||||
'init_xml': [],
|
||||
'update_xml': ['account_pcmn_belgium.xml', 'l10n_be_wizard.xml',
|
||||
'l10n_be_sequence.xml', 'fiscal_templates.xml',
|
||||
'update_xml': [
|
||||
'account_pcmn_belgium.xml',
|
||||
'l10n_be_wizard.xml',
|
||||
'l10n_be_sequence.xml',
|
||||
'fiscal_templates.xml',
|
||||
],
|
||||
'demo_xml': [],
|
||||
'demo_xml': [
|
||||
'account.report.report.csv'
|
||||
],
|
||||
'installable': True,
|
||||
'certificate': '31977724637',
|
||||
}
|
||||
|
||||
@@ -359,7 +359,7 @@
|
||||
<field name="name">France PCMN</field>
|
||||
<field name="account_root_id" ref="l10n_fr.pcg_0"/>
|
||||
<field name="tax_code_root_id" ref="l10n_fr.vat_code_chart_root"/>
|
||||
<field name="bank_account_view_id" ref="l10n_fr.pcg_Comptes_50"/>
|
||||
<field name="bank_account_view_id" ref="l10n_fr.pcg_512000"/>
|
||||
<field name="property_account_receivable" ref="l10n_fr.a_recv"/>
|
||||
<field name="property_account_payable" ref="l10n_fr.a_pay"/>
|
||||
<field name="property_account_expense_categ" ref="l10n_fr.a_expense"/>
|
||||
|
||||
@@ -30,7 +30,6 @@ STATE = [
|
||||
('old', 'Old Member'),
|
||||
('waiting', 'Waiting Member'),
|
||||
('invoiced', 'Invoiced Member'),
|
||||
('associated', 'Associated Member'),
|
||||
('free', 'Free Member'),
|
||||
('paid', 'Paid Member'),
|
||||
]
|
||||
@@ -41,7 +40,6 @@ STATE_PRIOR = {
|
||||
'old' : 2,
|
||||
'waiting' : 3,
|
||||
'invoiced' : 4,
|
||||
'associated' : 5,
|
||||
'free' : 6,
|
||||
'paid' : 7
|
||||
}
|
||||
@@ -60,7 +58,6 @@ ELSE CASE WHEN MAX(members.state) = 1 THEN 'canceled'
|
||||
ELSE CASE WHEN MAX(members.state) = 2 THEN 'old'
|
||||
ELSE CASE WHEN MAX(members.state) = 3 THEN 'waiting'
|
||||
ELSE CASE WHEN MAX(members.state) = 4 THEN 'invoiced'
|
||||
ELSE CASE WHEN MAX(members.state) = 5 THEN 'associated'
|
||||
ELSE CASE WHEN MAX(members.state) = 6 THEN 'free'
|
||||
ELSE CASE WHEN MAX(members.state) = 7 THEN 'paid'
|
||||
END END END END END END END END
|
||||
@@ -288,23 +285,7 @@ class Partner(osv.osv):
|
||||
if partner_data.free_member and s!=0:
|
||||
res[id] = 'free'
|
||||
if partner_data.associate_member:
|
||||
assciate_partner = self.browse(cr,uid,partner_data.associate_member.id)
|
||||
cr.execute('select membership_state from res_partner where id=%s', (partner_data.id,))
|
||||
data_partner_state = cr.fetchall()
|
||||
for i in assciate_partner.member_lines:
|
||||
if i.date_from <= today and i.date_to >= today and i.account_invoice_line.invoice_id.state == 'paid' and s!=0 and data_partner_state[0][0] !='free':
|
||||
res[id] = 'associated'
|
||||
#
|
||||
# '''Compute membership state of partners'''
|
||||
# today = time.strftime('%Y-%m-%d')
|
||||
## res = {}
|
||||
## for id in ids:
|
||||
## res[id] = 'none'
|
||||
# clause = 'WHERE partner IN (' + ','.join([str(id) for id in ids]) + ')'
|
||||
# cr.execute(REQUETE % (today, today, today, today, today, today, clause))
|
||||
# fetches = cr.fetchall()
|
||||
# for fetch in fetches:
|
||||
# res[fetch[0]] = fetch[1]
|
||||
res[id] = partner_data.associate_member.membership_state
|
||||
return res
|
||||
|
||||
#no more need becaz of new functionality store attribut on function field
|
||||
@@ -327,7 +308,7 @@ class Partner(osv.osv):
|
||||
res = {}
|
||||
member_line_obj = self.pool.get('membership.membership_line')
|
||||
for partner in self.browse(cr, uid, ids):
|
||||
if partner.membership_state == 'associated':
|
||||
if partner.associate_member:
|
||||
partner_id = partner.associate_member.id
|
||||
else:
|
||||
partner_id = partner.id
|
||||
@@ -366,8 +347,7 @@ class Partner(osv.osv):
|
||||
for partner in self.browse(cr, uid, ids):
|
||||
cr.execute('select membership_state from res_partner where id=%s', (partner.id,))
|
||||
data_state = cr.fetchall()
|
||||
#if partner.membership_state == 'associated':
|
||||
if data_state[0][0] == 'associated':
|
||||
if partner.associate_member:
|
||||
partner_id = partner.associate_member.id
|
||||
else:
|
||||
partner_id = partner.id
|
||||
@@ -435,6 +415,13 @@ class Partner(osv.osv):
|
||||
|
||||
|
||||
_inherit = 'res.partner'
|
||||
def _get_partners(self, cr, uid, ids, context={}):
|
||||
ids2 = ids
|
||||
while ids2:
|
||||
ids2 = self.search(cr, uid, [('associate_member','in',ids2)], context=context)
|
||||
ids+=ids2
|
||||
return ids
|
||||
|
||||
_columns = {
|
||||
'member_lines': fields.one2many('membership.membership_line', 'partner',
|
||||
'Membership'),
|
||||
@@ -445,7 +432,7 @@ class Partner(osv.osv):
|
||||
'membership_state': fields.function(_membership_state, method=True, string='Current membership state',
|
||||
type='selection',selection=STATE,store={'account.invoice':(_get_invoice_partner,['state'], 10),
|
||||
'membership.membership_line':(_get_partner_id,['state'], 10),
|
||||
'res.partner':(lambda self,cr,uid,ids,c={}:ids, ['free_member'], 10)}),
|
||||
'res.partner':(_get_partners, ['free_member'], 10)}),
|
||||
# 'associate_member': fields.many2one('res.partner', 'Associate member'),
|
||||
'free_member': fields.boolean('Free member'),
|
||||
# 'membership_start': fields.function(_membership_start, method=True,
|
||||
|
||||
@@ -249,17 +249,17 @@ class product_template(osv.osv):
|
||||
'categ_id': fields.many2one('product.category','Category', required=True, change_default=True),
|
||||
'list_price': fields.float('Sale Price', digits=(16, int(config['price_accuracy'])), help="Base price for computing the customer price. Sometimes called the catalog price."),
|
||||
'standard_price': fields.float('Cost Price', required=True, digits=(16, int(config['price_accuracy'])), help="The cost of the product for accounting stock valorisation. It can serves as a base price for supplier price."),
|
||||
'volume': fields.float('Volume', help="The weight in Kg."),
|
||||
'weight': fields.float('Gross weight'),
|
||||
'weight_net': fields.float('Net weight'),
|
||||
'volume': fields.float('Volume', help="The volume in m3."),
|
||||
'weight': fields.float('Gross weight', help="The gross weight in Kg."),
|
||||
'weight_net': fields.float('Net weight', help="The net weight in Kg."),
|
||||
'cost_method': fields.selection([('standard','Standard Price'), ('average','Average Price')], 'Costing Method', required=True,
|
||||
help="Standard Price: the cost price is fixed and recomputed periodically (usually at the end of the year), Average Price: the cost price is recomputed at each reception of products."),
|
||||
'warranty': fields.float('Warranty (months)'),
|
||||
'sale_ok': fields.boolean('Can be sold', help="Determine if the product can be visible in the list of product within a selection from a sale order line."),
|
||||
'purchase_ok': fields.boolean('Can be Purchased', help="Determine if the product is visible in the list of products within a selection from a purchase order line."),
|
||||
'state': fields.selection([('',''),('draft', 'In Development'),('sellable','In Production'),('end','End of Lifecycle'),('obsolete','Obsolete')], 'Status', help="Tells the user if he can use the product or not."),
|
||||
'uom_id': fields.many2one('product.uom', 'Default UoM', required=True, help="Default Unit of Measure used for all stock operation."),
|
||||
'uom_po_id': fields.many2one('product.uom', 'Purchase UoM', required=True, help="Default Unit of Measure used for purchase orders. It must in the same category than the default unit of measure."),
|
||||
'state': fields.selection([('',''),('draft', 'In Development'),('sellable','In Production'),('end','End of Lifecycle'),('obsolete','Obsolete')], 'Status', help="Tells the user if he can use the product or not."),
|
||||
'uos_id' : fields.many2one('product.uom', 'Unit of Sale',
|
||||
help='Used by companies that manages two unit of measure: invoicing and stock management. For example, in food industries, you will manage a stock of ham but invoice in Kg. Keep empty to use the default UOM.'),
|
||||
'uos_coeff': fields.float('UOM -> UOS Coeff', digits=(16,4),
|
||||
@@ -284,6 +284,15 @@ class product_template(osv.osv):
|
||||
return context['categ_id']
|
||||
return False
|
||||
|
||||
def onchange_uom(self, cursor, user, ids, uom_id,uom_po_id):
|
||||
if uom_id and uom_po_id:
|
||||
uom_obj=self.pool.get('product.uom')
|
||||
uom=uom_obj.browse(cursor,user,[uom_id])[0]
|
||||
uom_po=uom_obj.browse(cursor,user,[uom_po_id])[0]
|
||||
if uom.category_id.id != uom_po.category_id.id:
|
||||
return {'value': {'uom_po_id': uom_id}}
|
||||
return False
|
||||
|
||||
_defaults = {
|
||||
'company_id': lambda self, cr, uid, context: \
|
||||
self.pool.get('res.users').browse(cr, uid, uid,
|
||||
|
||||
@@ -93,6 +93,15 @@
|
||||
</record>
|
||||
<menuitem id="menu_all_project" parent="project.menu_main" name="Projects"/>
|
||||
|
||||
<record id="open_view_project_all" model="ir.actions.act_window">
|
||||
<field name="name">All projects</field>
|
||||
<field name="res_model">project.project</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="domain">[]</field>
|
||||
<field name="view_id" ref="view_project"/>
|
||||
</record>
|
||||
<menuitem action="open_view_project_all" id="menu_open_view_project_all" parent="menu_all_project"/>
|
||||
|
||||
<record id="open_view_project_open" model="ir.actions.act_window">
|
||||
<field name="name">Running projects</field>
|
||||
<field name="res_model">project.project</field>
|
||||
@@ -100,7 +109,7 @@
|
||||
<field name="domain">[('state','=','open')]</field>
|
||||
<field name="view_id" ref="view_project"/>
|
||||
</record>
|
||||
<menuitem action="open_view_project_open" id="menu_open_view_project_open" parent="menu_all_project"/>
|
||||
<menuitem action="open_view_project_open" id="menu_open_view_project_open" parent="menu_open_view_project_all"/>
|
||||
|
||||
<record id="open_view_template_project" model="ir.actions.act_window">
|
||||
<field name="name">Template of Projects</field>
|
||||
|
||||
@@ -61,7 +61,7 @@ def _compute_tasks(cr, uid, task_list, date_begin):
|
||||
tasks[task.id] = []
|
||||
res = pooler.get_pool(cr.dbname).get('hr.timesheet.group').interval_get(cr, uid, task.project_id.timesheet_id.id, date_start, task.planned_hours)
|
||||
for (d1,d2) in res:
|
||||
tasks[task.id].append((d1, d2, task.name.decode('utf8'), task.user_id.login))
|
||||
tasks[task.id].append((d1, d2, task.name, task.user_id.login))
|
||||
date_close = tasks[task.id][-1][1]
|
||||
|
||||
# Store result
|
||||
|
||||
@@ -27,6 +27,7 @@ class report_workcenter_load(osv.osv):
|
||||
_name="report.workcenter.load"
|
||||
_description="Workcenter Load"
|
||||
_auto = False
|
||||
_log_access = False
|
||||
_columns = {
|
||||
'name': fields.char('Week', size=64, required=True),
|
||||
'workcenter_id': fields.many2one('mrp.workcenter', 'Workcenter', required=True),
|
||||
@@ -59,6 +60,7 @@ class report_mrp_inout(osv.osv):
|
||||
_name="report.mrp.inout"
|
||||
_description="Stock value variation"
|
||||
_auto = False
|
||||
_log_access = False
|
||||
_rec_name = 'date'
|
||||
_columns = {
|
||||
'date': fields.char('Week', size=64, required=True),
|
||||
|
||||
@@ -375,4 +375,4 @@
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
||||
</document>
|
||||
|
||||
@@ -367,6 +367,7 @@ class stock_picking(osv.osv):
|
||||
res[pick]['max_date'] = dt2
|
||||
return res
|
||||
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Reference', size=64, required=True, select=True),
|
||||
'origin': fields.char('Origin Reference', size=64),
|
||||
|
||||
Reference in New Issue
Block a user