[MERGE]:merged from trunk

bzr revid: apa@tinyerp.com-20101217043503-octac7onffgpvy6w
This commit is contained in:
apa (OpenERP)
2010-12-17 10:05:03 +05:30
14 changed files with 122 additions and 129 deletions
+1 -1
View File
@@ -580,7 +580,7 @@ class account_journal(osv.osv):
_name = "account.journal"
_description = "Journal"
_columns = {
'name': fields.char('Journal Name', size=64, required=True, translate=True),
'name': fields.char('Journal Name', size=64, required=True),
'code': fields.char('Code', size=5, required=True, help="The code will be used to generate the numbers of the journal entries of this journal."),
'type': fields.selection([('sale', 'Sale'),('sale_refund','Sale Refund'), ('purchase', 'Purchase'), ('purchase_refund','Purchase Refund'), ('cash', 'Cash'), ('bank', 'Bank and Cheques'), ('general', 'General'), ('situation', 'Opening/Closing Situation')], 'Type', size=32, required=True,
help="Select 'Sale' for Sale journal to be used at the time of making invoice."\
@@ -94,7 +94,7 @@ class account_entries_report(osv.osv):
return super(account_entries_report, self).search(cr, uid, args=args, offset=offset, limit=limit, order=order,
context=context, count=count)
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None):
def read_group(self, cr, uid, domain, *args, **kwargs):
todel=[]
fiscalyear_obj = self.pool.get('account.fiscalyear')
period_obj = self.pool.get('account.period')
@@ -112,7 +112,7 @@ class account_entries_report(osv.osv):
for a in [['period_id','in','current_year'], ['period_id','in','current_period']]:
if a in domain:
domain.remove(a)
return super(account_entries_report, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context)
return super(account_entries_report, self).read_group(cr, uid, domain, *args, **kwargs)
def init(self, cr):
tools.drop_view_if_exists(cr, 'account_entries_report')
+12 -24
View File
@@ -131,32 +131,20 @@
</stylesheet>
<story>
<pto>
<pto_header>
<blockTable colWidths="202.0,87.0,71.0,57.0,42.0,71.0" style="Table7">
<tr>
<td>
<para style="terp_tblheader_Details">Description</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Taxes</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Quantity</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Unit Price </para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Disc.(%)</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Price</para>
</td>
</tr>
</blockTable>
</pto_header>
<para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
<para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
<pto_header><!-- Must be after setLang() -->
<blockTable colWidths="202.0,87.0,71.0,57.0,42.0,71.0" style="Table7">
<tr>
<td> <para style="terp_tblheader_Details">Description</para> </td>
<td> <para style="terp_tblheader_Details_Centre">Taxes</para> </td>
<td> <para style="terp_tblheader_Details_Centre">Quantity</para> </td>
<td> <para style="terp_tblheader_Details_Right">Unit Price </para> </td>
<td> <para style="terp_tblheader_Details_Right">Disc.(%)</para> </td>
<td> <para style="terp_tblheader_Details_Right">Price</para> </td>
</tr>
</blockTable>
</pto_header>
<blockTable colWidths="297.0,233.0" style="Table_Partner_Address">
<tr>
<td>
@@ -55,14 +55,14 @@ class account_followup_stat(osv.osv):
return super(account_followup_stat, self).search(cr, uid, args=args, offset=offset, limit=limit, order=order,
context=context, count=count)
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None):
def read_group(self, cr, uid, domain, *args, **kwargs):
for arg in domain:
if arg[0] == 'period_id' and arg[2] == 'current_year':
current_year = self.pool.get('account.fiscalyear').find(cr, uid)
ids = self.pool.get('account.fiscalyear').read(cr, uid, [current_year], ['period_ids'])[0]['period_ids']
domain.append(['period_id','in',ids])
domain.remove(arg)
return super(account_followup_stat, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context)
return super(account_followup_stat, self).read_group(cr, uid, domain, *args, **kwargs)
def init(self, cr):
tools.drop_view_if_exists(cr, 'account_followup_stat')
+1 -1
View File
@@ -117,7 +117,7 @@
</group>
<notebook colspan="4">
<page string="Purchase Order">
<field name="partner_id" on_change="onchange_partner_id(partner_id)" domain="[('supplier','=',True)]" context="{'search_default_supplier':1}" />
<field name="partner_id" on_change="onchange_partner_id(partner_id)" context="{'search_default_supplier':1}" />
<field name="partner_address_id"/>
<field domain="[('type','=','purchase')]" name="pricelist_id" groups="base.group_extended"/>
<field name="origin" groups="base.group_extended"/>
+5 -5
View File
@@ -76,16 +76,16 @@ class stock_picking(osv.osv):
'invoice_ids': fields.many2many('account.invoice', 'picking_invoice_rel', 'picking_id', 'invoice_id', 'Invoices', domain=[('type', '=', 'out_invoice')]),
}
def create_invoice(self, cr, uid, ids, *args):
def action_invoice_create(self, cr, uid, ids, journal_id=False,
group=False, type='out_invoice', context=None):
# need to carify with new requirement
invoice_ids = []
margin_deduce = 0.0
picking_obj = self.pool.get('stock.picking')
picking_obj.write(cr, uid, ids, {'invoice_state': '2binvoiced'})
res = picking_obj.action_invoice_create(cr, uid, ids, type='out_invoice', context={})
res = super(stock_picking, self).action_invoice_create(cr, uid, ids, journal_id=False,
group=False, type='out_invoice', context=None)
invoice_ids = res.values()
picking_obj.write(cr, uid, ids, {'invoice_ids': [[6, 0, invoice_ids]]})
return True
return res
stock_picking()
+74 -78
View File
@@ -2,84 +2,80 @@
<openerp>
<data>
<record model="ir.ui.view" id="sale_margin_sale_order">
<field name="name">sale.order.margin.view.form</field>
<field name="type">form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
<field name="amount_total" position="after">
<field name="margin"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="sale_margin_sale_order_line">
<field name="name">sale.order.line.margin.view.form</field>
<field name="type">form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='order_line']/form/notebook/page/field[@name='price_unit']" position="after">
<field name="purchase_price"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="sale_margin_sale_order_line_form">
<field name="name">sale.order.line.tree.margin.view.form</field>
<field name="type">form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='order_line']/tree/field[@name='price_unit']" position="after">
<field name="purchase_price"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="sale_margin_sale_order_tree">
<field name="name">sale.order.margin.view.tree</field>
<field name="type">tree</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_tree" />
<field name="arch" type="xml">
<field name="state" position="after">
<field name="margin"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="sale_margin_sale_order_line_tree">
<field name="name">sale.order.margin.line.view.tree</field>
<field name="type">tree</field>
<field name="model">sale.order.line</field>
<field name="inherit_id" ref="sale.view_order_line_tree" />
<field name="arch" type="xml">
<field name="price_subtotal" position="after">
<field name="margin"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="sale_margin_sale_order">
<field name="name">sale.order.margin.view.form</field>
<field name="type">form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
<field name="amount_total" position="after">
<field name="margin"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="sale_margin_sale_order_line">
<field name="name">sale.order.line.margin.view.form</field>
<field name="type">form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='order_line']/form/notebook/page/field[@name='price_unit']" position="after">
<field name="purchase_price"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="sale_margin_sale_order_line_form">
<field name="name">sale.order.line.tree.margin.view.form</field>
<field name="type">form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='order_line']/tree/field[@name='price_unit']" position="after">
<field name="purchase_price"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="sale_margin_sale_order_tree">
<field name="name">sale.order.margin.view.tree</field>
<field name="type">tree</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_tree" />
<field name="arch" type="xml">
<field name="state" position="after">
<field name="margin"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="sale_margin_sale_order_line_tree">
<field name="name">sale.order.margin.line.view.tree</field>
<field name="type">tree</field>
<field name="model">sale.order.line</field>
<field name="inherit_id" ref="sale.view_order_line_tree" />
<field name="arch" type="xml">
<field name="price_subtotal" position="after">
<field name="margin"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="view_picking_margin_out_form">
<field name="name">picking.margin.view.form</field>
<field name="type">form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_out_form" />
<field name="arch" type="xml">
<xpath expr="/form/notebook/page[@string='Additional info']" position="after">
<page string="Customer Invoices">
<field colspan="4" name="invoice_ids" nolabel="1"/>
</page>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="view_picking_margin_out_form">
<field name="name">picking.margin.view.form</field>
<field name="type">form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_out_form" />
<field name="arch" type="xml">
<xpath expr="/form/notebook/page[@string='Additional info']" position="after">
<page string="Customer Invoices">
<field colspan="4" name="invoice_ids" nolabel="1"/>
<group col="10" colspan="4">
<label colspan="6"/>
<button name="create_invoice" icon='gtk-execute' string="Create Invoice" type="object"/>
</group>
</page>
</xpath>
</field>
</record>
</data>
</openerp>
+6 -1
View File
@@ -3,7 +3,7 @@
"access_stock_incoterms_manager","stock.incoterms manager","model_stock_incoterms","stock.group_stock_manager",1,1,1,1
"access_stock_warehouse_manager","stock.warehouse.manager","model_stock_warehouse","stock.group_stock_manager",1,1,1,1
"access_stock_warehouse_user","stock.warehouse.user","model_stock_warehouse","base.group_user",1,0,0,0
"access_stock_location_manager","stock.location.manager","model_stock_location","stock.group_stock_manager",1,0,0,0
"access_stock_location_manager","stock.location.manager","model_stock_location","stock.group_stock_manager",1,1,1,1
"access_stock_location_user","stock.location.user","model_stock_location","base.group_user",1,0,0,0
"access_stock_journal_user","stock.journal.user","model_stock_journal","base.group_user",1,0,0,0
"access_stock_journal_manager","stock.journal.manager","model_stock_journal","stock.group_stock_manager",1,1,1,1
@@ -33,3 +33,8 @@
"access_product_template_stock_user","product.template stock user","product.model_product_template","stock.group_stock_user",1,0,0,0
"access_product_product_stock_manager","product_product_stock_manager","product.model_product_product","stock.group_stock_manager",1,0,0,0
"access_product_template_stock_manager","product.template stock manager","product.model_product_template","stock.group_stock_manager",1,0,0,0
"access_account_invoice_user","account.invoice stock user","account.model_account_invoice","stock.group_stock_user",1,1,1,0
"access_account_invoice_line_user","account.invoice.line stock user","account.model_account_invoice_line","stock.group_stock_user",1,1,1,0
"access_account_invoice_tax_user","account.invoice.tax stock user","account.model_account_invoice_tax","stock.group_stock_user",1,1,1,0
"access_account_journal_user","account.journal stock user","account.model_account_journal","stock.group_stock_user",1,0,0,0
"access_account_fiscalyear","account.fiscalyear stock user","account.model_account_fiscalyear","stock.group_stock_user",1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
3 access_stock_incoterms_manager stock.incoterms manager model_stock_incoterms stock.group_stock_manager 1 1 1 1
4 access_stock_warehouse_manager stock.warehouse.manager model_stock_warehouse stock.group_stock_manager 1 1 1 1
5 access_stock_warehouse_user stock.warehouse.user model_stock_warehouse base.group_user 1 0 0 0
6 access_stock_location_manager stock.location.manager model_stock_location stock.group_stock_manager 1 0 1 0 1 0 1
7 access_stock_location_user stock.location.user model_stock_location base.group_user 1 0 0 0
8 access_stock_journal_user stock.journal.user model_stock_journal base.group_user 1 0 0 0
9 access_stock_journal_manager stock.journal.manager model_stock_journal stock.group_stock_manager 1 1 1 1
33 access_product_template_stock_user product.template stock user product.model_product_template stock.group_stock_user 1 0 0 0
34 access_product_product_stock_manager product_product_stock_manager product.model_product_product stock.group_stock_manager 1 0 0 0
35 access_product_template_stock_manager product.template stock manager product.model_product_template stock.group_stock_manager 1 0 0 0
36 access_account_invoice_user account.invoice stock user account.model_account_invoice stock.group_stock_user 1 1 1 0
37 access_account_invoice_line_user account.invoice.line stock user account.model_account_invoice_line stock.group_stock_user 1 1 1 0
38 access_account_invoice_tax_user account.invoice.tax stock user account.model_account_invoice_tax stock.group_stock_user 1 1 1 0
39 access_account_journal_user account.journal stock user account.model_account_journal stock.group_stock_user 1 0 0 0
40 access_account_fiscalyear account.fiscalyear stock user account.model_account_fiscalyear stock.group_stock_user 1 0 0 0
@@ -3,8 +3,10 @@
"access_product_pulled_flow_manager","product_pulled_flow manager","model_product_pulled_flow","stock.group_stock_manager",1,1,1,1
"access_product_pulled_flow_partner_manager","product_pulled_flow partner manager","model_product_pulled_flow","product.group_product_manager",1,1,1,1
"access_stock_location_path_user","stock location path user","model_stock_location_path","stock.group_stock_user",1,0,0,0
"access_stock_location_path_internal_user","stock location path internal user","model_stock_location_path","base.group_user",1,0,0,0
"access_stock_location_path_manager","stock location path manager","model_stock_location_path","stock.group_stock_manager",1,1,1,1
"access_stock_location_path_partner_manager","stock.location.path partner manager","model_stock_location_path","product.group_product_manager",1,1,1,1
"access_stock_location_path_stock_user","stock.location.path stock user","model_stock_location_path","stock.group_stock_user",1,1,1,1
"access_stock_location_path","stock.location.path","model_stock_location_path","base.group_sale_salesman",1,0,0,0
"access_product_pulled_flow","product.pulled.flow","model_product_pulled_flow","base.group_sale_salesman",1,0,0,0
"access_product_pulled_flow_internal","product.pulled.flow internal","model_product_pulled_flow","base.group_user",1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
3 access_product_pulled_flow_manager product_pulled_flow manager model_product_pulled_flow stock.group_stock_manager 1 1 1 1
4 access_product_pulled_flow_partner_manager product_pulled_flow partner manager model_product_pulled_flow product.group_product_manager 1 1 1 1
5 access_stock_location_path_user stock location path user model_stock_location_path stock.group_stock_user 1 0 0 0
6 access_stock_location_path_internal_user stock location path internal user model_stock_location_path base.group_user 1 0 0 0
7 access_stock_location_path_manager stock location path manager model_stock_location_path stock.group_stock_manager 1 1 1 1
8 access_stock_location_path_partner_manager stock.location.path partner manager model_stock_location_path product.group_product_manager 1 1 1 1
9 access_stock_location_path_stock_user stock.location.path stock user model_stock_location_path stock.group_stock_user 1 1 1 1
10 access_stock_location_path stock.location.path model_stock_location_path base.group_sale_salesman 1 0 0 0
11 access_product_pulled_flow product.pulled.flow model_product_pulled_flow base.group_sale_salesman 1 0 0 0
12 access_product_pulled_flow_internal product.pulled.flow internal model_product_pulled_flow base.group_user 1 0 0 0
+2 -2
View File
@@ -65,8 +65,8 @@ class product_pulled_flow(osv.osv):
_columns = {
'name': fields.char('Name', size=64, required=True, help="This field will fill the packing Origin and the name of its moves"),
'cancel_cascade': fields.boolean('Cancel Cascade', help="Allow you to cancel moves related to the product pull flow"),
'location_id': fields.many2one('stock.location','Location', required=True, help="Is the destination location that needs supplying"),
'location_src_id': fields.many2one('stock.location','Location Source', help="Location used by Destination Location to supply"),
'location_id': fields.many2one('stock.location','Destination Location', required=True, help="Is the destination location that needs supplying"),
'location_src_id': fields.many2one('stock.location','Source Location', help="Location used by Destination Location to supply"),
'journal_id': fields.many2one('stock.journal','Journal'),
'procure_method': fields.selection([('make_to_stock','Make to Stock'),('make_to_order','Make to Order')], 'Procure Method', required=True, help="'Make to Stock': When needed, take from the stock or wait until re-supplying. 'Make to Order': When needed, purchase or produce for the procurement request."),
'type_proc': fields.selection([('produce','Produce'),('buy','Buy'),('move','Move')], 'Type of Procurement', required=True),
@@ -40,14 +40,14 @@
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<notebook position="inside">
<page string="Logistics Flow">
<page string="Logistics Flows">
<field name="flow_pull_ids" editable="bottom" colspan="4" nolabel="1">
<tree string="Pulled flows">
<field name="name"/>
<field name="location_id" attrs="{'required': [('type_proc', '=', 'move')]}"/>
<field name="type_proc"/>
<field name="name"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="journal_id" groups="base.group_extended"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
<form string="Pulled Paths">
<separator string="Conditions" colspan="4"/>
+9 -7
View File
@@ -21,6 +21,7 @@
from osv import fields, osv
import pooler
import tools
import logging
from service import security
import ldap
from ldap.filter import filter_format
@@ -66,9 +67,9 @@ class users(osv.osv):
_inherit = "res.users"
def login(self, db, login, password):
ret = super(users,self).login(db, login, password)
tools.debug(ret)
if ret:
return ret
logger = logging.getLogger('orm.ldap')
pool = pooler.get_pool(db)
cr = pooler.get_db(db).cursor()
action_obj = pool.get('ir.actions.actions')
@@ -78,7 +79,7 @@ class users(osv.osv):
FROM res_company_ldap
WHERE ldap_server != '' and ldap_binddn != '' ORDER BY sequence""")
for res_company_ldap in cr.dictfetchall():
tools.debug(res_company_ldap)
logger.debug(res_company_ldap)
try:
l = ldap.open(res_company_ldap['ldap_server'], res_company_ldap['ldap_server_port'])
if l.simple_bind_s(res_company_ldap['ldap_binddn'], res_company_ldap['ldap_password']):
@@ -93,13 +94,13 @@ class users(osv.osv):
continue
if result_type == ldap.RES_SEARCH_RESULT and len(result_data) == 1:
dn = result_data[0][0]
tools.debug(dn)
logger.debug(dn)
name = result_data[0][1]['cn'][0]
if l.bind_s(dn, password):
l.unbind()
cr.execute("SELECT id FROM res_users WHERE login=%s",(tools.ustr(login),))
res = cr.fetchone()
tools.debug(res)
logger.debug(res)
if res:
cr.close()
return res[0]
@@ -127,7 +128,7 @@ class users(osv.osv):
return res
l.unbind()
except Exception, e:
tools.debug(e)
logger.warning("Cannot auth", exc_info=True)
continue
cr.close()
return False
@@ -135,10 +136,11 @@ class users(osv.osv):
def check(self, db, uid, passwd):
try:
return super(users,self).check(db, uid, passwd)
except: # AccessDenied
except security.ExceptionNoTb: # AccessDenied
pass
cr = pooler.get_db(db).cursor()
user = self.browse(cr, 1, uid)
logger = logging.getLogger('orm.ldap')
if user and user.company_id.ldaps:
for res_company_ldap in user.company_id.ldaps:
try:
@@ -161,7 +163,7 @@ class users(osv.osv):
return True
l.unbind()
except Exception, e:
tools.debug(e)
logger.warning('cannot check', exc_info=True)
pass
cr.close()
raise security.ExceptionNoTb('AccessDenied')
+1 -1
View File
@@ -32,7 +32,7 @@ class publisher_warranty_contract(osv.osv):
@cache(skiparg=3)
def get_default_livechat_text(self, cr, uid):
return '<a href="http://www.openerp.com/services/subscribe-onsite" target="_blank">OpenERP Publisher\'s Warranty</a>'
return '<a href="http://www.openerp.com/services/subscribe-onsite" target="_blank"><img src="/web_livechat/static/images/busy.png"/>Online Support</a>'
publisher_warranty_contract()
+2 -2
View File
@@ -82,8 +82,8 @@ class HeaderTemplateEditor(openobject.templating.TemplateEditor):
skill: '0',
type: 'text',
labels: {
online: '<img src="/web_livechat/static/images/online.png"/>Need Help?',
offline: '<img src="/web_livechat/static/images/offline.png"/>Leave us a message'
online: '<img src="/web_livechat/static/images/available.png"/>Online Support',
offline: '<img src="/web_livechat/static/images/away.png"/>Online Support'
}
});
</script>