parent
900b647f21
commit
83dc63d268
|
@ -851,13 +851,12 @@ class account_invoice_line(osv.osv):
|
|||
return {'domain':{'product_uom':[]}}
|
||||
else:
|
||||
return {'value': {'price_unit': 0.0}, 'domain':{'product_uom':[]}}
|
||||
lang=False
|
||||
part = self.pool.get('res.partner').browse(cr, uid, partner_id)
|
||||
lang=part.lang
|
||||
context.update({'lang': lang})
|
||||
res = self.pool.get('product.product').browse(cr, uid, product, context=context)
|
||||
taxep=None
|
||||
lang=self.pool.get('res.partner').read(cr, uid, [partner_id])[0]['lang']
|
||||
tax_obj = self.pool.get('account.tax')
|
||||
part = self.pool.get('res.partner').browse(cr, uid, partner_id)
|
||||
if type in ('out_invoice', 'out_refund'):
|
||||
tax_id = self.pool.get('account.fiscal.position').map_tax(cr, uid, part, res.taxes_id)
|
||||
else:
|
||||
|
|
|
@ -34,20 +34,20 @@ from tools.translate import _
|
|||
|
||||
class delivery_carrier(osv.osv):
|
||||
_name = "delivery.carrier"
|
||||
_description = "Carrier and delivery grids"
|
||||
_description = "Carrier and delivery grids"
|
||||
|
||||
def get_price(self, cr, uid, ids, field_name, arg=None, context={}):
|
||||
def get_price(self, cr, uid, ids, field_name, arg=None, context={}):
|
||||
res={}
|
||||
sale_obj=self.pool.get('sale.order')
|
||||
grid_obj=self.pool.get('delivery.grid')
|
||||
for carrier in self.browse(cr,uid,ids,context):
|
||||
order_id=context.get('order_id',False)
|
||||
price=False
|
||||
if order_id:
|
||||
if order_id:
|
||||
order = sale_obj.browse(cr, uid, [order_id])[0]
|
||||
carrier_grid=self.grid_get(cr,uid,[carrier.id],order.partner_shipping_id.id,context)
|
||||
price=grid_obj.get_price(cr, uid, carrier_grid, order, time.strftime('%Y-%m-%d'), context)
|
||||
res[carrier.id]=price
|
||||
price=grid_obj.get_price(cr, uid, carrier_grid, order, time.strftime('%Y-%m-%d'), context)
|
||||
res[carrier.id]=price
|
||||
return res
|
||||
_columns = {
|
||||
'name': fields.char('Carrier', size=64, required=True),
|
||||
|
@ -104,8 +104,8 @@ class delivery_grid(osv.osv):
|
|||
|
||||
total = 0
|
||||
weight = 0
|
||||
volume = 0
|
||||
for line in order.order_line:
|
||||
volume = 0
|
||||
for line in order.order_line:
|
||||
if not line.product_id:
|
||||
continue
|
||||
total += line.price_subtotal or 0.0
|
||||
|
|
|
@ -34,12 +34,9 @@ import ir
|
|||
import pooler
|
||||
from tools.translate import _
|
||||
|
||||
delivery_form = """<?xml version="1.0"?>
|
||||
<form string="Create deliveries">
|
||||
<separator colspan="4" string="Delivery Method" />
|
||||
<field name="carrier_id"/>
|
||||
</form>
|
||||
"""
|
||||
from tools.misc import UpdateableStr
|
||||
|
||||
delivery_form = UpdateableStr()
|
||||
|
||||
delivery_fields = {
|
||||
'carrier_id' : {'string':'Delivery Method', 'type':'many2one', 'relation': 'delivery.carrier','required':True}
|
||||
|
@ -48,6 +45,13 @@ delivery_fields = {
|
|||
def _delivery_default(self, cr, uid, data, context):
|
||||
order_obj = pooler.get_pool(cr.dbname).get('sale.order')
|
||||
order = order_obj.browse(cr, uid, data['ids'])[0]
|
||||
delivery_form.string="""<?xml version="1.0"?>
|
||||
<form string="Create deliveries">
|
||||
<separator colspan="4" string="Delivery Method" />
|
||||
<field name="carrier_id" context="{'order_id': %d}"/>
|
||||
</form>
|
||||
""" % (data['id'],)
|
||||
|
||||
|
||||
if not order.state in ('draft'):
|
||||
raise wizard.except_wizard(_('Order not in draft state !'), _('The order state have to be draft to add delivery lines.'))
|
||||
|
@ -80,7 +84,7 @@ def _delivery_set(self, cr, uid, data, context):
|
|||
'price_unit': grid_obj.get_price(cr, uid, grid.id, order, time.strftime('%Y-%m-%d'), context),
|
||||
'tax_id': [(6,0,taxes_ids)],
|
||||
'type': 'make_to_stock'
|
||||
})
|
||||
})
|
||||
|
||||
return {}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ _date_form = '''<?xml version="1.0"?>
|
|||
<field name="init_date"/>
|
||||
<field name="end_date"/>
|
||||
<field name="max_delay"/>
|
||||
<label string="Bellow this delay, the error is considered as volunteer" colspan="2"/>
|
||||
<label string="Bellow this delay, the error is considered to be voluntary" colspan="2"/>
|
||||
</form>'''
|
||||
|
||||
_date_fields = {
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<field domain="[('type','=','normal'),('state', '<>', 'close')]" name="account_id"/>
|
||||
<field name="name"/>
|
||||
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" sum="Total time"/>
|
||||
<field name="product_id" required="1"/>
|
||||
<field name="product_id" required="1" domain="[('type','=','service')]"/>
|
||||
<field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
|
||||
<field name="amount" sum="Total cost"/>
|
||||
<field name="general_account_id"/>
|
||||
|
@ -30,7 +30,7 @@
|
|||
<field name="date" select="1"/>
|
||||
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
|
||||
<newline/>
|
||||
<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" required="1"/>
|
||||
<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" required="1" domain="[('type','=','service')]"/>
|
||||
<field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
|
||||
|
||||
<field domain="[('type','=','normal'),('state', '<>', 'close')]" name="account_id" select="1"/>
|
||||
|
@ -86,7 +86,7 @@
|
|||
<field name="res_model">hr.analytic.timesheet</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('date', '=', time.strftime('%Y-%m-%d'))]</field>
|
||||
<field name="domain">[('date', '=', time.strftime('%Y-%m-%d'))]</field>
|
||||
</record>
|
||||
<menuitem action="act_hr_timesheet_line_evry1_today_form" id="menu_act_hr_timesheet_line_evry1_today_form" parent="menu_act_hr_timesheet_line_evry1_all_form"/>
|
||||
|
||||
|
@ -96,10 +96,10 @@
|
|||
<field name="inherit_id" ref="hr.view_employee_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<notebook position="inside">
|
||||
<page string="Timesheets">
|
||||
<field name="product_id"/>
|
||||
<field name="journal_id"/>
|
||||
</page>
|
||||
<page string="Timesheets">
|
||||
<field name="product_id" domain="[('type','=','service')]"/>
|
||||
<field name="journal_id"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -240,7 +240,7 @@ class product_template(osv.osv):
|
|||
return result
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=64, required=True, translate=True, select=True),
|
||||
'name': fields.char('Name', size=128, required=True, translate=True, select=True),
|
||||
'product_manager': fields.many2one('res.users','Product Manager'),
|
||||
'description': fields.text('Description',translate=True),
|
||||
'description_purchase': fields.text('Purchase Description',translate=True),
|
||||
|
|
|
@ -109,6 +109,11 @@ class project(osv.osv):
|
|||
res[id] = prog / tot
|
||||
return res
|
||||
|
||||
def unlink(self, cr, uid, ids, *args, **kwargs):
|
||||
for proj in self.browse(cr, uid, ids):
|
||||
if proj.tasks:
|
||||
raise osv.except_osv(_('Operation Not Permited !'), _('You can not delete a project with tasks. I suggest you to desactivate it.'))
|
||||
return super(project, self).unlink(cr, uid, ids, *args, **kwargs)
|
||||
_columns = {
|
||||
'name': fields.char("Project Name", size=128, required=True),
|
||||
'active': fields.boolean('Active'),
|
||||
|
|
Loading…
Reference in New Issue