[MERGE] merged the dev team2 branch

bzr revid: qdp-launchpad@tinyerp.com-20101126161359-s02ik0bmz3l8lt9u
This commit is contained in:
qdp-launchpad@tinyerp.com 2010-11-26 17:13:59 +01:00
commit 382779126a
206 changed files with 1142 additions and 704 deletions

View File

@ -122,7 +122,7 @@ class account_payment_term_line(osv.osv):
return True return True
_constraints = [ _constraints = [
(_check_percent, _('Percentages for Payment Term Line must be between 0 and 1, Example: 0.02 for 2% '), ['value_amount']), (_check_percent, 'Percentages for Payment Term Line must be between 0 and 1, Example: 0.02 for 2% ', ['value_amount']),
] ]
account_payment_term_line() account_payment_term_line()

View File

@ -246,7 +246,7 @@ class account_cash_statement(osv.osv):
] ]
open_jrnl = self.search(cr, uid, sql) open_jrnl = self.search(cr, uid, sql)
if open_jrnl: if open_jrnl:
raise osv.except_osv('Error', _('You can not have two open register for the same journal')) raise osv.except_osv(_('Error'), _('You can not have two open register for the same journal'))
if self.pool.get('account.journal').browse(cr, uid, vals['journal_id']).type == 'cash': if self.pool.get('account.journal').browse(cr, uid, vals['journal_id']).type == 'cash':
open_close = self._get_cash_open_close_box_lines(cr, uid, context) open_close = self._get_cash_open_close_box_lines(cr, uid, context)

View File

@ -63,7 +63,9 @@
<field domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/> <field domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
<newline/> <newline/>
<field name="company_id" groups="base.group_multi_company" readonly="1"/> <field name="company_id" groups="base.group_multi_company" readonly="1"/>
<field colspan="4" name="invoice_line_tax_id" context="{'type':parent.type}" domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]"/> <separator colspan="4" string="Taxes"/>
<field colspan="4" name="invoice_line_tax_id" context="{'type':parent.type}" domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]"
nolabel="1"/>
</page> </page>
<page string="Notes"> <page string="Notes">
<field colspan="4" name="note" nolabel="1"/> <field colspan="4" name="note" nolabel="1"/>

View File

@ -5697,6 +5697,7 @@ msgstr ""
#: code:addons/account/invoice.py:0 #: code:addons/account/invoice.py:0
#: code:addons/account/wizard/account_invoice_refund.py:0 #: code:addons/account/wizard/account_invoice_refund.py:0
#: code:addons/account/wizard/account_use_model.py:0 #: code:addons/account/wizard/account_use_model.py:0
#: code:addons/account/account_cash_statement.py:0
#, python-format #, python-format
msgid "Error !" msgid "Error !"
msgstr "" msgstr ""
@ -6269,6 +6270,12 @@ msgstr ""
msgid "You can not have two open register for the same journal" msgid "You can not have two open register for the same journal"
msgstr "" msgstr ""
#. module: account
#: code:addons/account/account_cash_statement.py:0
#, python-format
msgid "You cannot create a bank or cash register without a journal!"
msgstr ""
#. module: account #. module: account
#: view:account.payment.term.line:0 #: view:account.payment.term.line:0
msgid " day of the month= -1" msgid " day of the month= -1"

View File

@ -2,6 +2,10 @@
<openerp> <openerp>
<data noupdate="1"> <data noupdate="1">
<record id="base.user_demo" model="res.users">
<field eval="[(4, ref('group_auction_user'))]" name="groups_id"/>
</record>
<!-- demo data for Account --> <!-- demo data for Account -->
<record model="account.account.type" id="account.account_type_tax"> <record model="account.account.type" id="account.account_type_tax">
<field name="name">Tax</field> <field name="name">Tax</field>

View File

@ -312,6 +312,54 @@ msgstr ""
msgid "The Buyer \"%s\" has no Invoice Address." msgid "The Buyer \"%s\" has no Invoice Address."
msgstr "" msgstr ""
#. module: auction
#: code:addons/auction/wizard/auction_pay_buy.py:0
#, python-format
msgid "Payment aborted !"
msgstr ""
#. module: auction
#: code:addons/auction/wizard/auction_pay_buy.py:0
#, python-format
msgid "You should pay all the total: "%.2f" are missing to accomplish the payment."
msgstr ""
#. module: auction
#: code:addons/auction/wizard/auction_pay_buy.py:0
#, python-format
msgid "Error!"
msgstr ""
#. module: auction
#: code:addons/auction/wizard/auction_catalog_flagey_report.py:0
#, python-format
msgid "No Lots belong to this Auction Date"
msgstr ""
#. module: auction
#: code:addons/auction/wizard/auction_lots_numerotate.py:0
#, python-format
msgid "This record does not exist !"
msgstr ""
#. module: auction
#: code:addons/auction/wizard/auction_lots_numerotate.py:0
#, python-format
msgid "This lot does not exist !"
msgstr ""
#. module: auction
#: code:addons/auction/wizard/auction_lots_buyer_map.py:0
#, python-format
msgid "No buyer is set for this lot."
msgstr ""
#. module: auction
#: code:addons/auction/wizard/auction_pay_buy.py:0
#, python-format
msgid "No auction date for "%s": Please set one."
msgstr ""
#. module: auction #. module: auction
#: view:auction.dates:0 #: view:auction.dates:0
msgid "Commissions" msgid "Commissions"
@ -663,6 +711,7 @@ msgstr ""
#. module: auction #. module: auction
#: code:addons/auction/wizard/auction_lots_invoice.py:0 #: code:addons/auction/wizard/auction_lots_invoice.py:0
#: code:addons/auction/wizard/auction_lots_numerotate.py:0
#, python-format #, python-format
msgid "UserError" msgid "UserError"
msgstr "" msgstr ""

View File

@ -8,6 +8,6 @@
<record id="group_auction_user" model="res.groups"> <record id="group_auction_user" model="res.groups">
<field name="name">Auction / User</field> <field name="name">Auction / User</field>
</record> </record>
</data> </data>
</openerp> </openerp>

View File

@ -21,6 +21,7 @@
from osv import osv, fields from osv import osv, fields
import netsvc import netsvc
from tools.translate import _
class auction_catalog_flagey(osv.osv_memory): class auction_catalog_flagey(osv.osv_memory):
_name = 'auction.catalog.flagey' _name = 'auction.catalog.flagey'
@ -57,7 +58,7 @@ class auction_catalog_flagey(osv.osv_memory):
v_ids = lots_obj.browse(cr, uid, v_lots) v_ids = lots_obj.browse(cr, uid, v_lots)
for ab in v_ids: for ab in v_ids:
if not ab.auction_id : if not ab.auction_id :
raise osv.except_osv('Error!','No Lots belong to this Auction Date') raise osv.except_osv(_('Error!'), _('No Lots belong to this Auction Date'))
pass pass
def print_report(self, cr, uid, ids, context): def print_report(self, cr, uid, ids, context):

View File

@ -67,7 +67,7 @@ class wiz_auc_lots_buyer_map(osv.osv_memory):
lots_obj = self.pool.get('auction.lots') lots_obj = self.pool.get('auction.lots')
for rec in lots_obj.browse(cr, uid, ids, context): for rec in lots_obj.browse(cr, uid, ids, context):
if (len(ids)==1) and (not rec.ach_uid and not rec.ach_login): if (len(ids)==1) and (not rec.ach_uid and not rec.ach_login):
raise osv.except_osv('Error', 'No buyer is set for this lot.') raise osv.except_osv(_('Error'), _('No buyer is set for this lot.'))
if not rec.ach_uid and rec.ach_login: if not rec.ach_uid and rec.ach_login:
return {'ach_login': rec.ach_login} return {'ach_login': rec.ach_login}
return {} return {}

View File

@ -99,7 +99,7 @@ class auction_lots_numerotate_per_lot(osv.osv_memory):
('lot_num','=',int(datas['lot_num']))]) ('lot_num','=',int(datas['lot_num']))])
found = [r for r in res if r in record_ids] found = [r for r in res if r in record_ids]
if len(found)==0: if len(found)==0:
raise osv.except_osv('UserError', 'This record does not exist !') raise osv.except_osv(_('UserError'), _('This record does not exist !'))
lots_obj.write(cr, uid, found, {'obj_num':int(datas['obj_num'])} ) lots_obj.write(cr, uid, found, {'obj_num':int(datas['obj_num'])} )
view_id = data_obj._get_id(cr, uid, 'auction', 'view_auction_numerotate') view_id = data_obj._get_id(cr, uid, 'auction', 'view_auction_numerotate')
if view_id: if view_id:
@ -125,7 +125,7 @@ class auction_lots_numerotate_per_lot(osv.osv_memory):
('lot_num','=',int(datas['lot_num']))]) ('lot_num','=',int(datas['lot_num']))])
found = [r for r in res if r in record_ids] found = [r for r in res if r in record_ids]
if len(found)==0: if len(found)==0:
raise osv.except_osv('UserError', 'This record does not exist !') raise osv.except_osv(_('UserError'), _('This record does not exist !'))
lots_datas = lots_obj.read(cr, uid, found, lots_datas = lots_obj.read(cr, uid, found,
['obj_num', 'name', 'lot_est1', ['obj_num', 'name', 'lot_est1',
'lot_est2', 'obj_desc']) 'lot_est2', 'obj_desc'])
@ -141,7 +141,7 @@ class auction_lots_numerotate_per_lot(osv.osv_memory):
('lot_num','=',int(datas['lot_num']))]) ('lot_num','=',int(datas['lot_num']))])
found = [r for r in res if r in record_ids] found = [r for r in res if r in record_ids]
if len(found)==0: if len(found)==0:
raise osv.except_osv('Error', 'This lot does not exist !') raise osv.except_osv(_('Error'), _('This lot does not exist !'))
view_id = data_obj._get_id(cr, uid, 'auction', 'view_auction_lots_numerotate_second') view_id = data_obj._get_id(cr, uid, 'auction', 'view_auction_lots_numerotate_second')
if view_id: if view_id:
res_id = data_obj.browse(cr, uid, view_id, context=context).res_id res_id = data_obj.browse(cr, uid, view_id, context=context).res_id

View File

@ -76,14 +76,14 @@ class auction_pay_buy(osv.osv_memory):
for datas in self.read(cr, uid, ids): for datas in self.read(cr, uid, ids):
if not abs(datas['total'] - (datas['amount'] + datas['amount2'] + datas['amount3'])) <0.01: if not abs(datas['total'] - (datas['amount'] + datas['amount2'] + datas['amount3'])) <0.01:
rest = datas['total'] - (datas['amount'] + datas['amount2'] + datas['amount3']) rest = datas['total'] - (datas['amount'] + datas['amount2'] + datas['amount3'])
raise osv.except_osv('Payment aborted !', 'You should pay all the total: "%.2f" are missing to accomplish the payment.' %(round(rest, 2))) raise osv.except_osv(_('Payment aborted !'), _('You should pay all the total: "%.2f" are missing to accomplish the payment.') %(round(rest, 2)))
lots = lot_obj.browse(cr, uid, context['active_ids'], context) lots = lot_obj.browse(cr, uid, context['active_ids'], context)
for lot in lots: for lot in lots:
if datas['buyer_id']: if datas['buyer_id']:
lot_obj.write(cr, uid, [lot.id], {'ach_uid': datas['buyer_id']}) lot_obj.write(cr, uid, [lot.id], {'ach_uid': datas['buyer_id']})
if not lot.auction_id: if not lot.auction_id:
raise osv.except_osv('Error !', 'No auction date for "%s": Please set one.'%(lot.name)) raise osv.except_osv(_('Error!'), _('No auction date for "%s": Please set one.') % (lot.name))
lot_obj.write(cr, uid, [lot.id], {'is_ok':True}) lot_obj.write(cr, uid, [lot.id], {'is_ok':True})
for st, stamount in [('statement_id1', 'amount'), ('statement_id2', 'amount2'), ('statement_id3', 'amount3')]: for st, stamount in [('statement_id1', 'amount'), ('statement_id2', 'amount2'), ('statement_id3', 'amount3')]:

View File

@ -1089,9 +1089,9 @@ class calendar_event(osv.osv):
cr.execute("UPDATE %s set exrule=Null where id=%%s" % self._table,( event,)) cr.execute("UPDATE %s set exrule=Null where id=%%s" % self._table,( event,))
elif datas.get('rrule_type') == 'custom': elif datas.get('rrule_type') == 'custom':
if datas.get('interval', 0) < 0: if datas.get('interval', 0) < 0:
raise osv.except_osv('Warning!', 'Interval can not be Negative') raise osv.except_osv(_('Warning!'), _('Interval can not be Negative'))
if datas.get('count', 0) < 0: if datas.get('count', 0) < 0:
raise osv.except_osv('Warning!', 'Count can not be Negative') raise osv.except_osv(_('Warning!'), _('Count can not be Negative'))
rrule_custom = self.compute_rule_string(cr, uid, datas, \ rrule_custom = self.compute_rule_string(cr, uid, datas, \
context=context) context=context)
result[event] = rrule_custom result[event] = rrule_custom

View File

@ -146,6 +146,24 @@ msgstr ""
msgid "Warning !" msgid "Warning !"
msgstr "" msgstr ""
#. module: base_calendar
#: code:addons/base_calendar/base_calendar.py:0
#, python-format
msgid "Warning!"
msgstr ""
#. module: base_calendar
#: code:addons/base_calendar/base_calendar.py:0
#, python-format
msgid "Interval can not be Negative"
msgstr ""
#. module: base_calendar
#: code:addons/base_calendar/base_calendar.py:0
#, python-format
msgid "Count can not be Negative"
msgstr ""
#. module: base_calendar #. module: base_calendar
#: selection:base.calendar.set.exrule,week_list:0 #: selection:base.calendar.set.exrule,week_list:0
#: selection:calendar.event,week_list:0 #: selection:calendar.event,week_list:0

View File

@ -2,6 +2,10 @@
<openerp> <openerp>
<data> <data>
<record id="base.user_demo" model="res.users">
<field eval="[(4, ref('base.group_sale_salesman'))]" name="groups_id"/>
</record>
<!-- Create the contacts --> <!-- Create the contacts -->
<record id="res_partner_contact_mortier0" model="res.partner.contact"> <record id="res_partner_contact_mortier0" model="res.partner.contact">
<field eval="&quot;&quot;&quot;Benoit&quot;&quot;&quot;" name="first_name"/> <field eval="&quot;&quot;&quot;Benoit&quot;&quot;&quot;" name="first_name"/>

View File

@ -9,5 +9,6 @@
<record id="base.group_sale_manager" model="res.groups"> <record id="base.group_sale_manager" model="res.groups">
<field name="name">Sales / Manager</field> <field name="name">Sales / Manager</field>
</record> </record>
</data> </data>
</openerp> </openerp>

View File

@ -27,7 +27,7 @@
'author': 'OpenERP SA', 'author': 'OpenERP SA',
'depends': ['base'], 'depends': ['base'],
'update_xml': ['security/board_security.xml','security/ir.model.access.csv', 'wizard/board_menu_create_view.xml', 'board_view.xml','board_administration_view.xml'], 'update_xml': ['security/board_security.xml','security/ir.model.access.csv', 'wizard/board_menu_create_view.xml', 'board_view.xml','board_administration_view.xml'],
'demo_xml': [], 'demo_xml': ['board_demo.xml'],
'installable': True, 'installable': True,
'active': False, 'active': False,
'certificate': '0076912305725', 'certificate': '0076912305725',

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="base.user_demo" model="res.users">
<field eval="[(4, ref('base.group_sale_salesman'))]" name="groups_id"/>
</record>
</data>
</openerp>

View File

@ -38,8 +38,7 @@ from tools.safe_eval import safe_eval as eval
try: try:
import vobject import vobject
except ImportError: except ImportError:
raise osv.except_osv('vobject Import Error!','Please install python-vobject \ raise osv.except_osv(_('vobject Import Error!'), _('Please install python-vobject from http://vobject.skyhouseconsulting.com/'))
from http://vobject.skyhouseconsulting.com/')
# O-1 Optional and can come only once # O-1 Optional and can come only once
# O-n Optional and can come more than once # O-n Optional and can come more than once

View File

@ -5,6 +5,5 @@
<field name="groups_id" eval="[(4,ref('base.group_sale_salesman'))]"/> <field name="groups_id" eval="[(4,ref('base.group_sale_salesman'))]"/>
</record> </record>
</data> </data>
</openerp> </openerp>

View File

@ -6,7 +6,8 @@
id="report_shipping" id="report_shipping"
model="stock.picking" model="stock.picking"
name="sale.shipping" name="sale.shipping"
rml="delivery/report/shipping.rml" multi="True"
rml="delivery/report/shipping.rml"
string="Delivery order"/> string="Delivery order"/>
</data> </data>

View File

@ -4,6 +4,9 @@
<!-- Delivery Carriers --> <!-- Delivery Carriers -->
<menuitem id="menu_delivery" name="Delivery" parent="stock.menu_stock_configuration" sequence="4"/> <menuitem id="menu_delivery" name="Delivery" parent="stock.menu_stock_configuration" sequence="4"/>
<record id="view_delivery_carrier_tree" model="ir.ui.view"> <record id="view_delivery_carrier_tree" model="ir.ui.view">
<field name="name">delivery.carrier.tree</field> <field name="name">delivery.carrier.tree</field>
<field name="model">delivery.carrier</field> <field name="model">delivery.carrier</field>
@ -128,7 +131,7 @@
<field name="model">sale.order</field> <field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/> <field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<group name="logistic" position="inside"> <group name="logistics" position="inside">
<field name="id" invisible="True"/> <field name="id" invisible="True"/>
<field name="carrier_id" context="{'order_id':active_id}"/> <field name="carrier_id" context="{'order_id':active_id}"/>
</group> </group>
@ -266,10 +269,23 @@
<field name="inherit_id" ref="sale.view_order_form"/> <field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="/form/notebook/page[@string='Sales Order']/group[1]/button[@name='button_dummy']" position="after"> <xpath expr="/form/notebook/page[@string='Sales Order']/group[1]/button[@name='button_dummy']" position="after">
<button name="%(action_delivery_cost)d" states="draft" string="Delivery Costs" type="action" icon="gtk-add" context="{'order_id':active_id}"/> <button name="%(action_delivery_cost)d" states="draft" string="Delivery Costs" type="action" icon="gtk-add" context="{'order_id':active_id}"/>
</xpath> </xpath>
</field> </field>
</record> </record>
<record id="view_delivery_order_inherit_stock" model="ir.ui.view">
<field name="name">stock.picking.out.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='Products']/group/button[@name='action_process']" position="after">
<button name="%(report_shipping)d" string="Delivery Order" states="done,assigned" type="action" icon="gtk-print"/>
</xpath>
</field>
</record>
</data> </data>
</openerp> </openerp>

View File

@ -1,7 +1,9 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<openerp> <openerp>
<data noupdate="1"> <data noupdate="1">
<record id="base.user_demo" model="res.users">
<field eval="[(4, ref('base.group_document_user'))]" name="groups_id"/>
</record>
</data> </data>
</openerp> </openerp>

View File

@ -27,14 +27,14 @@ from xml.dom.minicompat import StringTypes
import urlparse import urlparse
import urllib import urllib
from osv import osv from osv import osv
from tools.translate import _
try: try:
from DAV import utils from DAV import utils
from DAV.propfind import PROPFIND from DAV.propfind import PROPFIND
from DAV.report import REPORT from DAV.report import REPORT
except ImportError: except ImportError:
raise osv.except_osv('PyWebDAV Import Error!','Please install PyWebDAV \ raise osv.except_osv(_('PyWebDAV Import Error!'), _('Please install PyWebDAV from http://code.google.com/p/pywebdav/downloads/detail?name=PyWebDAV-0.9.4.tar.gz&can=2&q=/'))
from http://code.google.com/p/pywebdav/downloads/detail?name=PyWebDAV-0.9.4.tar.gz&can=2&q=/')
import tools import tools

View File

@ -267,7 +267,7 @@ This is useful for CRM leads for example"),
} }
_sql_constraints = [ _sql_constraints = [
('name', 'unique (name)', _('The template name must be unique !')) ('name', 'unique (name)','The template name must be unique !')
] ]
def create_action(self, cr, uid, ids, context): def create_action(self, cr, uid, ids, context):

View File

@ -360,19 +360,19 @@ unless it is already specified in the From Email, e.g: John Doe <john@doe.com>",
payload_part.attach(part) payload_part.attach(part)
except Exception, error: except Exception, error:
logger.notifyChannel(_("Email Template"), netsvc.LOG_ERROR, _("Mail from Account %s failed. Probable Reason:MIME Error\nDescription: %s") % (id, error)) logger.notifyChannel(_("Email Template"), netsvc.LOG_ERROR, _("Mail from Account %s failed. Probable Reason:MIME Error\nDescription: %s") % (id, error))
return {'error_msg': "Server Send Error\nDescription: %s"%error} return {'error_msg': _("Server Send Error\nDescription: %s")%error}
try: try:
serv.sendmail(payload_part['From'], addresses_l['all-recipients'], payload_part.as_string()) serv.sendmail(payload_part['From'], addresses_l['all-recipients'], payload_part.as_string())
except Exception, error: except Exception, error:
logging.getLogger('email_template').error("Mail from Account %s failed. Probable Reason: Server Send Error\n Description: %s", id, error, exc_info=True) logging.getLogger('email_template').error(_("Mail from Account %s failed. Probable Reason: Server Send Error\n Description: %s"), id, error, exc_info=True)
return {'error_msg': "Server Send Error\nDescription: %s"%error} return {'error_msg': _("Server Send Error\nDescription: %s")%error}
#The mail sending is complete #The mail sending is complete
serv.close() serv.close()
logger.notifyChannel(_("Email Template"), netsvc.LOG_INFO, _("Mail from Account %s successfully Sent.") % (id)) logger.notifyChannel(_("Email Template"), netsvc.LOG_INFO, _("Mail from Account %s successfully Sent.") % (id))
return True return True
else: else:
logger.notifyChannel(_("Email Template"), netsvc.LOG_ERROR, _("Mail from Account %s failed. Probable Reason:Account not approved") % id) logger.notifyChannel(_("Email Template"), netsvc.LOG_ERROR, _("Mail from Account %s failed. Probable Reason:Account not approved") % id)
return {'error_msg':"Mail from Account %s failed. Probable Reason:Account not approved"% id} return {'nodestroy':True,'error_msg': _("Mail from Account %s failed. Probable Reason:Account not approved")% id}
def extracttime(self, time_as_string): def extracttime(self, time_as_string):
""" """

View File

@ -3,7 +3,7 @@
<data> <data>
<menuitem name="Marketing" icon="terp-crm" id="base.marketing_menu" sequence="17" <menuitem name="Marketing" icon="terp-crm" id="base.marketing_menu" sequence="17"
groups="marketing.group_marketing_user"/> groups="marketing.group_marketing_user,marketing.group_marketing_manager"/>
<menuitem name="Emails" id="base.menu_emails" parent="base.marketing_menu" sequence="5"/> <menuitem name="Emails" id="base.menu_emails" parent="base.marketing_menu" sequence="5"/>
<menuitem name="Email Template" id="menu_email_template" parent="base.menu_emails"/> <menuitem name="Email Template" id="menu_email_template" parent="base.menu_emails"/>

View File

@ -5,3 +5,6 @@
"access_email_template_account_system","email_template.account system","model_email_template_account","base.group_system",1,1,1,1 "access_email_template_account_system","email_template.account system","model_email_template_account","base.group_system",1,1,1,1
"access_email_template_system","email.template system","model_email_template","base.group_system",1,1,1,1 "access_email_template_system","email.template system","model_email_template","base.group_system",1,1,1,1
"access_email_template_mailbox_system","email_template.mailbox system","model_email_template_mailbox","base.group_system",1,0,0,0 "access_email_template_mailbox_system","email_template.mailbox system","model_email_template_mailbox","base.group_system",1,0,0,0
"access_email_template_account_manager","email_template.account","model_email_template_account","marketing.group_marketing_manager",1,1,1,1
"access_email_template_manager","email.template","model_email_template","marketing.group_marketing_manager",1,1,1,1
"access_email_template_mailbox_manager","email_template.mailbox","model_email_template_mailbox","marketing.group_marketing_manager",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
5 access_email_template_account_system email_template.account system model_email_template_account base.group_system 1 1 1 1
6 access_email_template_system email.template system model_email_template base.group_system 1 1 1 1
7 access_email_template_mailbox_system email_template.mailbox system model_email_template_mailbox base.group_system 1 0 0 0
8 access_email_template_account_manager email_template.account model_email_template_account marketing.group_marketing_manager 1 1 1 1
9 access_email_template_manager email.template model_email_template marketing.group_marketing_manager 1 1 1 1
10 access_email_template_mailbox_manager email_template.mailbox model_email_template_mailbox marketing.group_marketing_manager 1 1 1 1

View File

@ -24,7 +24,7 @@
'name': 'Event', 'name': 'Event',
'version': '0.1', 'version': '0.1',
'category': 'Generic Modules/Association', 'category': 'Generic Modules/Association',
'description': """Oraganization and management of Event. 'description': """Organization and management of Event.
This module allow you This module allow you
* to manage your events and their registrations * to manage your events and their registrations

View File

@ -141,7 +141,7 @@
<field name="act_window_id" ref="action_report_event_registration"/> <field name="act_window_id" ref="action_report_event_registration"/>
</record> </record>
<menuitem parent="base.menu_report_association" action="action_report_event_registration" id="menu_report_event_registration" sequence="3" groups="base.group_marketing_manager"/> <menuitem parent="base.menu_report_association" action="action_report_event_registration" id="menu_report_event_registration" sequence="3" groups="marketing.group_marketing_manager"/>
</data> </data>
</openerp> </openerp>

View File

@ -2,7 +2,7 @@
<openerp> <openerp>
<data> <data>
<record id="base.group_marketing_manager" model="res.groups"> <record id="marketing.group_marketing_manager" model="res.groups">
<field name="name">Marketing / Manager</field> <field name="name">Marketing / Manager</field>
</record> </record>

View File

@ -1,16 +1,16 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_event_type","event.type","model_event_type","marketing.group_marketing_user",1,0,0,0 "access_event_type","event.type","model_event_type","marketing.group_marketing_user",1,0,0,0
"access_event_type_manager","event.type manager","model_event_type","base.group_marketing_manager",1,1,1,1 "access_event_type_manager","event.type manager","model_event_type","marketing.group_marketing_manager",1,1,1,1
"access_event_event","event.event","model_event_event","marketing.group_marketing_user",1,1,1,0 "access_event_event","event.event","model_event_event","marketing.group_marketing_user",1,1,1,0
"access_event_registration","event.registration","model_event_registration","marketing.group_marketing_user",1,1,1,0 "access_event_registration","event.registration","model_event_registration","marketing.group_marketing_user",1,1,1,0
"access_report_event_registration","report.event.registration","model_report_event_registration","marketing.group_marketing_user",1,1,1,1 "access_report_event_registration","report.event.registration","model_report_event_registration","marketing.group_marketing_user",1,1,1,1
"access_event_event_manager","event.event manager","model_event_event","base.group_marketing_manager",1,0,0,0 "access_event_event_manager","event.event manager","model_event_event","marketing.group_marketing_manager",1,0,0,0
"access_event_registration_manager","event.registration manager","model_event_registration","base.group_marketing_manager",1,0,0,0 "access_event_registration_manager","event.registration manager","model_event_registration","marketing.group_marketing_manager",1,0,0,0
"access_crm_case_section_manager","crm.case.section manager","crm.model_crm_case_section","base.group_marketing_manager",1,1,1,1 "access_crm_case_section_manager","crm.case.section manager","crm.model_crm_case_section","marketing.group_marketing_manager",1,1,1,1
"access_product_product","product.product.product manager","product.model_product_product","base.group_marketing_manager",1,1,1,1 "access_product_product","product.product.product manager","product.model_product_product","marketing.group_marketing_manager",1,1,1,1
"access_report_event_registration","report.event.registration","model_report_event_registration","base.group_marketing_manager",1,1,1,1 "access_report_event_registration","report.event.registration","model_report_event_registration","marketing.group_marketing_manager",1,1,1,1
"access_event_registration_badge_manager","event.registration.badge manager","model_event_registration_badge","base.group_marketing_manager",1,1,1,1 "access_event_registration_badge_manager","event.registration.badge manager","model_event_registration_badge","marketing.group_marketing_manager",1,1,1,1
"access_event_event_sale_salesman","event.event.sale","model_event_event","base.group_sale_salesman",1,0,0,0 "access_event_event_sale_salesman","event.event.sale","model_event_event","base.group_sale_salesman",1,0,0,0
"access_account_account_invoice_manager","account.account.invoice","account.model_account_invoice","base.group_marketing_manager",1,0,0,0 "access_account_account_invoice_manager","account.account.invoice","account.model_account_invoice","marketing.group_marketing_manager",1,0,0,0
"access_event_registration_badge","event.registration.badge","model_event_registration_badge","marketing.group_marketing_user",1,0,0,0 "access_event_registration_badge","event.registration.badge","model_event_registration_badge","marketing.group_marketing_user",1,0,0,0
"access_event_registration_sale_user","event.registration.sale.user","model_event_registration","base.group_sale_salesman",1,0,0,0 "access_event_registration_sale_user","event.registration.sale.user","model_event_registration","base.group_sale_salesman",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_event_type event.type model_event_type marketing.group_marketing_user 1 0 0 0
3 access_event_type_manager event.type manager model_event_type base.group_marketing_manager marketing.group_marketing_manager 1 1 1 1
4 access_event_event event.event model_event_event marketing.group_marketing_user 1 1 1 0
5 access_event_registration event.registration model_event_registration marketing.group_marketing_user 1 1 1 0
6 access_report_event_registration report.event.registration model_report_event_registration marketing.group_marketing_user 1 1 1 1
7 access_event_event_manager event.event manager model_event_event base.group_marketing_manager marketing.group_marketing_manager 1 0 0 0
8 access_event_registration_manager event.registration manager model_event_registration base.group_marketing_manager marketing.group_marketing_manager 1 0 0 0
9 access_crm_case_section_manager crm.case.section manager crm.model_crm_case_section base.group_marketing_manager marketing.group_marketing_manager 1 1 1 1
10 access_product_product product.product.product manager product.model_product_product base.group_marketing_manager marketing.group_marketing_manager 1 1 1 1
11 access_report_event_registration report.event.registration model_report_event_registration base.group_marketing_manager marketing.group_marketing_manager 1 1 1 1
12 access_event_registration_badge_manager event.registration.badge manager model_event_registration_badge base.group_marketing_manager marketing.group_marketing_manager 1 1 1 1
13 access_event_event_sale_salesman event.event.sale model_event_event base.group_sale_salesman 1 0 0 0
14 access_account_account_invoice_manager account.account.invoice account.model_account_invoice base.group_marketing_manager marketing.group_marketing_manager 1 0 0 0
15 access_event_registration_badge event.registration.badge model_event_registration_badge marketing.group_marketing_user 1 0 0 0
16 access_event_registration_sale_user event.registration.sale.user model_event_registration base.group_sale_salesman 1 0 0 0

View File

@ -463,9 +463,9 @@ def _create_dta(obj, cr, uid, data, context=None):
v['partner_city']= '' v['partner_city']= ''
v['partner_zip']= '' v['partner_zip']= ''
v['partner_country']= '' v['partner_country']= ''
raise osv.except_osv('Error', 'No address defined \n' \ raise osv.except_osv(_('Error'), _('No address defined \n' \
'for the partner: ' + pline.partner_id.name + '\n' \ 'for the partner: %s \n' \
'on line: ' + pline.name) 'on line: %s') % (pline.partner_id.name,pline.name))
if pline.order_id.date_scheduled: if pline.order_id.date_scheduled:
date_value = datetime.strptime(pline.order_id.date_scheduled, '%Y-%m-%d') date_value = datetime.strptime(pline.order_id.date_scheduled, '%Y-%m-%d')
@ -612,4 +612,4 @@ class create_dta_wizard(osv.osv_memory):
create_dta_wizard() create_dta_wizard()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -34,7 +34,7 @@
'security/ir.model.access.csv', 'security/ir.model.access.csv',
'marketing_view.xml' 'marketing_view.xml'
], ],
'demo_xml': [], 'demo_xml': ['marketing_demo.xml'],
'installable': True, 'installable': True,
'active': False, 'active': False,
} }

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="base.user_demo" model="res.users">
<field eval="[(4, ref('marketing.group_marketing_user'))]" name="groups_id"/>
</record>
</data>
</openerp>

View File

@ -2,7 +2,7 @@
<openerp> <openerp>
<data> <data>
<menuitem name="Marketing" icon="terp-crm" id="base.marketing_menu" sequence="17" groups="marketing.group_marketing_user"/> <menuitem name="Marketing" icon="terp-crm" id="base.marketing_menu" sequence="17" groups="marketing.group_marketing_user,marketing.group_marketing_manager"/>
<record id="view_marketing_installer" model="ir.ui.view"> <record id="view_marketing_installer" model="ir.ui.view">
<field name="name">marketing.installer.view</field> <field name="name">marketing.installer.view</field>

View File

@ -4,5 +4,10 @@
<record id="marketing.group_marketing_user" model="res.groups"> <record id="marketing.group_marketing_user" model="res.groups">
<field name="name">Marketing / User</field> <field name="name">Marketing / User</field>
</record> </record>
<record id="marketing.group_marketing_manager" model="res.groups">
<field name="name">Marketing / Manager</field>
</record>
</data> </data>
</openerp> </openerp>

View File

@ -31,6 +31,18 @@ msgstr ""
msgid "The current step for this item has no email or report to preview." msgid "The current step for this item has no email or report to preview."
msgstr "" msgstr ""
#. module: marketing_campaign
#: code:addons/marketing_campaign/marketing_campaign.py:0
#, python-format
msgid "Operation not supported"
msgstr ""
#. module: marketing_campaign
#: code:addons/marketing_campaign/marketing_campaign.py:0
#, python-format
msgid "Sorry, campaign duplication is not supported at the moment."
msgstr ""
#. module: marketing_campaign #. module: marketing_campaign
#: code:addons/marketing_campaign/marketing_campaign.py:0 #: code:addons/marketing_campaign/marketing_campaign.py:0
#, python-format #, python-format

View File

@ -205,7 +205,7 @@ Normal - the campaign runs normally and automatically sends all emails and repor
# prevent duplication until the server properly duplicates several levels of nested o2m # prevent duplication until the server properly duplicates several levels of nested o2m
def copy(self, cr, uid, id, default=None, context=None): def copy(self, cr, uid, id, default=None, context=None):
raise osv.except_osv("Operation not supported", "Sorry, campaign duplication is not supported at the moment.") raise osv.except_osv(_("Operation not supported"), _("Sorry, campaign duplication is not supported at the moment."))
marketing_campaign() marketing_campaign()
@ -257,7 +257,7 @@ class marketing_campaign_segment(osv.osv):
return True return True
_constraints = [ _constraints = [
(_check_model, _('Model of filter must be same as resource model of Campaign '), ['ir_filter_id,campaign_id']), (_check_model, 'Model of filter must be same as resource model of Campaign ', ['ir_filter_id,campaign_id']),
] ]
def onchange_campaign_id(self, cr, uid, ids, campaign_id): def onchange_campaign_id(self, cr, uid, ids, campaign_id):
@ -309,7 +309,7 @@ class marketing_campaign_segment(osv.osv):
for segment in self.browse(cr, uid, segment_ids, context=context): for segment in self.browse(cr, uid, segment_ids, context=context):
if segment.campaign_id.state != 'running': if segment.campaign_id.state != 'running':
continue continue
campaigns.add(segment.campaign_id.id) campaigns.add(segment.campaign_id.id)
act_ids = self.pool.get('marketing.campaign.activity').search(cr, act_ids = self.pool.get('marketing.campaign.activity').search(cr,
uid, [('start', '=', True), ('campaign_id', '=', segment.campaign_id.id)], context=context) uid, [('start', '=', True), ('campaign_id', '=', segment.campaign_id.id)], context=context)
@ -377,7 +377,7 @@ class marketing_campaign_activity(osv.osv):
help="Python expression to decide whether the activity can be executed, otherwise it will be deleted or cancelled." help="Python expression to decide whether the activity can be executed, otherwise it will be deleted or cancelled."
"The expression may use the following [browsable] variables:\n" "The expression may use the following [browsable] variables:\n"
" - activity: the campaign activity\n" " - activity: the campaign activity\n"
" - workitem: the campaign workitem\n" " - workitem: the campaign workitem\n"
" - resource: the resource object this campaign item represents\n" " - resource: the resource object this campaign item represents\n"
" - transitions: list of campaign transitions outgoing from this activity\n" " - transitions: list of campaign transitions outgoing from this activity\n"
"...- re: Python regular expression module"), "...- re: Python regular expression module"),
@ -539,9 +539,9 @@ class marketing_campaign_transition(osv.osv):
return True return True
_constraints = [ _constraints = [
(_check_campaign, _('The To/From Activity of transition must be of the same Campaign '), ['activity_from_id,activity_to_id']), (_check_campaign, 'The To/From Activity of transition must be of the same Campaign ', ['activity_from_id,activity_to_id']),
] ]
_sql_constraints = [ _sql_constraints = [
('interval_positive', 'CHECK(interval_nbr >= 0)', 'The interval must be positive or zero') ('interval_positive', 'CHECK(interval_nbr >= 0)', 'The interval must be positive or zero')
] ]
@ -638,7 +638,7 @@ class marketing_campaign_workitem(osv.osv):
'activity': activity, 'activity': activity,
'workitem': workitem, 'workitem': workitem,
'object': object_id, 'object': object_id,
'resource': object_id, 'resource': object_id,
'transitions': activity.to_ids, 'transitions': activity.to_ids,
're': re, 're': re,
} }

View File

@ -11,6 +11,7 @@
<field name="month" invisible="1"/> <field name="month" invisible="1"/>
<field name="day" invisible="1"/> <field name="day" invisible="1"/>
<field name="date" invisible="1"/> <field name="date" invisible="1"/>
<field name="state" invisible="1"/>
<field name="campaign_id" invisible="1"/> <field name="campaign_id" invisible="1"/>
<field name="activity_id" invisible="1"/> <field name="activity_id" invisible="1"/>
<field name="segment_id" invisible="1"/> <field name="segment_id" invisible="1"/>

View File

@ -1,13 +1,21 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_marketing_campaign_admin","marketing.campaign","model_marketing_campaign","marketing.group_marketing_user",1,1,1,1 "access_marketing_campaign_admin","marketing.campaign","model_marketing_campaign","marketing.group_marketing_user",1,1,0,0
"access_marketing_campaign_segment_campaignadmin","marketing.campaign.segment","model_marketing_campaign_segment","marketing.group_marketing_user",1,1,1,1 "access_marketing_campaign_segment_campaignadmin","marketing.campaign.segment","model_marketing_campaign_segment","marketing.group_marketing_user",1,1,0,0
"access_marketing_campaign_activity_campaignadmin","marketing.campaign.activity","model_marketing_campaign_activity","marketing.group_marketing_user",1,1,1,1 "access_marketing_campaign_activity_campaignadmin","marketing.campaign.activity","model_marketing_campaign_activity","marketing.group_marketing_user",1,1,0,0
"access_marketing_campaign_workitem_campaignadmin","marketing.campaign.workitem","model_marketing_campaign_workitem","marketing.group_marketing_user",1,1,1,1 "access_marketing_campaign_workitem_campaignadmin","marketing.campaign.workitem","model_marketing_campaign_workitem","marketing.group_marketing_user",1,1,0,0
"access_marketing_campaign_transition_campaignadmin","marketing.campaign.transition","model_marketing_campaign_transition","marketing.group_marketing_user",1,1,1,1 "access_marketing_campaign_transition_campaignadmin","marketing.campaign.transition","model_marketing_campaign_transition","marketing.group_marketing_user",1,1,0,0
"access_marketing_campaign_analysis_campaignadmin","campaign.analysis","model_campaign_analysis","marketing.group_marketing_user",1,1,1,1 "access_marketing_campaign_analysis_campaignadmin","campaign.analysis","model_campaign_analysis","marketing.group_marketing_user",1,1,0,0
"access_marketing_campaign_workitem_all","marketing.campaign.workitem","model_marketing_campaign_workitem","base.group_user",1,0,0,0 "access_marketing_campaign_workitem_all","marketing.campaign.workitem","model_marketing_campaign_workitem","base.group_user",1,0,0,0
"access_email_template_user","email.template","model_email_template","marketing.group_marketing_user",1,1,1,1 "access_email_template_user","email.template","model_email_template","marketing.group_marketing_user",1,1,0,0
"access_email_template_account_user","email_template.account.user","email_template.model_email_template_account","marketing.group_marketing_user",1,1,1,1 "access_email_template_account_user","email_template.account.user","email_template.model_email_template_account","marketing.group_marketing_user",1,1,0,0
"access_marketing_campaign_system","marketing.campaign system","model_marketing_campaign","base.group_system",1,0,0,0 "access_marketing_campaign_system","marketing.campaign system","model_marketing_campaign","base.group_system",1,0,0,0
"access_marketing_campaign_segment_system","marketing.campaign.segment system","model_marketing_campaign_segment","base.group_system",1,0,0,0 "access_marketing_campaign_segment_system","marketing.campaign.segment system","model_marketing_campaign_segment","base.group_system",1,0,0,0
"access_marketing_campaign_workitem_system","marketing.campaign.workitem system","model_marketing_campaign_workitem","base.group_system",1,0,0,0 "access_marketing_campaign_workitem_system","marketing.campaign.workitem system","model_marketing_campaign_workitem","base.group_system",1,0,0,0
"access_marketing_campaign_manager","marketing.campaign","model_marketing_campaign","marketing.group_marketing_manager",1,1,1,1
"access_marketing_campaign_segment_campaign_manager","marketing.campaign.segment","model_marketing_campaign_segment","marketing.group_marketing_manager",1,1,1,1
"access_marketing_campaign_activity_campaign_manager","marketing.campaign.activity","model_marketing_campaign_activity","marketing.group_marketing_manager",1,1,1,1
"access_marketing_campaign_workitem_campaign_manager","marketing.campaign.workitem","model_marketing_campaign_workitem","marketing.group_marketing_manager",1,1,1,1
"access_marketing_campaign_transition_campaign_manager","marketing.campaign.transition","model_marketing_campaign_transition","marketing.group_marketing_manager",1,1,1,1
"access_marketing_campaign_analysis_campaign_manager","campaign.analysis","model_campaign_analysis","marketing.group_marketing_manager",1,1,1,1
"access_email_template_manager","email.template","model_email_template","marketing.group_marketing_manager",1,1,1,1
"access_email_template_account_manager","email_template.account.manager","email_template.model_email_template_account","marketing.group_marketing_manager",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_marketing_campaign_admin marketing.campaign model_marketing_campaign marketing.group_marketing_user 1 1 1 0 1 0
3 access_marketing_campaign_segment_campaignadmin marketing.campaign.segment model_marketing_campaign_segment marketing.group_marketing_user 1 1 1 0 1 0
4 access_marketing_campaign_activity_campaignadmin marketing.campaign.activity model_marketing_campaign_activity marketing.group_marketing_user 1 1 1 0 1 0
5 access_marketing_campaign_workitem_campaignadmin marketing.campaign.workitem model_marketing_campaign_workitem marketing.group_marketing_user 1 1 1 0 1 0
6 access_marketing_campaign_transition_campaignadmin marketing.campaign.transition model_marketing_campaign_transition marketing.group_marketing_user 1 1 1 0 1 0
7 access_marketing_campaign_analysis_campaignadmin campaign.analysis model_campaign_analysis marketing.group_marketing_user 1 1 1 0 1 0
8 access_marketing_campaign_workitem_all marketing.campaign.workitem model_marketing_campaign_workitem base.group_user 1 0 0 0
9 access_email_template_user email.template model_email_template marketing.group_marketing_user 1 1 1 0 1 0
10 access_email_template_account_user email_template.account.user email_template.model_email_template_account marketing.group_marketing_user 1 1 1 0 1 0
11 access_marketing_campaign_system marketing.campaign system model_marketing_campaign base.group_system 1 0 0 0
12 access_marketing_campaign_segment_system marketing.campaign.segment system model_marketing_campaign_segment base.group_system 1 0 0 0
13 access_marketing_campaign_workitem_system marketing.campaign.workitem system model_marketing_campaign_workitem base.group_system 1 0 0 0
14 access_marketing_campaign_manager marketing.campaign model_marketing_campaign marketing.group_marketing_manager 1 1 1 1
15 access_marketing_campaign_segment_campaign_manager marketing.campaign.segment model_marketing_campaign_segment marketing.group_marketing_manager 1 1 1 1
16 access_marketing_campaign_activity_campaign_manager marketing.campaign.activity model_marketing_campaign_activity marketing.group_marketing_manager 1 1 1 1
17 access_marketing_campaign_workitem_campaign_manager marketing.campaign.workitem model_marketing_campaign_workitem marketing.group_marketing_manager 1 1 1 1
18 access_marketing_campaign_transition_campaign_manager marketing.campaign.transition model_marketing_campaign_transition marketing.group_marketing_manager 1 1 1 1
19 access_marketing_campaign_analysis_campaign_manager campaign.analysis model_campaign_analysis marketing.group_marketing_manager 1 1 1 1
20 access_email_template_manager email.template model_email_template marketing.group_marketing_manager 1 1 1 1
21 access_email_template_account_manager email_template.account.manager email_template.model_email_template_account marketing.group_marketing_manager 1 1 1 1

View File

@ -2270,7 +2270,7 @@ msgstr ""
#~ msgid "Product & Location" #~ msgid "Product & Location"
#~ msgstr "Producte & Ubicació" #~ msgstr "Producte & Ubicació"
#~ msgid "MRP & Logistic Scheduler" #~ msgid "MRP & Logistics Scheduler"
#~ msgstr "Planificador MRP & Logística" #~ msgstr "Planificador MRP & Logística"
#~ msgid "" #~ msgid ""

View File

@ -2508,7 +2508,7 @@ msgstr "Jahr"
#~ msgid "Product & Location" #~ msgid "Product & Location"
#~ msgstr "Produkt & Lagerort" #~ msgstr "Produkt & Lagerort"
#~ msgid "MRP & Logistic Scheduler" #~ msgid "MRP & Logistics Scheduler"
#~ msgstr "Fertigungs- und Beschaffungsplanung" #~ msgstr "Fertigungs- und Beschaffungsplanung"
#~ msgid "" #~ msgid ""

View File

@ -2354,7 +2354,7 @@ msgstr ""
#~ msgid "Best price (not yet active!)" #~ msgid "Best price (not yet active!)"
#~ msgstr "Best price (not yet active!)" #~ msgstr "Best price (not yet active!)"
#~ msgid "MRP & Logistic Scheduler" #~ msgid "MRP & Logistics Scheduler"
#~ msgstr "MRP & Προγραμματισμός Προμηθειών" #~ msgstr "MRP & Προγραμματισμός Προμηθειών"
#~ msgid "" #~ msgid ""

View File

@ -2511,7 +2511,7 @@ msgstr "Año"
#~ msgid "Product & Location" #~ msgid "Product & Location"
#~ msgstr "Producto & Ubicación" #~ msgstr "Producto & Ubicación"
#~ msgid "MRP & Logistic Scheduler" #~ msgid "MRP & Logistics Scheduler"
#~ msgstr "Planificador MRP & Logística" #~ msgstr "Planificador MRP & Logística"
#~ msgid "" #~ msgid ""

View File

@ -2385,7 +2385,7 @@ msgstr ""
#~ "This is the days added to what you promise to customers for security purpose" #~ "This is the days added to what you promise to customers for security purpose"
#~ msgstr "Nämä päivät lisätään asiakkaalle luvattuun aikaan turvallisuussyistä" #~ msgstr "Nämä päivät lisätään asiakkaalle luvattuun aikaan turvallisuussyistä"
#~ msgid "MRP & Logistic Scheduler" #~ msgid "MRP & Logistics Scheduler"
#~ msgstr "Tuotanto- ja logistiikka-aikataulut" #~ msgstr "Tuotanto- ja logistiikka-aikataulut"
#~ msgid "A purchase order is created for a sub-contracting demand." #~ msgid "A purchase order is created for a sub-contracting demand."

View File

@ -2501,7 +2501,7 @@ msgstr ""
#~ "Questi sono i giorni aggiunti, per sicurezza, alla data che hai promesso ai " #~ "Questi sono i giorni aggiunti, per sicurezza, alla data che hai promesso ai "
#~ "clienti." #~ "clienti."
#~ msgid "MRP & Logistic Scheduler" #~ msgid "MRP & Logistics Scheduler"
#~ msgstr "MRP e Schedulatore Logistico" #~ msgstr "MRP e Schedulatore Logistico"
#~ msgid "Automatic Procurements" #~ msgid "Automatic Procurements"

View File

@ -2246,7 +2246,7 @@ msgstr ""
#~ msgid "Product name" #~ msgid "Product name"
#~ msgstr "제품 이름" #~ msgstr "제품 이름"
#~ msgid "MRP & Logistic Scheduler" #~ msgid "MRP & Logistics Scheduler"
#~ msgstr "MRP 및 물류 스케줄러" #~ msgstr "MRP 및 물류 스케줄러"
#~ msgid "Ask New Products" #~ msgid "Ask New Products"

View File

@ -2464,7 +2464,7 @@ msgstr ""
#~ "Dit is het aantal dagen dat als veiligheidsmarge wordt toegevoegd aan de " #~ "Dit is het aantal dagen dat als veiligheidsmarge wordt toegevoegd aan de "
#~ "beloofde levertijd." #~ "beloofde levertijd."
#~ msgid "MRP & Logistic Scheduler" #~ msgid "MRP & Logistics Scheduler"
#~ msgstr "MRP & logistieke planning" #~ msgstr "MRP & logistieke planning"
#~ msgid "Product & Location" #~ msgid "Product & Location"

View File

@ -2283,7 +2283,7 @@ msgstr ""
#~ msgid "Origin" #~ msgid "Origin"
#~ msgstr "Pochodzenie" #~ msgstr "Pochodzenie"
#~ msgid "MRP & Logistic Scheduler" #~ msgid "MRP & Logistics Scheduler"
#~ msgstr "MRP i planowanie logistyczne" #~ msgstr "MRP i planowanie logistyczne"
#~ msgid "Product & Location" #~ msgid "Product & Location"

View File

@ -2500,7 +2500,7 @@ msgstr ""
#~ "Estes são os dias adicionados aos que prometeu aos clientes para fins de " #~ "Estes são os dias adicionados aos que prometeu aos clientes para fins de "
#~ "segurança" #~ "segurança"
#~ msgid "MRP & Logistic Scheduler" #~ msgid "MRP & Logistics Scheduler"
#~ msgstr "Planificador Logístico e de Produção" #~ msgstr "Planificador Logístico e de Produção"
#~ msgid "Automatic Procurements" #~ msgid "Automatic Procurements"

View File

@ -2516,7 +2516,7 @@ msgstr ""
#~ msgid "Exceptions Procurements" #~ msgid "Exceptions Procurements"
#~ msgstr "Исключения поставок" #~ msgstr "Исключения поставок"
#~ msgid "MRP & Logistic Scheduler" #~ msgid "MRP & Logistics Scheduler"
#~ msgstr "ПМР и Логистическое планирование" #~ msgstr "ПМР и Логистическое планирование"
#~ msgid "Stockable Stock" #~ msgid "Stockable Stock"

View File

@ -2230,7 +2230,7 @@ msgstr ""
#~ msgid "Ask New Products" #~ msgid "Ask New Products"
#~ msgstr "Opýtať sa na nový produkt" #~ msgstr "Opýtať sa na nový produkt"
#~ msgid "MRP & Logistic Scheduler" #~ msgid "MRP & Logistics Scheduler"
#~ msgstr "MRP a plánovač logistiky" #~ msgstr "MRP a plánovač logistiky"
#~ msgid "Product & Location" #~ msgid "Product & Location"

View File

@ -2241,7 +2241,7 @@ msgstr ""
#~ msgid "Product & Location" #~ msgid "Product & Location"
#~ msgstr "Ürün & Lokasyon Bilgisi" #~ msgstr "Ürün & Lokasyon Bilgisi"
#~ msgid "MRP & Logistic Scheduler" #~ msgid "MRP & Logistics Scheduler"
#~ msgstr "MRP & Lojistik Planlaması" #~ msgstr "MRP & Lojistik Planlaması"
#~ msgid "Ask New Products" #~ msgid "Ask New Products"

View File

@ -2544,7 +2544,7 @@ msgstr ""
#~ msgid "Product & Location" #~ msgid "Product & Location"
#~ msgstr "产品&库位" #~ msgstr "产品&库位"
#~ msgid "MRP & Logistic Scheduler" #~ msgid "MRP & Logistics Scheduler"
#~ msgstr "MRP&物流调度" #~ msgstr "MRP&物流调度"
#~ msgid "" #~ msgid ""

View File

@ -2255,7 +2255,7 @@ msgstr ""
#~ "This is the days added to what you promise to customers for security purpose" #~ "This is the days added to what you promise to customers for security purpose"
#~ msgstr "這是你為了客人的保險而所承諾的天數" #~ msgstr "這是你為了客人的保險而所承諾的天數"
#~ msgid "MRP & Logistic Scheduler" #~ msgid "MRP & Logistics Scheduler"
#~ msgstr "物料需求計劃 & 物流調度" #~ msgstr "物料需求計劃 & 物流調度"
#~ msgid "Automatic Procurements" #~ msgid "Automatic Procurements"

View File

@ -2251,7 +2251,7 @@ msgstr ""
#~ "This is the days added to what you promise to customers for security purpose" #~ "This is the days added to what you promise to customers for security purpose"
#~ msgstr "這是你為了客人的保險而所承諾的天數" #~ msgstr "這是你為了客人的保險而所承諾的天數"
#~ msgid "MRP & Logistic Scheduler" #~ msgid "MRP & Logistics Scheduler"
#~ msgstr "物料需求計劃 & 物流調度" #~ msgstr "物料需求計劃 & 物流調度"
#~ msgid "Product & Location" #~ msgid "Product & Location"

View File

@ -446,18 +446,18 @@ class mrp_production(osv.osv):
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.production', context=c), 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.production', context=c),
} }
_order = 'priority desc, date_planned asc'; _order = 'priority desc, date_planned asc';
def _check_qty(self, cr, uid, ids): def _check_qty(self, cr, uid, ids):
orders = self.browse(cr, uid, ids) orders = self.browse(cr, uid, ids)
for order in orders: for order in orders:
if order.product_qty <= 0: if order.product_qty <= 0:
return False return False
return True return True
_constraints = [ _constraints = [
(_check_qty, 'Order quantity cannot be negative or zero !', ['product_qty']), (_check_qty, 'Order quantity cannot be negative or zero !', ['product_qty']),
] ]
def unlink(self, cr, uid, ids, context=None): def unlink(self, cr, uid, ids, context=None):
productions = self.read(cr, uid, ids, ['state']) productions = self.read(cr, uid, ids, ['state'])
unlink_ids = [] unlink_ids = []
@ -639,16 +639,16 @@ class mrp_production(osv.osv):
@param production_mode: specify production mode (consume/consume&produce). @param production_mode: specify production mode (consume/consume&produce).
@return: True @return: True
""" """
stock_mov_obj = self.pool.get('stock.move') stock_mov_obj = self.pool.get('stock.move')
production = self.browse(cr, uid, production_id) production = self.browse(cr, uid, production_id)
final_product_todo = [] final_product_todo = []
produced_qty = 0 produced_qty = 0
if production_mode == 'consume_produce': if production_mode == 'consume_produce':
produced_qty = production_qty produced_qty = production_qty
for produced_product in production.move_created_ids2: for produced_product in production.move_created_ids2:
if (produced_product.scrapped) or (produced_product.product_id.id<>production.product_id.id): if (produced_product.scrapped) or (produced_product.product_id.id<>production.product_id.id):
continue continue
@ -658,7 +658,7 @@ class mrp_production(osv.osv):
consumed_products = {} consumed_products = {}
check = {} check = {}
scrapped = map(lambda x:x.scrapped,production.move_lines2).count(True) scrapped = map(lambda x:x.scrapped,production.move_lines2).count(True)
for consumed_product in production.move_lines2: for consumed_product in production.move_lines2:
consumed = consumed_product.product_qty consumed = consumed_product.product_qty
if consumed_product.scrapped: if consumed_product.scrapped:
@ -671,9 +671,9 @@ class mrp_production(osv.osv):
if (len(production.move_lines2) - scrapped) > len(production.product_lines): if (len(production.move_lines2) - scrapped) > len(production.product_lines):
check[consumed_product.product_id.id] += consumed_product.product_qty check[consumed_product.product_id.id] += consumed_product.product_qty
consumed = check[consumed_product.product_id.id] consumed = check[consumed_product.product_id.id]
rest_consumed = produced_qty * f.product_qty / production.product_qty - consumed rest_consumed = produced_qty * f.product_qty / production.product_qty - consumed
consumed_products[consumed_product.product_id.id] = rest_consumed consumed_products[consumed_product.product_id.id] = rest_consumed
for raw_product in production.move_lines: for raw_product in production.move_lines:
for f in production.product_lines: for f in production.product_lines:
if f.product_id.id == raw_product.product_id.id: if f.product_id.id == raw_product.product_id.id:
@ -712,7 +712,7 @@ class mrp_production(osv.osv):
new_parent_ids.append(final_product.id) new_parent_ids.append(final_product.id)
for new_parent_id in new_parent_ids: for new_parent_id in new_parent_ids:
stock_mov_obj.write(cr, uid, [raw_product.id], {'move_history_ids': [(4,new_parent_id)]}) stock_mov_obj.write(cr, uid, [raw_product.id], {'move_history_ids': [(4,new_parent_id)]})
wf_service = netsvc.LocalService("workflow") wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'mrp.production', production_id, 'button_produce_done', cr) wf_service.trg_validate(uid, 'mrp.production', production_id, 'button_produce_done', cr)
return True return True
@ -750,7 +750,7 @@ class mrp_production(osv.osv):
'account_id': account, 'account_id': account,
'general_account_id': wc.costs_general_account_id.id, 'general_account_id': wc.costs_general_account_id.id,
'journal_id': wc.costs_journal_id.id, 'journal_id': wc.costs_journal_id.id,
'code': wc.code 'code': wc.code,
} ) } )
return amount return amount
@ -827,7 +827,7 @@ class mrp_production(osv.osv):
'company_id': production.company_id.id, 'company_id': production.company_id.id,
} }
res_final_id = move_obj.create(cr, uid, data) res_final_id = move_obj.create(cr, uid, data)
self.write(cr, uid, [production.id], {'move_created_ids': [(6, 0, [res_final_id])]}) self.write(cr, uid, [production.id], {'move_created_ids': [(6, 0, [res_final_id])]})
moves = [] moves = []
for line in production.product_lines: for line in production.product_lines:
@ -879,7 +879,7 @@ class mrp_production(osv.osv):
'company_id': production.company_id.id, 'company_id': production.company_id.id,
}) })
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr) wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
proc_ids.append(proc_id) proc_ids.append(proc_id)
wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr) wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
self.write(cr, uid, [production.id], {'picking_id': picking_id, 'move_lines': [(6,0,moves)], 'state':'confirmed'}) self.write(cr, uid, [production.id], {'picking_id': picking_id, 'move_lines': [(6,0,moves)], 'state':'confirmed'})
message = _("Manufacturing order '%s' is scheduled for the %s.") % ( message = _("Manufacturing order '%s' is scheduled for the %s.") % (

View File

@ -2,6 +2,11 @@
<openerp> <openerp>
<data noupdate="1"> <data noupdate="1">
<record id="base.user_demo" model="res.users">
<field eval="[(4, ref('group_mrp_user'))]" name="groups_id"/>
</record>
<!-- <!--
Resource: mrp.workcenter Resource: mrp.workcenter
--> -->

View File

@ -585,8 +585,8 @@
<page string="Consumed Products"> <page string="Consumed Products">
<field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]" on_change="bom_id_change(bom_id)"/> <field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]" on_change="bom_id_change(bom_id)"/>
<field name="routing_id" groups="base.group_extended" select="1" widget="selection"/> <field name="routing_id" groups="base.group_extended" select="1" widget="selection"/>
<field name="location_src_id" domain="[('usage','=','internal')]" on_change="location_id_change(location_src_id,location_dest_id)" widget="selection"/> <field name="location_src_id" domain="[('usage','=','internal')]" on_change="location_id_change(location_src_id,location_dest_id)"/>
<field name="location_dest_id" domain="[('usage','=','internal')]" widget="selection"/> <field name="location_dest_id" domain="[('usage','=','internal')]"/>
<separator string="" colspan="4"/> <separator string="" colspan="4"/>
<field colspan="2" name="move_lines" nolabel="1" widget="one2many_list" <field colspan="2" name="move_lines" nolabel="1" widget="one2many_list"
@ -595,7 +595,7 @@
<field name="product_id" /> <field name="product_id" />
<field name="product_qty" string="Qty"/> <field name="product_qty" string="Qty"/>
<field name="product_uom" string="UOM" widget="selection"/> <field name="product_uom" string="UOM" widget="selection"/>
<field name="location_id" string="Source Loc." widget="selection"/> <field name="location_id" string="Source Loc."/>
<field name="state" invisible="1"/> <field name="state" invisible="1"/>
<button name="%(stock.move_consume)d" <button name="%(stock.move_consume)d"
string="Consume Products" type="action" string="Consume Products" type="action"
@ -614,7 +614,7 @@
<field name="product_id" readonly="1"/> <field name="product_id" readonly="1"/>
<field name="product_qty" readonly="1" string="Qty"/> <field name="product_qty" readonly="1" string="Qty"/>
<field name="product_uom" readonly="1" string="UOM" widget="selection"/> <field name="product_uom" readonly="1" string="UOM" widget="selection"/>
<field name="location_dest_id" readonly="1" string="Destination Loc." widget="selection"/> <field name="location_dest_id" readonly="1" string="Destination Loc."/>
<field name="prodlot_id" context="{'product_id': product_id}"/> <field name="prodlot_id" context="{'product_id': product_id}"/>
<field name="state" invisible="1"/> <field name="state" invisible="1"/>
<field name="scrapped" invisible="1"/> <field name="scrapped" invisible="1"/>
@ -649,7 +649,7 @@
<field name="product_id" /> <field name="product_id" />
<field name="product_qty" string="Qty"/> <field name="product_qty" string="Qty"/>
<field name="product_uom" string="UOM" widget="selection"/> <field name="product_uom" string="UOM" widget="selection"/>
<field name="location_id" string="Source Loc." widget="selection"/> <field name="location_id" string="Source Loc." />
<field name="state" invisible="1"/> <field name="state" invisible="1"/>
<button name="%(stock.action_partial_move)d" <button name="%(stock.action_partial_move)d"
string="Partial" string="Partial"

View File

@ -67,3 +67,4 @@
"access_stock_picking_mrp_manager","stock.picking mrp_manager","stock.model_stock_picking","mrp.group_mrp_manager",1,0,0,0 "access_stock_picking_mrp_manager","stock.picking mrp_manager","stock.model_stock_picking","mrp.group_mrp_manager",1,0,0,0
"access_report_mrp_inout_user","report.mrp.inout user","model_report_mrp_inout","mrp.group_mrp_user",1,0,0,0 "access_report_mrp_inout_user","report.mrp.inout user","model_report_mrp_inout","mrp.group_mrp_user",1,0,0,0
"access_report_workcenter_load_user","report.workcenter.load.user","model_report_workcenter_load","mrp.group_mrp_user",1,0,0,0 "access_report_workcenter_load_user","report.workcenter.load.user","model_report_workcenter_load","mrp.group_mrp_user",1,0,0,0
"access_mrp_bom","mrp.bom","model_mrp_bom","base.group_sale_salesman",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
67 access_stock_picking_mrp_manager stock.picking mrp_manager stock.model_stock_picking mrp.group_mrp_manager 1 0 0 0
68 access_report_mrp_inout_user report.mrp.inout user model_report_mrp_inout mrp.group_mrp_user 1 0 0 0
69 access_report_workcenter_load_user report.workcenter.load.user model_report_workcenter_load mrp.group_mrp_user 1 0 0 0
70 access_mrp_bom mrp.bom model_mrp_bom base.group_sale_salesman 1 0 0 0

View File

@ -9,7 +9,6 @@
<field name="name">Manufacturing / User</field> <field name="name">Manufacturing / User</field>
</record> </record>
<!-- restrict access to menu --> <!-- restrict access to menu -->
<record model='ir.ui.menu' id="mrp_Sched_all"> <record model='ir.ui.menu' id="mrp_Sched_all">
<field eval="[(6,0,[ref('group_mrp_manager')])]" name="groups_id"/> <field eval="[(6,0,[ref('group_mrp_manager')])]" name="groups_id"/>

View File

@ -2,10 +2,10 @@
In order to test the flow of procurement orders. I will put some orders with In order to test the flow of procurement orders. I will put some orders with
different procurement methods. I have installed sale, mrp and purchase modules. different procurement methods. I have installed sale, mrp and purchase modules.
- -
I am creating products. I am creating products.
- -
I create record for product Shirt. I create record for product Shirt.
- -
!record {model: product.product, id: product_product_shirt0}: !record {model: product.product, id: product_product_shirt0}:
categ_id: product.cat1 categ_id: product.cat1
cost_method: standard cost_method: standard
@ -26,9 +26,9 @@
warranty: 0.0 warranty: 0.0
weight: 0.0 weight: 0.0
weight_net: 0.0 weight_net: 0.0
- -
I create record for product Cloth. I create record for product Cloth.
- -
!record {model: product.product, id: product_product_cloth0}: !record {model: product.product, id: product_product_cloth0}:
categ_id: product.cat1 categ_id: product.cat1
cost_method: standard cost_method: standard
@ -52,9 +52,9 @@
warranty: 0.0 warranty: 0.0
weight: 0.0 weight: 0.0
weight_net: 0.0 weight_net: 0.0
- -
I create record for product Buttons. I create record for product Buttons.
- -
!record {model: product.product, id: product_product_buttons0}: !record {model: product.product, id: product_product_buttons0}:
categ_id: product.cat1 categ_id: product.cat1
cost_method: standard cost_method: standard
@ -79,10 +79,10 @@
weight: 0.0 weight: 0.0
weight_net: 0.0 weight_net: 0.0
- -
I am creating bills of material for 'Shirt'. I am creating bills of material for 'Shirt'.
- -
I create bills of material for Shirt. I create bills of material for Shirt.
- -
!record {model: mrp.bom, id: mrp_bom_shirt0}: !record {model: mrp.bom, id: mrp_bom_shirt0}:
bom_lines: bom_lines:
- company_id: base.main_company - company_id: base.main_company
@ -99,7 +99,7 @@
product_efficiency: 1.0 product_efficiency: 1.0
product_id: product_product_buttons0 product_id: product_product_buttons0
product_qty: 8.0 product_qty: 8.0
product_uom: product.product_uom_unit product_uom: product.product_uom_kgm
product_uos_qty: 0.0 product_uos_qty: 0.0
sequence: 0.0 sequence: 0.0
type: normal type: normal
@ -123,7 +123,7 @@
product_id: mrp.product_product_buttons0 product_id: mrp.product_product_buttons0
product_max_qty: 50.0 product_max_qty: 50.0
product_min_qty: 10.0 product_min_qty: 10.0
product_uom: product.product_uom_unit product_uom: product.product_uom_kgm
qty_multiple: 1 qty_multiple: 1
warehouse_id: stock.warehouse0 warehouse_id: stock.warehouse0
- -
@ -142,7 +142,7 @@
- -
I run the procurement. I run the procurement.
- -
!workflow {model: procurement.order, action: button_check, ref: procurement_order_shirt0} !workflow {model: procurement.order, action: button_check, ref: procurement_order_shirt0}
- -
I see that there is a manufacturing order for Shirt. I see that there is a manufacturing order for Shirt.
- -
@ -210,7 +210,7 @@
picking_ids = pick_obj.search(cr, uid, [('address_id.name','=','Wong'),('state','=','assigned')]) picking_ids = pick_obj.search(cr, uid, [('address_id.name','=','Wong'),('state','=','assigned')])
partial = self.browse(cr, uid, 1, context) partial = self.browse(cr, uid, 1, context)
partial_datas = { partial_datas = {
'delivery_date' : partial.date 'delivery_date' : partial.date
} }
for pick in pick_obj.browse(cr, uid, picking_ids): for pick in pick_obj.browse(cr, uid, picking_ids):
for m in pick.move_lines: for m in pick.move_lines:
@ -219,8 +219,8 @@
'product_qty' : m.product_qty, 'product_qty' : m.product_qty,
'product_uom' : m.product_uom.id 'product_uom' : m.product_uom.id
} }
if (pick.type == 'in') and (m.product_id.cost_method == 'average'): if (pick.type == 'in') and (m.product_id.cost_method == 'average'):
partial_datas['move%s'%(m.id)].update({ partial_datas['move%s'%(m.id)].update({
'product_price' : m.product_price, 'product_price' : m.product_price,
'product_currency': m.product_currency 'product_currency': m.product_currency
}) })
@ -246,7 +246,7 @@
picking_ids = pick_obj.search(cr, uid, [('address_id.name','=','Tang'),('state','=','assigned')]) picking_ids = pick_obj.search(cr, uid, [('address_id.name','=','Tang'),('state','=','assigned')])
partial = self.browse(cr, uid, 1, context) partial = self.browse(cr, uid, 1, context)
partial_datas = { partial_datas = {
'delivery_date': partial.date 'delivery_date': partial.date
} }
for pick in pick_obj.browse(cr, uid, picking_ids): for pick in pick_obj.browse(cr, uid, picking_ids):
for m in pick.move_lines: for m in pick.move_lines:
@ -255,8 +255,8 @@
'product_qty': m.product_qty, 'product_qty': m.product_qty,
'product_uom': m.product_uom.id 'product_uom': m.product_uom.id
} }
if (pick.type == 'in') and (m.product_id.cost_method == 'average'): if (pick.type == 'in') and (m.product_id.cost_method == 'average'):
partial_datas['move%s'%(m.id)].update({ partial_datas['move%s'%(m.id)].update({
'product_price': m.product_price, 'product_price': m.product_price,
'product_currency': m.product_currency 'product_currency': m.product_currency
}) })
@ -323,4 +323,4 @@
prod_obj = self.pool.get('mrp.production') prod_obj = self.pool.get('mrp.production')
prod_ids = prod_obj.search(cr, uid, [('product_id.name','=','Shirt')]) prod_ids = prod_obj.search(cr, uid, [('product_id.name','=','Shirt')])
self.do_produce(cr, uid, [1], context={'active_ids': prod_ids}) self.do_produce(cr, uid, [1], context={'active_ids': prod_ids})

View File

@ -26,7 +26,7 @@ class mrp_product_produce(osv.osv_memory):
_description = "Product Produce" _description = "Product Produce"
_columns = { _columns = {
'product_qty': fields.float('Quantity', required=True), 'product_qty': fields.float('Select Quantity', required=True),
'mode': fields.selection([('consume_produce', 'Consume & Produce'), 'mode': fields.selection([('consume_produce', 'Consume & Produce'),
('consume', 'Consume Only')], 'Mode', required=True, ('consume', 'Consume Only')], 'Mode', required=True,
help="'Consume only' mode will only consume the products with the quantity selected.\n" help="'Consume only' mode will only consume the products with the quantity selected.\n"

View File

@ -290,6 +290,12 @@ msgstr ""
msgid "No valid pricelist line found !" msgid "No valid pricelist line found !"
msgstr "" msgstr ""
#. module: point_of_sale
#: code:addons/point_of_sale/wizard/pos_discount.py:0
#, python-format
msgid "No Order Lines"
msgstr ""
#. module: point_of_sale #. module: point_of_sale
#: report:pos.details:0 #: report:pos.details:0
#: report:pos.lines:0 #: report:pos.lines:0
@ -1732,6 +1738,7 @@ msgstr ""
#. module: point_of_sale #. module: point_of_sale
#: code:addons/point_of_sale/wizard/pos_payment.py:0 #: code:addons/point_of_sale/wizard/pos_payment.py:0
#: code:addons/point_of_sale/wizard/pos_discount.py:0
#, python-format #, python-format
msgid "Error!" msgid "Error!"
msgstr "" msgstr ""

View File

@ -47,7 +47,7 @@ class pos_discount(osv.osv_memory):
record_id = context and context.get('active_id', False) or False record_id = context and context.get('active_id', False) or False
order = self.pool.get('pos.order').browse(cr, uid, record_id, context=context) order = self.pool.get('pos.order').browse(cr, uid, record_id, context=context)
if not order.lines: if not order.lines:
raise osv.except_osv('Error!','No Order Lines ') raise osv.except_osv(_('Error!'), _('No Order Lines'))
True True
def apply_discount(self, cr, uid, ids, context=None): def apply_discount(self, cr, uid, ids, context=None):

View File

@ -10,7 +10,7 @@
<field name="inherit_id" ref="base.view_company_form"/> <field name="inherit_id" ref="base.view_company_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<page string="Configuration" position="inside"> <page string="Configuration" position="inside">
<separator string="MRP &amp; Logistic Scheduler" colspan="4"/> <separator string="MRP &amp; Logistics Scheduler" colspan="4"/>
<field name="schedule_range"/> <field name="schedule_range"/>
</page> </page>
</field> </field>

View File

@ -314,8 +314,8 @@ msgstr "If you encode manually a Procurement, you probably want to use a make to
#. module: procurement #. module: procurement
#: view:res.company:0 #: view:res.company:0
msgid "MRP & Logistic Scheduler" msgid "MRP & Logistics Scheduler"
msgstr "MRP & Logistic Scheduler" msgstr "MRP & Logistics Scheduler"
#. module: procurement #. module: procurement
#: view:procurement.order.compute.all:0 #: view:procurement.order.compute.all:0

View File

@ -324,7 +324,7 @@ msgstr ""
#. module: procurement #. module: procurement
#: view:res.company:0 #: view:res.company:0
msgid "MRP & Logistic Scheduler" msgid "MRP & Logistics Scheduler"
msgstr "" msgstr ""
#. module: procurement #. module: procurement

View File

@ -325,7 +325,7 @@ msgstr ""
#. module: procurement #. module: procurement
#: view:res.company:0 #: view:res.company:0
msgid "MRP & Logistic Scheduler" msgid "MRP & Logistics Scheduler"
msgstr "" msgstr ""
#. module: procurement #. module: procurement

View File

@ -373,7 +373,7 @@ msgstr ""
#. module: procurement #. module: procurement
#: view:res.company:0 #: view:res.company:0
msgid "MRP & Logistic Scheduler" msgid "MRP & Logistics Scheduler"
msgstr "Үйлдвэрлэл & Логистик" msgstr "Үйлдвэрлэл & Логистик"
#. module: procurement #. module: procurement

View File

@ -325,7 +325,7 @@ msgstr ""
#. module: procurement #. module: procurement
#: view:res.company:0 #: view:res.company:0
msgid "MRP & Logistic Scheduler" msgid "MRP & Logistics Scheduler"
msgstr "" msgstr ""
#. module: procurement #. module: procurement

View File

@ -344,7 +344,7 @@ msgstr ""
#. module: procurement #. module: procurement
#: view:res.company:0 #: view:res.company:0
msgid "MRP & Logistic Scheduler" msgid "MRP & Logistics Scheduler"
msgstr "MRP i planowanie logistyczne" msgstr "MRP i planowanie logistyczne"
#. module: procurement #. module: procurement

View File

@ -332,7 +332,7 @@ msgstr ""
#. module: procurement #. module: procurement
#: view:res.company:0 #: view:res.company:0
msgid "MRP & Logistic Scheduler" msgid "MRP & Logistics Scheduler"
msgstr "" msgstr ""
#. module: procurement #. module: procurement

View File

@ -342,7 +342,7 @@ msgstr ""
#. module: procurement #. module: procurement
#: view:res.company:0 #: view:res.company:0
msgid "MRP & Logistic Scheduler" msgid "MRP & Logistics Scheduler"
msgstr "ПМР и Логистическое планирование" msgstr "ПМР и Логистическое планирование"
#. module: procurement #. module: procurement

View File

@ -62,11 +62,11 @@ mrp_property()
class StockMove(osv.osv): class StockMove(osv.osv):
_inherit = 'stock.move' _inherit = 'stock.move'
_columns= { _columns= {
'procurements': fields.one2many('procurement.order', 'move_id', 'Procurements'), 'procurements': fields.one2many('procurement.order', 'move_id', 'Procurements'),
} }
def copy(self, cr, uid, id, default=None, context=None): def copy(self, cr, uid, id, default=None, context=None):
default = default or {} default = default or {}
default['procurements'] = [] default['procurements'] = []
@ -134,7 +134,7 @@ class procurement_order(osv.osv):
if s['state'] in ['draft','cancel']: if s['state'] in ['draft','cancel']:
unlink_ids.append(s['id']) unlink_ids.append(s['id'])
else: else:
raise osv.except_osv(_('Invalid action !'), raise osv.except_osv(_('Invalid action !'),
_('Cannot delete Procurement Order(s) which are in %s State!') % \ _('Cannot delete Procurement Order(s) which are in %s State!') % \
s['state']) s['state'])
return osv.osv.unlink(self, cr, uid, unlink_ids, context=context) return osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
@ -165,12 +165,13 @@ class procurement_order(osv.osv):
""" """
return all(procurement.move_id.state == 'cancel' for procurement in self.browse(cr, uid, ids)) return all(procurement.move_id.state == 'cancel' for procurement in self.browse(cr, uid, ids))
def check_move_done(self, cr, uid, ids, context={}): def check_move_done(self, cr, uid, ids, context=None):
""" Checks if move is done or not. """ Checks if move is done or not.
@return: True or False. @return: True or False.
""" """
return all(procurement.move_id.state == 'done' for procurement in self.browse(cr, uid, ids)) if not context:
context = {}
return all(not procurement.move_id or procurement.move_id.state == 'done' for procurement in self.browse(cr, uid, ids, context=context))
# #
# This method may be overrided by objects that override procurement.order # This method may be overrided by objects that override procurement.order
# for computing their own purpose # for computing their own purpose
@ -283,7 +284,7 @@ class procurement_order(osv.osv):
if procurement.product_id.product_tmpl_id.supply_method <> 'buy': if procurement.product_id.product_tmpl_id.supply_method <> 'buy':
return False return False
if not procurement.product_id.seller_ids: if not procurement.product_id.seller_ids:
cr.execute('update procurement_order set message=%s where id=%s', cr.execute('update procurement_order set message=%s where id=%s',
(_('No supplier defined for this product !'), procurement.id)) (_('No supplier defined for this product !'), procurement.id))
return False return False
partner = procurement.product_id.seller_id #Taken Main Supplier of Product of Procurement. partner = procurement.product_id.seller_id #Taken Main Supplier of Product of Procurement.
@ -293,7 +294,7 @@ class procurement_order(osv.osv):
return False return False
address_id = partner_obj.address_get(cr, uid, [partner.id], ['delivery'])['delivery'] address_id = partner_obj.address_get(cr, uid, [partner.id], ['delivery'])['delivery']
if not address_id: if not address_id:
cr.execute('update procurement_order set message=%s where id=%s', cr.execute('update procurement_order set message=%s where id=%s',
(_('No address defined for the supplier'), procurement.id)) (_('No address defined for the supplier'), procurement.id))
return False return False
return True return True
@ -314,7 +315,7 @@ class procurement_order(osv.osv):
move_obj = self.pool.get('stock.move') move_obj = self.pool.get('stock.move')
for procurement in self.browse(cr, uid, ids): for procurement in self.browse(cr, uid, ids):
if procurement.product_qty <= 0.00: if procurement.product_qty <= 0.00:
raise osv.except_osv(_('Data Insufficient !'), raise osv.except_osv(_('Data Insufficient !'),
_('Please check the Quantity in Procurement Order(s), it should not be less than 1!')) _('Please check the Quantity in Procurement Order(s), it should not be less than 1!'))
if procurement.product_id.type in ('product', 'consu'): if procurement.product_id.type in ('product', 'consu'):
if not procurement.move_id: if not procurement.move_id:
@ -342,7 +343,7 @@ class procurement_order(osv.osv):
""" Changes procurement state to Running and writes message. """ Changes procurement state to Running and writes message.
@return: True @return: True
""" """
self.write(cr, uid, ids, {'state': 'running', self.write(cr, uid, ids, {'state': 'running',
'message': _('from stock: products assigned.')}) 'message': _('from stock: products assigned.')})
return True return True
@ -365,8 +366,8 @@ class procurement_order(osv.osv):
ok = ok and self.pool.get('stock.move').action_assign(cr, uid, [id]) ok = ok and self.pool.get('stock.move').action_assign(cr, uid, [id])
cr.execute('select count(id) from stock_warehouse_orderpoint where product_id=%s', (procurement.product_id.id,)) cr.execute('select count(id) from stock_warehouse_orderpoint where product_id=%s', (procurement.product_id.id,))
if not cr.fetchone()[0]: if not cr.fetchone()[0]:
cr.execute('update procurement_order set message=%s where id=%s', cr.execute('update procurement_order set message=%s where id=%s',
(_('Not enough stock and no minimum orderpoint rule defined.'), (_('Not enough stock and no minimum orderpoint rule defined.'),
procurement.id)) procurement.id))
message = _("Procurement '%s' is in exception: not enough stock.") % \ message = _("Procurement '%s' is in exception: not enough stock.") % \
(procurement.name,) (procurement.name,)
@ -479,7 +480,7 @@ class StockPicking(osv.osv):
wf_service.trg_validate(user, 'procurement.order', wf_service.trg_validate(user, 'procurement.order',
procurement.id, 'button_check', cursor) procurement.id, 'button_check', cursor)
return res return res
StockPicking() StockPicking()
class stock_warehouse_orderpoint(osv.osv): class stock_warehouse_orderpoint(osv.osv):
@ -517,7 +518,7 @@ class stock_warehouse_orderpoint(osv.osv):
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.warehouse.orderpoint', context=c) 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.warehouse.orderpoint', context=c)
} }
_sql_constraints = [ _sql_constraints = [
('qty_multiple_check', 'CHECK( qty_multiple > 0 )', ('qty_multiple_check', 'CHECK( qty_multiple > 0 )',
_('Qty Multiple must be greater than zero.')), _('Qty Multiple must be greater than zero.')),
] ]
@ -531,7 +532,7 @@ class stock_warehouse_orderpoint(osv.osv):
v = {'location_id': w.lot_stock_id.id} v = {'location_id': w.lot_stock_id.id}
return {'value': v} return {'value': v}
return {} return {}
def onchange_product_id(self, cr, uid, ids, product_id, context={}): def onchange_product_id(self, cr, uid, ids, product_id, context={}):
""" Finds UoM for changed product. """ Finds UoM for changed product.
@param product_id: Changed id of product. @param product_id: Changed id of product.
@ -542,7 +543,7 @@ class stock_warehouse_orderpoint(osv.osv):
v = {'product_uom': prod.uom_id.id} v = {'product_uom': prod.uom_id.id}
return {'value': v} return {'value': v}
return {} return {}
def copy(self, cr, uid, id, default=None,context={}): def copy(self, cr, uid, id, default=None,context={}):
if not default: if not default:
default = {} default = {}
@ -550,6 +551,6 @@ class stock_warehouse_orderpoint(osv.osv):
'name': self.pool.get('ir.sequence').get(cr, uid, 'stock.orderpoint') or '', 'name': self.pool.get('ir.sequence').get(cr, uid, 'stock.orderpoint') or '',
}) })
return super(stock_warehouse_orderpoint, self).copy(cr, uid, id, default, context) return super(stock_warehouse_orderpoint, self).copy(cr, uid, id, default, context)
stock_warehouse_orderpoint() stock_warehouse_orderpoint()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -262,7 +262,7 @@
src_model="procurement.order"/> src_model="procurement.order"/>
<!-- Procurements are located in Warehouse menu hierarchy, MRP users should come to Stock application to use it. --> <!-- Procurements are located in Warehouse menu hierarchy, MRP users should come to Stock application to use it. -->
<menuitem id="menu_stock_sched" name="Schedulers" parent="stock.menu_stock_root" sequence="4" groups="base.group_extended"/> <menuitem id="menu_stock_sched" name="Schedulers" parent="stock.menu_stock_root" sequence="4"/>
<menuitem action="action_compute_schedulers" id="menu_stock_proc_schedulers" parent="menu_stock_sched" sequence="20" groups="stock.group_stock_manager"/> <menuitem action="action_compute_schedulers" id="menu_stock_proc_schedulers" parent="menu_stock_sched" sequence="20" groups="stock.group_stock_manager"/>
<menuitem action="procurement_exceptions" id="menu_stock_procurement_action" parent="menu_stock_sched" sequence="50" groups="stock.group_stock_manager"/> <menuitem action="procurement_exceptions" id="menu_stock_procurement_action" parent="menu_stock_sched" sequence="50" groups="stock.group_stock_manager"/>
<menuitem id="menu_stock_procurement" name="Automatic Procurements" parent="stock.menu_stock_root" sequence="5" groups="base.group_extended"/> <menuitem id="menu_stock_procurement" name="Automatic Procurements" parent="stock.menu_stock_root" sequence="5" groups="base.group_extended"/>

View File

@ -129,9 +129,9 @@ class product_pricelist(osv.osv):
#def price_get_multi(self, cr, uid, product_ids, context=None): #def price_get_multi(self, cr, uid, product_ids, context=None):
def price_get_multi(self, cr, uid, pricelist_ids, products_by_qty_by_partner, context=None): def price_get_multi(self, cr, uid, pricelist_ids, products_by_qty_by_partner, context=None):
"""multi products 'price_get'. """multi products 'price_get'.
@param pricelist_ids: @param pricelist_ids:
@param products_by_qty: @param products_by_qty:
@param partner: @param partner:
@param context: { @param context: {
'date': Date of the pricelist (%Y-%m-%d),} 'date': Date of the pricelist (%Y-%m-%d),}
@return: a dict of dict with product_id as key and a dict 'price by pricelist' as value @return: a dict of dict with product_id as key and a dict 'price by pricelist' as value
@ -234,7 +234,7 @@ class product_pricelist(osv.osv):
else: else:
price_tmp = self.price_get(cr, uid, price_tmp = self.price_get(cr, uid,
[res['base_pricelist_id']], product_id, [res['base_pricelist_id']], product_id,
qty)[res['base_pricelist_id']] qty, context=context)[res['base_pricelist_id']]
ptype_src = self.browse(cr, uid, res['base_pricelist_id']).currency_id.id ptype_src = self.browse(cr, uid, res['base_pricelist_id']).currency_id.id
price = currency_obj.compute(cr, uid, ptype_src, res['currency_id'], price_tmp, round=False) price = currency_obj.compute(cr, uid, ptype_src, res['currency_id'], price_tmp, round=False)
elif res['base'] == -2: elif res['base'] == -2:
@ -371,7 +371,7 @@ class product_pricelist(osv.osv):
'ORDER BY sequence', 'ORDER BY sequence',
(tmpl_id, prod_id, plversion['id'], qty)) (tmpl_id, prod_id, plversion['id'], qty))
res1 = cr.dictfetchall() res1 = cr.dictfetchall()
for res in res1: for res in res1:
item_id = 0 item_id = 0
if res: if res:
@ -386,7 +386,7 @@ class product_pricelist(osv.osv):
res['base_pricelist_id']).currency_id.id res['base_pricelist_id']).currency_id.id
price = currency_obj.compute(cr, uid, ptype_src, price = currency_obj.compute(cr, uid, ptype_src,
res['currency_id'], price_tmp, round=False) res['currency_id'], price_tmp, round=False)
break break
elif res['base'] == -2: elif res['base'] == -2:
where = [] where = []
if partner: if partner:
@ -413,7 +413,7 @@ class product_pricelist(osv.osv):
if price: if price:
price_limit = price price_limit = price
price = price * (1.0+(res['price_discount'] or 0.0)) price = price * (1.0+(res['price_discount'] or 0.0))
price = rounding(price, res['price_round']) price = rounding(price, res['price_round'])
price += (res['price_surcharge'] or 0.0) price += (res['price_surcharge'] or 0.0)
@ -422,14 +422,14 @@ class product_pricelist(osv.osv):
if res['price_max_margin']: if res['price_max_margin']:
price = min(price, price_limit+res['price_max_margin']) price = min(price, price_limit+res['price_max_margin'])
item_id = res['id'] item_id = res['id']
break break
else: else:
# False means no valid line found ! But we may not raise an # False means no valid line found ! But we may not raise an
# exception here because it breaks the search # exception here because it breaks the search
price = False price = False
result[id] = price result[id] = price
result['item_id'] = {id: item_id} result['item_id'] = {id: item_id}
if context and ('uom' in context): if context and ('uom' in context):
product = product_obj.browse(cr, uid, prod_id) product = product_obj.browse(cr, uid, prod_id)
uom = product.uos_id or product.uom_id uom = product.uos_id or product.uom_id
@ -559,7 +559,7 @@ class product_pricelist_item(osv.osv):
} }
_constraints = [ _constraints = [
(_check_recursion, _('Error ! You cannot assign the Main Pricelist as Other Pricelist in PriceList Item!'), ['base_pricelist_id']) (_check_recursion, 'Error ! You cannot assign the Main Pricelist as Other Pricelist in PriceList Item!', ['base_pricelist_id'])
] ]
def product_id_change(self, cr, uid, ids, product_id, context={}): def product_id_change(self, cr, uid, ids, product_id, context={}):

View File

@ -24,12 +24,40 @@ import decimal_precision as dp
import math import math
from _common import rounding from _common import rounding
import re import re
from tools.translate import _ from tools.translate import _
def is_pair(x): def is_pair(x):
return not x%2 return not x%2
def check_ean(eancode):
if not eancode:
return True
if len(eancode) <> 13:
return False
try:
int(eancode)
except:
return False
oddsum=0
evensum=0
total=0
eanvalue=eancode
reversevalue = eanvalue[::-1]
finalean=reversevalue[1:]
for i in range(len(finalean)):
if is_pair(i):
oddsum += int(finalean[i])
else:
evensum += int(finalean[i])
total=(oddsum * 3) + evensum
check = int(10 - math.ceil(total % 10.0))
if check != int(eancode[-1]):
return False
return True
#---------------------------------------------------------- #----------------------------------------------------------
# UOM # UOM
#---------------------------------------------------------- #----------------------------------------------------------
@ -69,7 +97,7 @@ class product_uom(osv.osv):
'name': fields.char('Name', size=64, required=True, translate=True), 'name': fields.char('Name', size=64, required=True, translate=True),
'category_id': fields.many2one('product.uom.categ', 'UoM Category', required=True, ondelete='cascade', 'category_id': fields.many2one('product.uom.categ', 'UoM Category', required=True, ondelete='cascade',
help="Quantity conversions may happen automatically between Units of Measure in the same category, according to their respective ratios."), help="Quantity conversions may happen automatically between Units of Measure in the same category, according to their respective ratios."),
'factor': fields.float('Ratio', required=True,digits=(12, 6), 'factor': fields.float('Ratio', required=True,digits=(12, 12),
help='How many times this UoM is smaller than the reference UoM in this category:\n'\ help='How many times this UoM is smaller than the reference UoM in this category:\n'\
'1 * (reference unit) = ratio * (this unit)'), '1 * (reference unit) = ratio * (this unit)'),
'factor_inv': fields.function(_factor_inv, digits_compute=dp.get_precision('Product UoM'), 'factor_inv': fields.function(_factor_inv, digits_compute=dp.get_precision('Product UoM'),
@ -106,9 +134,14 @@ class product_uom(osv.osv):
from_unit, to_unit = uoms[-1], uoms[0] from_unit, to_unit = uoms[-1], uoms[0]
return self._compute_qty_obj(cr, uid, from_unit, qty, to_unit) return self._compute_qty_obj(cr, uid, from_unit, qty, to_unit)
def _compute_qty_obj(self, cr, uid, from_unit, qty, to_unit, context={}): def _compute_qty_obj(self, cr, uid, from_unit, qty, to_unit, context=None):
if context is None:
context = {}
if from_unit.category_id.id <> to_unit.category_id.id: if from_unit.category_id.id <> to_unit.category_id.id:
return qty if context.get('raise-exception', True):
raise osv.except_osv(_('Error !'), _('Conversion from Product UoM m to Default UoM PCE is not possible as they both belong to different Category!.'))
else:
return qty
amount = qty / from_unit.factor amount = qty / from_unit.factor
if to_unit: if to_unit:
amount = rounding(amount * to_unit.factor, to_unit.rounding) amount = rounding(amount * to_unit.factor, to_unit.rounding)
@ -342,7 +375,7 @@ class product_product(osv.osv):
def _product_price(self, cr, uid, ids, name, arg, context={}): def _product_price(self, cr, uid, ids, name, arg, context={}):
res = {} res = {}
quantity = context.get('quantity', 1) quantity = context.get('quantity') or 1.0
pricelist = context.get('pricelist', False) pricelist = context.get('pricelist', False)
if pricelist: if pricelist:
for id in ids: for id in ids:
@ -423,7 +456,7 @@ class product_product(osv.osv):
'incoming_qty': fields.function(_product_incoming_qty, method=True, type='float', string='Incoming'), 'incoming_qty': fields.function(_product_incoming_qty, method=True, type='float', string='Incoming'),
'outgoing_qty': fields.function(_product_outgoing_qty, method=True, type='float', string='Outgoing'), 'outgoing_qty': fields.function(_product_outgoing_qty, method=True, type='float', string='Outgoing'),
'price': fields.function(_product_price, method=True, type='float', string='Pricelist', digits_compute=dp.get_precision('Sale Price')), 'price': fields.function(_product_price, method=True, type='float', string='Pricelist', digits_compute=dp.get_precision('Sale Price')),
'lst_price' : fields.function(_product_lst_price, method=True, type='float', string='List Price', digits_compute=dp.get_precision('Sale Price')), 'lst_price' : fields.function(_product_lst_price, method=True, type='float', string='Public Price', digits_compute=dp.get_precision('Sale Price')),
'code': fields.function(_product_code, method=True, type='char', string='Reference'), 'code': fields.function(_product_code, method=True, type='char', string='Reference'),
'partner_ref' : fields.function(_product_partner_ref, method=True, type='char', string='Customer ref'), 'partner_ref' : fields.function(_product_partner_ref, method=True, type='char', string='Customer ref'),
'default_code' : fields.char('Reference', size=64), 'default_code' : fields.char('Reference', size=64),
@ -447,32 +480,18 @@ class product_product(osv.osv):
return False return False
def _check_ean_key(self, cr, uid, ids): def _check_ean_key(self, cr, uid, ids):
for partner in self.browse(cr, uid, ids): for product in self.browse(cr, uid, ids):
if not partner.ean13: res = check_ean(product.ean13)
continue return res
if len(partner.ean13) <> 13:
return False
try:
int(partner.ean13)
except:
return False
sum=0
for i in range(12):
if is_pair(i):
sum += int(partner.ean13[i])
else:
sum += 3 * int(partner.ean13[i])
check = int(math.ceil(sum / 10.0) * 10 - sum)
if check != int(partner.ean13[12]):
return False
return True
_constraints = [(_check_ean_key, 'Error: Invalid ean code', ['ean13'])] _constraints = [(_check_ean_key, 'Error: Invalid ean code', ['ean13'])]
def on_order(self, cr, uid, ids, orderline, quantity): def on_order(self, cr, uid, ids, orderline, quantity):
pass pass
def name_get(self, cr, user, ids, context={}): def name_get(self, cr, user, ids, context=None):
if context is None:
context = {}
if not len(ids): if not len(ids):
return [] return []
def _name_get(d): def _name_get(d):
@ -480,10 +499,26 @@ class product_product(osv.osv):
code = d.get('default_code',False) code = d.get('default_code',False)
if code: if code:
name = '[%s] %s' % (code,name) name = '[%s] %s' % (code,name)
if d['variants']: if d.get('variants'):
name = name + ' - %s' % (d['variants'],) name = name + ' - %s' % (d['variants'],)
return (d['id'], name) return (d['id'], name)
result = map(_name_get, self.read(cr, user, ids, ['variants','name','default_code'], context))
partner_id = context.get('partner_id', False)
result = []
for product in self.browse(cr, user, ids, context=context):
sellers = filter(lambda x: x.name.id == partner_id, product.seller_ids)
if sellers:
for s in sellers:
mydict = {
'id': product.id,
'name': s.product_name or product.name,
'default_code': s.product_code or product.default_code,
'variants': product.variants
}
result.append(_name_get(mydict))
else:
result.append(_name_get(self.read(cr, user, product.id, ['variants','name','default_code'], context)))
return result return result
def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100): def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100):
@ -595,6 +630,13 @@ class product_packaging(osv.osv):
} }
def _check_ean_key(self, cr, uid, ids):
for pack in self.browse(cr, uid, ids):
res = check_ean(pack.ean)
return res
_constraints = [(_check_ean_key, 'Error: Invalid ean code', ['ean'])]
def name_get(self, cr, uid, ids, context={}): def name_get(self, cr, uid, ids, context={}):
if not len(ids): if not len(ids):
return [] return []
@ -649,7 +691,7 @@ class product_supplierinfo(osv.osv):
return res and res[0] or False return res and res[0] or False
_columns = { _columns = {
'name' : fields.many2one('res.partner', 'Supplier', required=True, ondelete='cascade', help="Supplier of this product"), 'name' : fields.many2one('res.partner', 'Supplier', required=True,domain = [('supplier','=',True)], ondelete='cascade', help="Supplier of this product"),
'product_name': fields.char('Supplier Product Name', size=128, help="This supplier's product name will be used when printing a request for quotation. Keep empty to use the internal one."), 'product_name': fields.char('Supplier Product Name', size=128, help="This supplier's product name will be used when printing a request for quotation. Keep empty to use the internal one."),
'product_code': fields.char('Supplier Product Code', size=64, help="This supplier's product code will be used when printing a request for quotation. Keep empty to use the internal one."), 'product_code': fields.char('Supplier Product Code', size=64, help="This supplier's product code will be used when printing a request for quotation. Keep empty to use the internal one."),
'sequence' : fields.integer('Sequence', help="Assigns the priority to the list of product supplier."), 'sequence' : fields.integer('Sequence', help="Assigns the priority to the list of product supplier."),

View File

@ -1,10 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<openerp> <openerp>
<data noupdate="1"> <data noupdate="1">
<!--
Resource: product.category <record id="base.user_demo" model="res.users">
--> <field eval="[(4, ref('base.group_sale_salesman'))]" name="groups_id"/>
</record>
<!--
Resource: product.category
-->
<record id="cat1" model="product.category"> <record id="cat1" model="product.category">
<field name="parent_id" ref="product.cat0"/> <field name="parent_id" ref="product.cat0"/>
<field name="name">Sellable</field> <field name="name">Sellable</field>
@ -52,40 +57,40 @@
<record id="product_category_marketableproduct0" model="product.category"> <record id="product_category_marketableproduct0" model="product.category">
<field name="name">Marketable Products</field> <field name="name">Marketable Products</field>
</record> </record>
<record id="product_category_shelves0" model="product.category"> <record id="product_category_shelves0" model="product.category">
<field name="parent_id" ref="product_category_marketableproduct0"/> <field name="parent_id" ref="product_category_marketableproduct0"/>
<field name="name">Shelves</field> <field name="name">Shelves</field>
</record> </record>
<record id="product_category_otherproducts0" model="product.category"> <record id="product_category_otherproducts0" model="product.category">
<field name="name">Other Products</field> <field name="name">Other Products</field>
</record> </record>
<record id="product_category_rawmaterial0" model="product.category"> <record id="product_category_rawmaterial0" model="product.category">
<field name="parent_id" ref="product_category_otherproducts0"/> <field name="parent_id" ref="product_category_otherproducts0"/>
<field name="name">Raw Materials</field> <field name="name">Raw Materials</field>
</record> </record>
<record id="product_category_services0" model="product.category"> <record id="product_category_services0" model="product.category">
<field name="parent_id" ref="product_category_marketableproduct0"/> <field name="parent_id" ref="product_category_marketableproduct0"/>
<field name="name">Marketable Services</field> <field name="name">Marketable Services</field>
</record> </record>
<record id="product_category_misc0" model="product.category"> <record id="product_category_misc0" model="product.category">
<field name="parent_id" ref="product_category_otherproducts0"/> <field name="parent_id" ref="product_category_otherproducts0"/>
<field name="name">Misc</field> <field name="name">Misc</field>
</record> </record>
<record id="product_ul_box" model="product.ul"> <record id="product_ul_box" model="product.ul">
<field name="name">Box 20x20x40</field> <field name="name">Box 20x20x40</field>
<field name="type">box</field> <field name="type">box</field>
@ -94,11 +99,11 @@
<field name="name">Box 30x40x60</field> <field name="name">Box 30x40x60</field>
<field name="type">box</field> <field name="type">box</field>
</record> </record>
<!-- <!--
Resource: product.product Resource: product.product
--> -->
<record id="product_product_0" model="product.product"> <record id="product_product_0" model="product.product">
<field name="list_price">38.25</field> <field name="list_price">38.25</field>
<field name="standard_price">25.5</field> <field name="standard_price">25.5</field>
@ -126,6 +131,7 @@
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="sale_delay">2.0</field> <field name="sale_delay">2.0</field>
<field name="name">Basic PC</field> <field name="name">Basic PC</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_pc"/> <field name="categ_id" ref="product_category_pc"/>
</record> </record>
<record id="product_product_pc2" model="product.product"> <record id="product_product_pc2" model="product.product">
@ -138,6 +144,7 @@
<field name="procure_method">make_to_order</field> <field name="procure_method">make_to_order</field>
<field name="sale_delay">18.0</field> <field name="sale_delay">18.0</field>
<field name="name">Basic+ PC (assembly on order)</field> <field name="name">Basic+ PC (assembly on order)</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_pc"/> <field name="categ_id" ref="product_category_pc"/>
</record> </record>
<record id="product_product_pc3" model="product.product"> <record id="product_product_pc3" model="product.product">
@ -149,6 +156,7 @@
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="sale_delay">3.0</field> <field name="sale_delay">3.0</field>
<field name="name">Medium PC</field> <field name="name">Medium PC</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_pc"/> <field name="categ_id" ref="product_category_pc"/>
</record> </record>
<record id="product_product_pc4" model="product.product"> <record id="product_product_pc4" model="product.product">
@ -160,6 +168,7 @@
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="procure_method">make_to_order</field> <field name="procure_method">make_to_order</field>
<field name="name">Customizable PC</field> <field name="name">Customizable PC</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_pc"/> <field name="categ_id" ref="product_category_pc"/>
<field name="state">end</field> <field name="state">end</field>
</record> </record>
@ -171,6 +180,7 @@
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="sale_delay">1.0</field> <field name="sale_delay">1.0</field>
<field name="name">Mainboard ASUStek A7N8X</field> <field name="name">Mainboard ASUStek A7N8X</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_10"/> <field name="categ_id" ref="product_category_10"/>
</record> </record>
<record id="product_product_mb2" model="product.product"> <record id="product_product_mb2" model="product.product">
@ -181,6 +191,7 @@
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="sale_delay">1.0</field> <field name="sale_delay">1.0</field>
<field name="name">Mainboard ASUStek A7V8X-X</field> <field name="name">Mainboard ASUStek A7V8X-X</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_10"/> <field name="categ_id" ref="product_category_10"/>
<field name="state">draft</field> <field name="state">draft</field>
</record> </record>
@ -192,6 +203,7 @@
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="sale_delay">1.0</field> <field name="sale_delay">1.0</field>
<field name="name">Processor AMD Athlon XP 1800+</field> <field name="name">Processor AMD Athlon XP 1800+</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_10"/> <field name="categ_id" ref="product_category_10"/>
</record> </record>
<record id="product_product_cpu3" model="product.product"> <record id="product_product_cpu3" model="product.product">
@ -202,6 +214,7 @@
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="sale_delay">1.0</field> <field name="sale_delay">1.0</field>
<field name="name">Processor AMD Athlon XP 2200+</field> <field name="name">Processor AMD Athlon XP 2200+</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_10"/> <field name="categ_id" ref="product_category_10"/>
</record> </record>
<record id="product_product_hdd1" model="product.product"> <record id="product_product_hdd1" model="product.product">
@ -212,6 +225,7 @@
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="sale_delay">1.0</field> <field name="sale_delay">1.0</field>
<field name="name">HDD Seagate 7200.8 80GB</field> <field name="name">HDD Seagate 7200.8 80GB</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_10"/> <field name="categ_id" ref="product_category_10"/>
</record> </record>
<record id="product_product_hdd2" model="product.product"> <record id="product_product_hdd2" model="product.product">
@ -222,6 +236,7 @@
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="sale_delay">1.0</field> <field name="sale_delay">1.0</field>
<field name="name">HDD Seagate 7200.8 120GB</field> <field name="name">HDD Seagate 7200.8 120GB</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_10"/> <field name="categ_id" ref="product_category_10"/>
</record> </record>
<record id="product_product_hdd3" model="product.product"> <record id="product_product_hdd3" model="product.product">
@ -233,6 +248,7 @@
<field name="procure_method">make_to_order</field> <field name="procure_method">make_to_order</field>
<field name="sale_delay">1.0</field> <field name="sale_delay">1.0</field>
<field name="name">HDD Seagate 7200.8 160GB</field> <field name="name">HDD Seagate 7200.8 160GB</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_10"/> <field name="categ_id" ref="product_category_10"/>
</record> </record>
<record id="product_product_fan" model="product.product"> <record id="product_product_fan" model="product.product">
@ -243,6 +259,7 @@
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="sale_delay">1.0</field> <field name="sale_delay">1.0</field>
<field name="name">Regular case fan 80mm</field> <field name="name">Regular case fan 80mm</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_10"/> <field name="categ_id" ref="product_category_10"/>
</record> </record>
<record id="product_product_fan2" model="product.product"> <record id="product_product_fan2" model="product.product">
@ -253,6 +270,7 @@
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="sale_delay">1.0</field> <field name="sale_delay">1.0</field>
<field name="name">Silent fan</field> <field name="name">Silent fan</field>
<field name="type">product</field>
<field name="categ_id" ref="cat1"/> <field name="categ_id" ref="cat1"/>
</record> </record>
<record id="product_product_cpu_gen" model="product.product"> <record id="product_product_cpu_gen" model="product.product">
@ -265,6 +283,7 @@
<field name="sale_delay">1.0</field> <field name="sale_delay">1.0</field>
<field name="name">Regular processor config</field> <field name="name">Regular processor config</field>
<field name="procure_method">make_to_order</field> <field name="procure_method">make_to_order</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_10"/> <field name="categ_id" ref="product_category_10"/>
</record> </record>
<record id="product_product_ram" model="product.product"> <record id="product_product_ram" model="product.product">
@ -275,6 +294,7 @@
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="sale_delay">1.0</field> <field name="sale_delay">1.0</field>
<field name="name">DDR 256MB PC400</field> <field name="name">DDR 256MB PC400</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_pc"/> <field name="categ_id" ref="product_category_pc"/>
</record> </record>
<record id="product_product_ram512" model="product.product"> <record id="product_product_ram512" model="product.product">
@ -285,6 +305,7 @@
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="sale_delay">1.0</field> <field name="sale_delay">1.0</field>
<field name="name">DDR 512MB PC400</field> <field name="name">DDR 512MB PC400</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_10"/> <field name="categ_id" ref="product_category_10"/>
</record> </record>
<record id="product_product_cpu2" model="product.product"> <record id="product_product_cpu2" model="product.product">
@ -297,6 +318,7 @@
<field name="procure_method">make_to_order</field> <field name="procure_method">make_to_order</field>
<field name="sale_delay">1.0</field> <field name="sale_delay">1.0</field>
<field name="name">High speed processor config</field> <field name="name">High speed processor config</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_10"/> <field name="categ_id" ref="product_category_10"/>
</record> </record>
<record id="product_product_tow1" model="product.product"> <record id="product_product_tow1" model="product.product">
@ -307,6 +329,7 @@
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="sale_delay">1.0</field> <field name="sale_delay">1.0</field>
<field name="name">ATX Mid-size Tower</field> <field name="name">ATX Mid-size Tower</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_10"/> <field name="categ_id" ref="product_category_10"/>
</record> </record>
<record id="product_product_20" model="product.product"> <record id="product_product_20" model="product.product">
@ -319,6 +342,7 @@
<field name="procure_method">make_to_order</field> <field name="procure_method">make_to_order</field>
<field name="sale_delay">1.0</field> <field name="sale_delay">1.0</field>
<field name="name">HDD on demand</field> <field name="name">HDD on demand</field>
<field name="type">product</field>
<field eval="False" name="sale_ok"/> <field eval="False" name="sale_ok"/>
<field name="categ_id" ref="product_category_10"/> <field name="categ_id" ref="product_category_10"/>
</record> </record>
@ -331,6 +355,7 @@
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="name">RAM on demand</field> <field name="name">RAM on demand</field>
<field eval="False" name="sale_ok"/> <field eval="False" name="sale_ok"/>
<field name="type">product</field>
<field name="categ_id" ref="product_category_10"/> <field name="categ_id" ref="product_category_10"/>
</record> </record>
<record id="product_product_22" model="product.product"> <record id="product_product_22" model="product.product">
@ -341,6 +366,7 @@
<field name="uom_id" ref="product_uom_unit"/> <field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="name">Processor on demand</field> <field name="name">Processor on demand</field>
<field name="type">product</field>
<field eval="False" name="sale_ok"/> <field eval="False" name="sale_ok"/>
<field name="categ_id" ref="product_category_10"/> <field name="categ_id" ref="product_category_10"/>
</record> </record>
@ -352,6 +378,7 @@
<field name="uom_id" ref="product_uom_unit"/> <field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="name">Complete PC With Peripherals</field> <field name="name">Complete PC With Peripherals</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_10"/> <field name="categ_id" ref="product_category_10"/>
</record> </record>
<record id="product_product_24" model="product.product"> <record id="product_product_24" model="product.product">
@ -362,6 +389,7 @@
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="name">Keyboard</field> <field name="name">Keyboard</field>
<field name="variants">AZERTY</field> <field name="variants">AZERTY</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_10"/> <field name="categ_id" ref="product_category_10"/>
</record> </record>
<record id="product_product_25" model="product.product"> <record id="product_product_25" model="product.product">
@ -371,6 +399,7 @@
<field name="uom_id" ref="product_uom_unit"/> <field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="name">Mouse</field> <field name="name">Mouse</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_10"/> <field name="categ_id" ref="product_category_10"/>
</record> </record>
<record id="product_product_26" model="product.product"> <record id="product_product_26" model="product.product">
@ -381,6 +410,7 @@
<field name="uom_id" ref="product_uom_unit"/> <field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="name">Kit Keyboard + Mouse</field> <field name="name">Kit Keyboard + Mouse</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_11"/> <field name="categ_id" ref="product_category_11"/>
</record> </record>
@ -388,213 +418,223 @@
Resource: product.product NEW EVV Resource: product.product NEW EVV
--> -->
<record id="product_product_shelfofcm0" model="product.product"> <record id="product_product_shelfofcm0" model="product.product">
<field name="default_code">SHE100</field> <field name="default_code">SHE100</field>
<field name="supply_method">produce</field> <field name="supply_method">produce</field>
<field name="list_price">130.0</field> <field name="list_price">130.0</field>
<field name="standard_price">50.0</field> <field name="standard_price">50.0</field>
<field name="uom_id" ref="product_uom_unit"/> <field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="name">Shelf of 100cm</field> <field name="name">Shelf of 100cm</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_shelves0"/> <field name="categ_id" ref="product_category_shelves0"/>
</record> </record>
<record id="product_product_shelfofcm1" model="product.product"> <record id="product_product_shelfofcm1" model="product.product">
<field name="default_code">SHE200</field> <field name="default_code">SHE200</field>
<field name="supply_method">produce</field> <field name="supply_method">produce</field>
<field eval="'make_to_order'" name="procure_method"/> <field eval="'make_to_order'" name="procure_method"/>
<field name="list_price">210.0</field> <field name="list_price">210.0</field>
<field name="standard_price">80.0</field> <field name="standard_price">80.0</field>
<field name="uom_id" ref="product_uom_unit"/> <field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="name">Shelf of 200cm</field> <field name="name">Shelf of 200cm</field>
<field name="categ_id" ref="product_category_shelves0"/> <field name="type">product</field>
</record> <field name="categ_id" ref="product_category_shelves0"/>
<record id="product_product_woodmm0" model="product.product"> </record>
<record id="product_product_woodmm0" model="product.product">
<field name="default_code">WOOD002</field> <field name="default_code">WOOD002</field>
<field name="supply_method">buy</field> <field name="supply_method">buy</field>
<field name="standard_price">5.0</field> <field name="standard_price">5.0</field>
<field name="uom_id" ref="product_uom_meter"/> <field name="uom_id" ref="product_uom_meter"/>
<field name="uom_po_id" ref="product_uom_meter"/> <field name="uom_po_id" ref="product_uom_meter"/>
<field name="name">Wood 2mm</field> <field name="name">Wood 2mm</field>
<field eval="10" name="seller_delay"/> <field eval="10" name="seller_delay"/>
<field eval="7.0" name="sale_delay"/> <field eval="7.0" name="sale_delay"/>
<field name="categ_id" ref="product_category_rawmaterial0"/> <field name="type">product</field>
</record> <field name="categ_id" ref="product_category_rawmaterial0"/>
</record>
<record id="product_product_kitchendesignproject0" model="product.product"> <record id="product_product_kitchendesignproject0" model="product.product">
<field name="default_code">PROJ</field> <field name="default_code">PROJ</field>
<field name="supply_method">produce</field> <field name="supply_method">produce</field>
<field eval="'make_to_order'" name="procure_method"/> <field eval="'make_to_order'" name="procure_method"/>
<field name="type">service</field> <field name="type">service</field>
<field name="list_price">90.0</field> <field name="list_price">90.0</field>
<field name="standard_price">20.0</field> <field name="standard_price">20.0</field>
<field name="uom_id" ref="uom_hour"/> <field name="uom_id" ref="uom_hour"/>
<field name="uom_po_id" ref="uom_hour"/> <field name="uom_po_id" ref="uom_hour"/>
<field name="name">Kitchen Design Project</field> <field name="name">Kitchen Design Project</field>
<field name="categ_id" ref="product_category_services0"/> <field name="categ_id" ref="product_category_services0"/>
</record> </record>
<record id="product_product_employee0" model="product.product"> <record id="product_product_employee0" model="product.product">
<field name="default_code">EMPL</field> <field name="default_code">EMPL</field>
<field name="supply_method">produce</field> <field name="supply_method">produce</field>
<field eval="'make_to_order'" name="procure_method"/> <field eval="'make_to_order'" name="procure_method"/>
<field name="type">service</field> <field name="type">service</field>
<field name="list_price">200.0</field> <field name="list_price">200.0</field>
<field name="standard_price">50.0</field> <field name="standard_price">50.0</field>
<field name="uom_id" ref="uom_hour"/> <field name="uom_id" ref="uom_hour"/>
<field name="uom_po_id" ref="uom_hour"/> <field name="uom_po_id" ref="uom_hour"/>
<field name="name">Employee</field> <field name="name">Employee</field>
<field name="categ_id" ref="product_category_services0"/> <field name="categ_id" ref="product_category_services0"/>
</record> </record>
<record id="product_product_restaurantexpenses0" model="product.product"> <record id="product_product_restaurantexpenses0" model="product.product">
<field name="default_code">REST</field> <field name="default_code">REST</field>
<field name="supply_method">produce</field> <field name="supply_method">produce</field>
<field eval="'make_to_order'" name="procure_method"/> <field eval="'make_to_order'" name="procure_method"/>
<field name="type">consu</field>
<field name="list_price">1.0</field> <field name="list_price">1.0</field>
<field name="standard_price">1.0</field> <field name="standard_price">1.0</field>
<field name="uom_id" ref="product_uom_unit"/> <field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="name">Restaurant Expenses</field> <field name="name">Restaurant Expenses</field>
<field name="categ_id" ref="product_category_otherproducts0"/> <field name="categ_id" ref="product_category_otherproducts0"/>
</record> </record>
<record id="product_product_worker0" model="product.product"> <record id="product_product_worker0" model="product.product">
<field name="default_code">WORK</field> <field name="default_code">WORK</field>
<field name="supply_method">produce</field> <field name="supply_method">produce</field>
<field name="type">service</field> <field name="type">service</field>
<field eval="'make_to_order'" name="procure_method"/> <field eval="'make_to_order'" name="procure_method"/>
<field eval="0" name="sale_ok"/> <field eval="0" name="sale_ok"/>
<field eval="1" name="purchase_ok"/> <field eval="1" name="purchase_ok"/>
<field name="standard_price">20.0</field> <field name="standard_price">20.0</field>
<field name="uom_id" ref="uom_hour"/> <field name="uom_id" ref="uom_hour"/>
<field name="uom_po_id" ref="uom_hour"/> <field name="uom_po_id" ref="uom_hour"/>
<field name="name">Worker</field> <field name="name">Worker</field>
<field name="categ_id" ref="product_category_services0"/> <field name="categ_id" ref="product_category_services0"/>
</record> </record>
<record id="product_product_rearpanelarm0" model="product.product"> <record id="product_product_rearpanelarm0" model="product.product">
<field name="default_code">RPAN100</field> <field name="default_code">RPAN100</field>
<field name="supply_method">buy</field> <field name="supply_method">buy</field>
<field name="standard_price">10.0</field> <field name="standard_price">10.0</field>
<field eval="0" name="sale_ok"/> <field eval="0" name="sale_ok"/>
<field name="uom_id" ref="product_uom_unit"/> <field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="name">Rear Panel SHE100</field> <field name="name">Rear Panel SHE100</field>
<field eval="5" name="seller_delay"/> <field eval="5" name="seller_delay"/>
<field name="categ_id" ref="product_category_misc0"/> <field name="type">product</field>
</record> <field name="categ_id" ref="product_category_misc0"/>
</record>
<record id="product_product_rearpanelarm1" model="product.product"> <record id="product_product_rearpanelarm1" model="product.product">
<field name="default_code">RPAN200</field> <field name="default_code">RPAN200</field>
<field name="supply_method">buy</field> <field name="supply_method">buy</field>
<field name="standard_price">13.0</field> <field name="standard_price">13.0</field>
<field eval="0" name="sale_ok"/> <field eval="0" name="sale_ok"/>
<field name="uom_id" ref="product_uom_unit"/> <field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="name">Rear Panel SHE200</field> <field name="name">Rear Panel SHE200</field>
<field eval="5" name="seller_delay"/> <field eval="5" name="seller_delay"/>
<field name="categ_id" ref="product_category_misc0"/> <field name="type">product</field>
</record> <field name="categ_id" ref="product_category_misc0"/>
</record>
<record id="product_product_sidepanel0" model="product.product"> <record id="product_product_sidepanel0" model="product.product">
<field name="default_code">SIDEPAN</field> <field name="default_code">SIDEPAN</field>
<field name="supply_method">buy</field> <field name="supply_method">buy</field>
<field name="standard_price">3.0</field> <field name="standard_price">3.0</field>
<field eval="0" name="sale_ok"/> <field eval="0" name="sale_ok"/>
<field name="uom_id" ref="product_uom_unit"/> <field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="name">Side Panel</field> <field name="name">Side Panel</field>
<field eval="5" name="seller_delay"/> <field eval="5" name="seller_delay"/>
<field name="categ_id" ref="product_category_misc0"/> <field name="type">product</field>
</record> <field name="categ_id" ref="product_category_misc0"/>
</record>
<record id="product_product_shelf0" model="product.product"> <record id="product_product_shelf0" model="product.product">
<field name="default_code">RCK100</field> <field name="default_code">RCK100</field>
<field name="supply_method">buy</field> <field name="supply_method">buy</field>
<field name="standard_price">5.0</field> <field name="standard_price">5.0</field>
<field eval="0" name="sale_ok"/> <field eval="0" name="sale_ok"/>
<field name="uom_id" ref="product_uom_unit"/> <field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="name">Rack 100cm</field> <field name="name">Rack 100cm</field>
<field eval="8" name="seller_delay"/> <field eval="8" name="seller_delay"/>
<field name="categ_id" ref="product_category_misc0"/> <field name="type">product</field>
</record> <field name="categ_id" ref="product_category_misc0"/>
</record>
<record id="product_product_shelf1" model="product.product"> <record id="product_product_shelf1" model="product.product">
<field name="default_code">RCK200</field> <field name="default_code">RCK200</field>
<field name="supply_method">buy</field> <field name="supply_method">buy</field>
<field name="standard_price">4.0</field> <field name="standard_price">4.0</field>
<field eval="0" name="sale_ok"/> <field eval="0" name="sale_ok"/>
<field name="uom_id" ref="product_uom_unit"/> <field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="name">Rack 200cm</field> <field name="name">Rack 200cm</field>
<field eval="8" name="seller_delay"/> <field eval="8" name="seller_delay"/>
<field name="categ_id" ref="product_category_misc0"/> <field name="type">product</field>
</record> <field name="categ_id" ref="product_category_misc0"/>
</record>
<record id="product_product_assemblysection0" model="product.product"> <record id="product_product_assemblysection0" model="product.product">
<field name="default_code">PROFIL</field> <field name="default_code">PROFIL</field>
<field name="supply_method">produce</field> <field name="supply_method">produce</field>
<field name="list_price">1.0</field> <field name="list_price">1.0</field>
<field name="standard_price">2.0</field> <field name="standard_price">2.0</field>
<field name="uom_id" ref="product_uom_unit"/> <field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="name">Assembly Section</field> <field name="name">Assembly Section</field>
<field name="type">product</field>
<field name="categ_id" ref="product_category_misc0"/> <field name="categ_id" ref="product_category_misc0"/>
</record> </record>
<record id="product_product_woodlintelm0" model="product.product"> <record id="product_product_woodlintelm0" model="product.product">
<field name="default_code">LIN40</field> <field name="default_code">LIN40</field>
<field name="supply_method">buy</field> <field name="supply_method">buy</field>
<field name="standard_price">8.0</field> <field name="standard_price">8.0</field>
<field eval="0" name="sale_ok"/> <field eval="0" name="sale_ok"/>
<field name="uom_id" ref="product_uom_unit"/> <field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="name">Wood Lintel 4m</field> <field name="name">Wood Lintel 4m</field>
<field eval="10" name="seller_delay"/> <field eval="10" name="seller_delay"/>
<field name="categ_id" ref="product_category_misc0"/> <field name="type">product</field>
</record> <field name="categ_id" ref="product_category_misc0"/>
</record>
<record id="product_product_metalcleats0" model="product.product"> <record id="product_product_metalcleats0" model="product.product">
<field name="default_code">METC000</field> <field name="default_code">METC000</field>
<field name="supply_method">buy</field> <field name="supply_method">buy</field>
<field eval="0" name="sale_ok"/> <field eval="0" name="sale_ok"/>
<field name="uom_id" ref="product_uom_unit"/> <field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="name">Metal Cleats</field> <field name="name">Metal Cleats</field>
<field eval="20" name="seller_delay"/> <field eval="20" name="seller_delay"/>
<field name="categ_id" ref="product_category_misc0"/> <field name="type">product</field>
</record> <field name="categ_id" ref="product_category_misc0"/>
</record>
<record id="product_product_hotelexpenses0" model="product.product"> <record id="product_product_hotelexpenses0" model="product.product">
<field name="default_code">HOT</field> <field name="default_code">HOT</field>
<field name="supply_method">produce</field> <field name="supply_method">produce</field>
<field eval="'make_to_order'" name="procure_method"/> <field eval="'make_to_order'" name="procure_method"/>
<field name="type">consu</field>
<field name="list_price">1.0</field> <field name="list_price">1.0</field>
<field name="standard_price">1.0</field> <field name="standard_price">1.0</field>
<field name="uom_id" ref="product_uom_unit"/> <field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="name">Hotel Expenses</field> <field name="name">Hotel Expenses</field>
<field name="categ_id" ref="product_category_otherproducts0"/> <field name="categ_id" ref="product_category_otherproducts0"/>
</record> </record>
<record id="product_product_kitshelfofcm0" model="product.product"> <record id="product_product_kitshelfofcm0" model="product.product">
<field name="default_code">SHE100KIT</field> <field name="default_code">SHE100KIT</field>
<field name="supply_method">produce</field> <field name="supply_method">produce</field>
<field eval="'make_to_order'" name="procure_method"/> <field eval="'make_to_order'" name="procure_method"/>
<field name="list_price">110.0</field> <field name="list_price">110.0</field>
<field name="standard_price">48.0</field> <field name="standard_price">48.0</field>
<field name="uom_id" ref="product_uom_unit"/> <field name="uom_id" ref="product_uom_unit"/>
<field name="uom_po_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/>
<field name="name">KIT Shelf of 100cm</field> <field name="name">KIT Shelf of 100cm</field>
<field eval="0" name="purchase_ok"/> <field eval="0" name="purchase_ok"/>
<field name="categ_id" ref="product_category_shelves0"/> <field name="type">product</field>
</record> <field name="categ_id" ref="product_category_shelves0"/>
</record>
<!-- <!--
Resource: product.supplierinfo Resource: product.supplierinfo
@ -741,77 +781,76 @@
Resource: product.supplierinfo NEW for training Resource: product.supplierinfo NEW for training
--> -->
<record id="product_supplierinfo_0" model="product.supplierinfo"> <record id="product_supplierinfo_0" model="product.supplierinfo">
<field name="product_id" ref="product_product_rearpanelarm0"/> <field name="product_id" ref="product_product_rearpanelarm0"/>
<field name="delay">10</field> <field name="delay">10</field>
<field name="min_qty">1</field> <field name="min_qty">1</field>
<field name="name" ref="base.res_partner_woodywoodpecker0"/> <field name="name" ref="base.res_partner_woodywoodpecker0"/>
</record> </record>
<record id="product_supplierinfo_1" model="product.supplierinfo"> <record id="product_supplierinfo_1" model="product.supplierinfo">
<field name="product_id" ref="product_product_rearpanelarm0"/> <field name="product_id" ref="product_product_rearpanelarm0"/>
<field name="delay">5</field> <field name="delay">5</field>
<field name="min_qty">1</field> <field name="min_qty">1</field>
<field name="name" ref="base.res_partner_woodywoodpecker0"/> <field name="name" ref="base.res_partner_woodywoodpecker0"/>
</record> </record>
<record id="product_supplierinfo_2" model="product.supplierinfo"> <record id="product_supplierinfo_2" model="product.supplierinfo">
<field name="product_id" ref="product_product_rearpanelarm1"/> <field name="product_id" ref="product_product_rearpanelarm1"/>
<field name="delay">5</field> <field name="delay">5</field>
<field name="min_qty">1</field> <field name="min_qty">1</field>
<field name="name" ref="base.res_partner_woodywoodpecker0"/> <field name="name" ref="base.res_partner_woodywoodpecker0"/>
</record> </record>
<record id="product_supplierinfo_3" model="product.supplierinfo"> <record id="product_supplierinfo_3" model="product.supplierinfo">
<field name="product_id" ref="product_product_sidepanel0"/> <field name="product_id" ref="product_product_sidepanel0"/>
<field name="delay">5</field> <field name="delay">5</field>
<field name="min_qty">1</field> <field name="min_qty">1</field>
<field name="name" ref="base.res_partner_woodywoodpecker0"/> <field name="name" ref="base.res_partner_woodywoodpecker0"/>
</record> </record>
<record id="product_supplierinfo_4" model="product.supplierinfo"> <record id="product_supplierinfo_4" model="product.supplierinfo">
<field name="product_id" ref="product_product_shelfofcm0"/> <field name="product_id" ref="product_product_shelfofcm0"/>
<field name="delay">8</field> <field name="delay">8</field>
<field name="min_qty">1</field> <field name="min_qty">1</field>
<field name="name" ref="base.res_partner_woodywoodpecker0"/> <field name="name" ref="base.res_partner_woodywoodpecker0"/>
</record> </record>
<record id="product_supplierinfo_5" model="product.supplierinfo"> <record id="product_supplierinfo_5" model="product.supplierinfo">
<field name="product_id" ref="product_product_shelfofcm1"/> <field name="product_id" ref="product_product_shelfofcm1"/>
<field name="delay">8</field> <field name="delay">8</field>
<field name="min_qty">1</field> <field name="min_qty">1</field>
<field name="name" ref="base.res_partner_woodywoodpecker0"/> <field name="name" ref="base.res_partner_woodywoodpecker0"/>
</record> </record>
<record id="product_supplierinfo_6" model="product.supplierinfo"> <record id="product_supplierinfo_6" model="product.supplierinfo">
<field name="product_id" ref="product_product_assemblysection0"/> <field name="product_id" ref="product_product_assemblysection0"/>
<field name="delay">2</field> <field name="delay">2</field>
<field name="min_qty">1</field> <field name="min_qty">1</field>
<field name="name" ref="base.res_partner_woodywoodpecker0"/> <field name="name" ref="base.res_partner_woodywoodpecker0"/>
</record> </record>
<record id="product_supplierinfo_7" model="product.supplierinfo"> <record id="product_supplierinfo_7" model="product.supplierinfo">
<field name="product_id" ref="product_product_woodlintelm0"/> <field name="product_id" ref="product_product_woodlintelm0"/>
<field name="delay">10</field> <field name="delay">10</field>
<field name="min_qty">1</field> <field name="min_qty">1</field>
<field name="name" ref="base.res_partner_woodywoodpecker0"/> <field name="name" ref="base.res_partner_woodywoodpecker0"/>
</record> </record>
<record id="product_supplierinfo_8" model="product.supplierinfo"> <record id="product_supplierinfo_8" model="product.supplierinfo">
<field name="product_id" ref="product_product_metalcleats0"/> <field name="product_id" ref="product_product_metalcleats0"/>
<field name="delay">20</field> <field name="delay">20</field>
<field name="min_qty">1</field> <field name="min_qty">1</field>
<field name="name" ref="base.res_partner_woodywoodpecker0"/> <field name="name" ref="base.res_partner_woodywoodpecker0"/>
</record> </record>
</data> </data>

View File

@ -51,8 +51,8 @@
<field name="qty_available"/> <field name="qty_available"/>
<field name="virtual_available"/> <field name="virtual_available"/>
<field name="lst_price"/> <field name="lst_price"/>
<field name="standard_price"/>
<field name="price" invisible="not context.get('pricelist',False)"/> <field name="price" invisible="not context.get('pricelist',False)"/>
<field name="standard_price"/>
<field name="state" groups="base.group_extended"/> <field name="state" groups="base.group_extended"/>
</tree> </tree>
</field> </field>

View File

@ -45,19 +45,19 @@ class stock_production_lot(osv.osv):
_columns = { _columns = {
'life_date': fields.datetime('End of Life Date', 'life_date': fields.datetime('End of Life Date',
help='The date the lot may become dangerous and should not be consumed.'), help='The date on which the lot may become dangerous and should not be consumed.'),
'use_date': fields.datetime('Best before Date', 'use_date': fields.datetime('Best before Date',
help='The date the lot starts deteriorating without becoming dangerous.'), help='The date on which the lot starts deteriorating without becoming dangerous.'),
'removal_date': fields.datetime('Removal Date', 'removal_date': fields.datetime('Removal Date',
help='The date the lot should be removed.'), help='The date on which the lot should be removed.'),
'alert_date': fields.datetime('Alert Date', help="The date signifying an alert to notify about the production lot."), 'alert_date': fields.datetime('Alert Date', help="The date on which an alert should be notified about the production lot."),
} }
# Assign dates according to products data # Assign dates according to products data
def create(self, cr, uid, vals, context=None): def create(self, cr, uid, vals, context=None):
newid = super(stock_production_lot, self).create(cr, uid, vals, context=context) newid = super(stock_production_lot, self).create(cr, uid, vals, context=context)
obj = self.browse(cr, uid, newid, context=context) obj = self.browse(cr, uid, newid, context=context)
towrite = [] towrite = []
for f in ('life_date','use_date','removal_date','alert_date'): for f in ('life_date', 'use_date', 'removal_date', 'alert_date'):
if not getattr(obj, f): if not getattr(obj, f):
towrite.append(f) towrite.append(f)
context = context or {} context = context or {}
@ -82,8 +82,7 @@ class product_product(osv.osv):
help='The number of days before a production lot starts deteriorating without becoming dangerous.'), help='The number of days before a production lot starts deteriorating without becoming dangerous.'),
'removal_time': fields.integer('Product Removal Time', 'removal_time': fields.integer('Product Removal Time',
help='The number of days before a production lot should be removed.'), help='The number of days before a production lot should be removed.'),
'alert_time': fields.integer('Product Alert Time', help="The number of days after which, needs an alert to notify about the production lot."), 'alert_time': fields.integer('Product Alert Time', help="The number of days after which an alert should be notified about the production lot."),
} }
product_product() product_product()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -43,7 +43,7 @@ class sale_order_line(osv.osv):
uom=False, qty_uos=0, uos=False, name='', partner_id=False, uom=False, qty_uos=0, uos=False, name='', partner_id=False,
lang=False, update_tax=True,date_order=False,packaging=False,fiscal_position=False, flag=False): lang=False, update_tax=True,date_order=False,packaging=False,fiscal_position=False, flag=False):
def get_real_price(res_dict, product_id, pricelist): def get_real_price(res_dict, product_id, qty, uom, pricelist):
item_obj = self.pool.get('product.pricelist.item') item_obj = self.pool.get('product.pricelist.item')
price_type_obj = self.pool.get('product.price.type') price_type_obj = self.pool.get('product.price.type')
product_obj = self.pool.get('product.product') product_obj = self.pool.get('product.product')
@ -56,10 +56,17 @@ class sale_order_line(osv.osv):
if item_base > 0: if item_base > 0:
field_name = price_type_obj.browse(cr, uid, item_base).field field_name = price_type_obj.browse(cr, uid, item_base).field
product_tmpl_id = product_obj.browse(cr, uid, product_id, context).product_tmpl_id.id product = product_obj.browse(cr, uid, product_id, context)
product_tmpl_id = product.product_tmpl_id.id
product_read = template_obj.read(cr, uid, product_tmpl_id, [field_name], context) product_read = template_obj.read(cr, uid, product_tmpl_id, [field_name], context)
return product_read[field_name]
factor = 1.0
if uom and uom != product.uom_id.id:
product_uom_obj = self.pool.get('product.uom')
uom_data = product_uom_obj.browse(cr, uid, product.uom_id.id)
factor = uom_data.factor
return product_read[field_name] * factor
res=super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty, res=super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty,
@ -84,7 +91,7 @@ class sale_order_line(osv.osv):
pricelists = pricelist_obj.read(cr,uid,[pricelist],['visible_discount']) pricelists = pricelist_obj.read(cr,uid,[pricelist],['visible_discount'])
old_uom = product.uos_id or product.uom_id old_uom = product.uos_id or product.uom_id
new_list_price = get_real_price(list_price, product.id, pricelist) new_list_price = get_real_price(list_price, product.id, qty, uom, pricelist)
if(len(pricelists)>0 and pricelists[0]['visible_discount'] and list_price[pricelist] != 0): if(len(pricelists)>0 and pricelists[0]['visible_discount'] and list_price[pricelist] != 0):
discount = (new_list_price - price) / new_list_price * 100 discount = (new_list_price - price) / new_list_price * 100
result['price_unit'] = new_list_price result['price_unit'] = new_list_price
@ -101,7 +108,7 @@ class account_invoice_line(osv.osv):
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context={}): def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context={}):
res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, currency_id, context) res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, currency_id, context)
def get_real_price(res_dict, product_id, pricelist): def get_real_price(res_dict, product_id, qty, uom, pricelist):
item_obj = self.pool.get('product.pricelist.item') item_obj = self.pool.get('product.pricelist.item')
price_type_obj = self.pool.get('product.price.type') price_type_obj = self.pool.get('product.price.type')
product_obj = self.pool.get('product.product') product_obj = self.pool.get('product.product')
@ -114,10 +121,17 @@ class account_invoice_line(osv.osv):
if item_base > 0: if item_base > 0:
field_name = price_type_obj.browse(cr, uid, item_base).field field_name = price_type_obj.browse(cr, uid, item_base).field
product_tmpl_id = product_obj.browse(cr, uid, product_id, context).product_tmpl_id.id product = product_obj.browse(cr, uid, product_id, context)
product_tmpl_id = product.product_tmpl_id.id
product_read = template_obj.read(cr, uid, product_tmpl_id, [field_name], context) product_read = template_obj.read(cr, uid, product_tmpl_id, [field_name], context)
return product_read[field_name]
factor = 1.0
if uom and uom != product.uom_id.id:
product_uom_obj = self.pool.get('product.uom')
uom_data = product_uom_obj.browse(cr, uid, product.uom_id.id)
factor = uom_data.factor
return product_read[field_name] * factor
if product: if product:
pricelist_obj = self.pool.get('product.pricelist') pricelist_obj = self.pool.get('product.pricelist')
@ -133,7 +147,7 @@ class account_invoice_line(osv.osv):
raise osv.except_osv(_('No Purchase Pricelist Found !'),_("You must first define a pricelist for Supplier !")) raise osv.except_osv(_('No Purchase Pricelist Found !'),_("You must first define a pricelist for Supplier !"))
price_unit_res = pricelist_obj.price_get(cr, uid, [pricelist], product.id, qty or 1.0, partner_id, {'uom': uom})[pricelist] price_unit_res = pricelist_obj.price_get(cr, uid, [pricelist], product.id, qty or 1.0, partner_id, {'uom': uom})[pricelist]
price_unit = price_unit_res[pricelist] price_unit = price_unit_res[pricelist]
real_price = get_real_price(price_unit_res, product.id, pricelist) real_price = get_real_price(price_unit_res, product.id, qty, uom, pricelist)
else: else:
if partner_id: if partner_id:
pricelist = partner_obj.browse(cr, uid, partner_id).property_product_pricelist.id pricelist = partner_obj.browse(cr, uid, partner_id).property_product_pricelist.id
@ -142,7 +156,7 @@ class account_invoice_line(osv.osv):
price_unit_res = pricelist_obj.price_get(cr, uid, [pricelist], product.id, qty or 1.0, partner_id, {'uom': uom}) price_unit_res = pricelist_obj.price_get(cr, uid, [pricelist], product.id, qty or 1.0, partner_id, {'uom': uom})
price_unit = price_unit_res[pricelist] price_unit = price_unit_res[pricelist]
real_price = get_real_price(price_unit_res, product.id, pricelist) real_price = get_real_price(price_unit_res, product.id, qty, uom, pricelist)
if pricelist: if pricelist:
pricelists=pricelist_obj.read(cr,uid,[pricelist],['visible_discount']) pricelists=pricelist_obj.read(cr,uid,[pricelist],['visible_discount'])
if(len(pricelists)>0 and pricelists[0]['visible_discount'] and real_price != 0): if(len(pricelists)>0 and pricelists[0]['visible_discount'] and real_price != 0):

View File

@ -86,7 +86,7 @@ class project(osv.osv):
cr.execute('''SELECT cr.execute('''SELECT
project_id, sum(planned_hours), sum(total_hours), sum(effective_hours), SUM(remaining_hours) project_id, sum(planned_hours), sum(total_hours), sum(effective_hours), SUM(remaining_hours)
FROM FROM
project_task project_task
WHERE WHERE
project_id in %s AND project_id in %s AND
state<>'cancelled' state<>'cancelled'
@ -476,7 +476,7 @@ class task(osv.osv):
return True return True
_constraints = [ _constraints = [
(_check_recursion, _('Error ! You cannot create recursive tasks.'), ['parent_ids']) (_check_recursion, 'Error ! You cannot create recursive tasks.', ['parent_ids'])
] ]
# #
# Override view according to the company definition # Override view according to the company definition

View File

@ -4,7 +4,7 @@
<!-- Users --> <!-- Users -->
<record id="base.user_demo" model="res.users"> <record id="base.user_demo" model="res.users">
<field name="groups_id" eval="[(4,ref('group_project_user'))]"/> <field eval="[(4, ref('base.group_sale_salesman')),(4, ref('group_project_user'))]" name="groups_id"/>
</record> </record>
<record id="res_users_analyst" model="res.users"> <record id="res_users_analyst" model="res.users">

View File

@ -131,7 +131,6 @@
</child1> </child1>
<child2> <child2>
<action colspan="4" height="220" name="%(action_purchase_order_monthly_categ_graph)d" string="Monthly Purchase by Category" /> <action colspan="4" height="220" name="%(action_purchase_order_monthly_categ_graph)d" string="Monthly Purchase by Category" />
<action colspan="4" height="220" name="%(action_negotiation_by_supplier)d" string="Negotiation by Supplier" />
<!-- <!--
<action colspan="4" height="220" name="%(purchase.action_purchase_by_supplier)d" string="Purchase by supplier" /> <action colspan="4" height="220" name="%(purchase.action_purchase_by_supplier)d" string="Purchase by supplier" />
<action colspan="4" height="220" name="%(purchase.action_total_price_by_product_by_state)d" string="Total price by product by state" /> <action colspan="4" height="220" name="%(purchase.action_total_price_by_product_by_state)d" string="Total price by product by state" />

View File

@ -646,6 +646,8 @@ class purchase_order_line(osv.osv):
return {'value': {'price_unit': price_unit or 0.0, 'name': name or '', return {'value': {'price_unit': price_unit or 0.0, 'name': name or '',
'notes': notes or'', 'product_uom' : uom or False}, 'domain':{'product_uom':[]}} 'notes': notes or'', 'product_uom' : uom or False}, 'domain':{'product_uom':[]}}
prod= self.pool.get('product.product').browse(cr, uid, product) prod= self.pool.get('product.product').browse(cr, uid, product)
lang=False lang=False
if partner_id: if partner_id:
lang=self.pool.get('res.partner').read(cr, uid, partner_id, ['lang'])['lang'] lang=self.pool.get('res.partner').read(cr, uid, partner_id, ['lang'])['lang']
@ -660,6 +662,9 @@ class purchase_order_line(osv.osv):
date_order = time.strftime('%Y-%m-%d') date_order = time.strftime('%Y-%m-%d')
qty = qty or 1.0 qty = qty or 1.0
seller_delay = 0 seller_delay = 0
prod_name = self.pool.get('product.product').name_get(cr, uid, [prod.id], context=context)[0][1]
for s in prod.seller_ids: for s in prod.seller_ids:
if s.name.id == partner_id: if s.name.id == partner_id:
seller_delay = s.delay seller_delay = s.delay
@ -675,7 +680,6 @@ class purchase_order_line(osv.osv):
'date': date_order, 'date': date_order,
})[pricelist] })[pricelist]
dt = (datetime.now() + relativedelta(days=int(seller_delay) or 0.0)).strftime('%Y-%m-%d %H:%M:%S') dt = (datetime.now() + relativedelta(days=int(seller_delay) or 0.0)).strftime('%Y-%m-%d %H:%M:%S')
prod_name = self.pool.get('product.product').name_get(cr, uid, [prod.id])[0][1]
res = {'value': {'price_unit': price, 'name': name or prod_name, res = {'value': {'price_unit': price, 'name': name or prod_name,

View File

@ -2,20 +2,24 @@
<openerp> <openerp>
<data noupdate="1"> <data noupdate="1">
<record id="base.user_demo" model="res.users">
<field eval="[(4, ref('group_purchase_user'))]" name="groups_id"/>
</record>
<!--Resource: purchase.order--> <!--Resource: purchase.order-->
<record id="order_purchase1" model="purchase.order"> <record id="order_purchase1" model="purchase.order">
<field model="stock.location" name="location_id" search="[]"/> <field name="location_id" ref="stock.stock_location_stock"/>
<field model="product.pricelist" name="pricelist_id" search="[]"/> <field model="product.pricelist" name="pricelist_id" search="[]"/>
<field model="res.partner" name="partner_id" search="[('supplier','=','True')]" /> <field name="partner_id" ref="base.res_partner_asus"/>
<field model="res.partner.address" name="partner_address_id" search="[]"/> <field name="partner_address_id" ref="base.res_partner_address_tang"/>
</record> </record>
<record id="order_purchase2" model="purchase.order"> <record id="order_purchase2" model="purchase.order">
<field model="stock.location" name="location_id" search="[]"/> <field name="location_id" ref="stock.stock_location_stock"/>
<field model="product.pricelist" name="pricelist_id" search="[]"/> <field model="product.pricelist" name="pricelist_id" search="[]"/>
<field model="res.partner" name="partner_id" search="[('supplier','=','True')]" /> <field name="partner_id" ref="base.res_partner_3"/>
<field model="res.partner.address" name="partner_address_id" search="[]"/> <field name="partner_address_id" ref="base.res_partner_address_zen"/>
</record> </record>
<!--Resource: purchase.order.line--> <!--Resource: purchase.order.line-->

View File

@ -7,8 +7,8 @@
"access_stock_warehouse_purchase_user","stock.warehouse","stock.model_stock_warehouse","group_purchase_user",1,0,0,0 "access_stock_warehouse_purchase_user","stock.warehouse","stock.model_stock_warehouse","group_purchase_user",1,0,0,0
"access_stock_picking_purchase_user","stock.picking","stock.model_stock_picking","group_purchase_user",1,1,1,1 "access_stock_picking_purchase_user","stock.picking","stock.model_stock_picking","group_purchase_user",1,1,1,1
"access_stock_move_purchase_user","stock.move","stock.model_stock_move","group_purchase_user",1,1,1,1 "access_stock_move_purchase_user","stock.move","stock.model_stock_move","group_purchase_user",1,1,1,1
"access_purchase_order_stock_worker","purchase.order","model_purchase_order","stock.group_stock_user",1,0,0,0 "access_purchase_order_stock_worker","purchase.order","model_purchase_order","stock.group_stock_user",1,1,1,0
"access_purchase_order_line_stock_worker","purchase.order.line","model_purchase_order_line","stock.group_stock_user",1,0,0,0 "access_purchase_order_line_stock_worker","purchase.order.line","model_purchase_order_line","stock.group_stock_user",1,0,1,0
"access_account_tax_purchase_user","account.tax","account.model_account_tax","group_purchase_user",1,0,0,0 "access_account_tax_purchase_user","account.tax","account.model_account_tax","group_purchase_user",1,0,0,0
"access_report_purchase_order","purchase.report","model_purchase_report","group_purchase_manager",1,1,1,1 "access_report_purchase_order","purchase.report","model_purchase_report","group_purchase_manager",1,1,1,1
"access_report_purchase_order_user","purchase.report user","model_purchase_report","group_purchase_user",1,0,0,0 "access_report_purchase_order_user","purchase.report user","model_purchase_report","group_purchase_user",1,0,0,0
@ -42,3 +42,5 @@
"access_account_move_reconcile","account.move.reconcile","account.model_account_move_reconcile","group_purchase_user",1,1,1,1 "access_account_move_reconcile","account.move.reconcile","account.model_account_move_reconcile","group_purchase_user",1,1,1,1
"access_report_stock_move","report.stock.move.manager","stock.model_report_stock_move","group_purchase_manager",1,1,1,1 "access_report_stock_move","report.stock.move.manager","stock.model_report_stock_move","group_purchase_manager",1,1,1,1
"access_report_stock_move_user","report.stock.move.user","stock.model_report_stock_move","group_purchase_user",1,0,0,0 "access_report_stock_move_user","report.stock.move.user","stock.model_report_stock_move","group_purchase_user",1,0,0,0
"access_stock_production_lot_user","stock.production.lot user","stock.model_stock_production_lot","group_purchase_user",1,0,1,0
"access_stock_production_lot_revision","stock.production.lot.revision","stock.model_stock_production_lot_revision","group_purchase_user",1,0,1,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
7 access_stock_warehouse_purchase_user stock.warehouse stock.model_stock_warehouse group_purchase_user 1 0 0 0
8 access_stock_picking_purchase_user stock.picking stock.model_stock_picking group_purchase_user 1 1 1 1
9 access_stock_move_purchase_user stock.move stock.model_stock_move group_purchase_user 1 1 1 1
10 access_purchase_order_stock_worker purchase.order model_purchase_order stock.group_stock_user 1 0 1 0 1 0
11 access_purchase_order_line_stock_worker purchase.order.line model_purchase_order_line stock.group_stock_user 1 0 0 1 0
12 access_account_tax_purchase_user account.tax account.model_account_tax group_purchase_user 1 0 0 0
13 access_report_purchase_order purchase.report model_purchase_report group_purchase_manager 1 1 1 1
14 access_report_purchase_order_user purchase.report user model_purchase_report group_purchase_user 1 0 0 0
42 access_account_move_reconcile account.move.reconcile account.model_account_move_reconcile group_purchase_user 1 1 1 1
43 access_report_stock_move report.stock.move.manager stock.model_report_stock_move group_purchase_manager 1 1 1 1
44 access_report_stock_move_user report.stock.move.user stock.model_report_stock_move group_purchase_user 1 0 0 0
45 access_stock_production_lot_user stock.production.lot user stock.model_stock_production_lot group_purchase_user 1 0 1 0
46 access_stock_production_lot_revision stock.production.lot.revision stock.model_stock_production_lot_revision group_purchase_user 1 0 1 0

View File

@ -9,7 +9,6 @@
<field name="name">Purchase / User</field> <field name="name">Purchase / User</field>
</record> </record>
<record model="ir.rule" id="purchase_order_comp_rule"> <record model="ir.rule" id="purchase_order_comp_rule">
<field name="name">Purchase Order multi-company</field> <field name="name">Purchase Order multi-company</field>
<field name="model_id" ref="model_purchase_order"/> <field name="model_id" ref="model_purchase_order"/>

View File

@ -37,7 +37,7 @@ class stock_move(osv.osv):
""" """
reference_amount, reference_currency_id = super(stock_move, self)._get_reference_accounting_values_for_valuation(cr, uid, move, context=context) reference_amount, reference_currency_id = super(stock_move, self)._get_reference_accounting_values_for_valuation(cr, uid, move, context=context)
if move.product_id.cost_method != 'average' or not move.price_unit: if move.product_id.cost_method != 'average' or not move.price_unit:
# no average price costing or cost not specified during picking validation, we will # no average price costing or cost not specified during picking validation, we will
# plug the purchase line values if they are found. # plug the purchase line values if they are found.
if move.purchase_line_id and move.picking_id.purchase_id.pricelist_id: if move.purchase_line_id and move.picking_id.purchase_id.pricelist_id:
reference_amount, reference_currency_id = move.purchase_line_id.price_unit, move.picking_id.purchase_id.pricelist_id.currency_id.id reference_amount, reference_currency_id = move.purchase_line_id.price_unit, move.picking_id.purchase_id.pricelist_id.currency_id.id
@ -123,6 +123,8 @@ class stock_partial_picking(osv.osv_memory):
for pick in pick_obj.browse(cr, uid, context.get('active_ids', [])): for pick in pick_obj.browse(cr, uid, context.get('active_ids', [])):
has_product_cost = (pick.type == 'in' and pick.purchase_id) has_product_cost = (pick.type == 'in' and pick.purchase_id)
for m in pick.move_lines: for m in pick.move_lines:
if m.state in ('done','cancel') :
continue
if has_product_cost and m.product_id.cost_method == 'average' and m.purchase_line_id: if has_product_cost and m.product_id.cost_method == 'average' and m.purchase_line_id:
# We use the original PO unit purchase price as the basis for the cost, expressed # We use the original PO unit purchase price as the basis for the cost, expressed
# in the currency of the PO (i.e the PO's pricelist currency) # in the currency of the PO (i.e the PO's pricelist currency)

View File

@ -21,17 +21,16 @@
warranty: 0.0 warranty: 0.0
weight: 0.0 weight: 0.0
weight_net: 0.0 weight_net: 0.0
- -
In order to test the purchase flow,I create a new record where "invoice_method" is From Manual In order to test the purchase flow,I create a new record where "invoice_method" is From Manual
- -
I create purchase order for iPod. I create purchase order for iPod.
- -
!record {model: purchase.order, id: purchase_order_po1}: !record {model: purchase.order, id: purchase_order_po1}:
company_id: base.main_company company_id: base.main_company
date_order: '2010-05-11' date_order: '2010-05-11'
invoice_method: manual invoice_method: manual
location_id: stock.stock_location_stock location_id: stock.stock_location_stock
name: PO00010
order_line: order_line:
- date_planned: '2010-05-13' - date_planned: '2010-05-13'
name: iPod name: iPod
@ -47,16 +46,16 @@
Initially purchase order is in the draft state Initially purchase order is in the draft state
- -
!assert {model: purchase.order, id: purchase_order_po1}: !assert {model: purchase.order, id: purchase_order_po1}:
- state == 'draft' - state == 'draft'
- -
I confirm the purchase order. I confirm the purchase order.
- -
!workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po1} !workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po1}
- -
I check that the order which was initially in the draft state has transit to confirm state. I check that the order which was initially in the draft state has transit to confirm state.
- -
!assert {model: purchase.order, id: purchase_order_po1}: !assert {model: purchase.order, id: purchase_order_po1}:
- state == 'approved' - state == 'approved'
- -
I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line
- -
@ -68,7 +67,7 @@
assert search_ids, _('Purchase order line is not created!') assert search_ids, _('Purchase order line is not created!')
- -
To check that wizard "Create Invoices" gets opened To check that wizard "Create Invoices" gets opened
- -
I create purchase order line invoice entry. I create purchase order line invoice entry.
- -
!record {model: purchase.order.line_invoice, id: purchase_order_line_invoice_0}: !record {model: purchase.order.line_invoice, id: purchase_order_line_invoice_0}:
@ -77,7 +76,7 @@
I create invoice for products in the purchase order. I create invoice for products in the purchase order.
- -
!python {model: purchase.order.line_invoice}: | !python {model: purchase.order.line_invoice}: |
pur_obj=self.pool.get('purchase.order') pur_obj=self.pool.get('purchase.order')
ids = [] ids = []
pur_id1=pur_obj.browse(cr, uid, ref("purchase_order_po1")) pur_id1=pur_obj.browse(cr, uid, ref("purchase_order_po1"))
for line in pur_id1.order_line: for line in pur_id1.order_line:
@ -99,13 +98,13 @@
from tools.translate import _ from tools.translate import _
pur_id1=self.browse(cr, uid, ref("purchase_order_po1")) pur_id1=self.browse(cr, uid, ref("purchase_order_po1"))
account_obj = self.pool.get('account.invoice') account_obj = self.pool.get('account.invoice')
ids = account_obj.search(cr, uid, [('origin', '=', pur_id1.name)]) ids = account_obj.search(cr, uid, [('origin', '=', 'PO-'+str(pur_id1.id))])
assert ids, _('Pending Invoice is not created!') assert ids, _('Pending Invoice is not created!')
- -
I check that the order which was initially in the confirmed state has transit to approved state. I check that the order which was initially in the confirmed state has transit to approved state.
- -
!assert {model: purchase.order, id: purchase_order_po1}: !assert {model: purchase.order, id: purchase_order_po1}:
- state == 'approved' - state == 'approved'
- -
I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved. I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved.
- -

View File

@ -21,17 +21,16 @@
warranty: 0.0 warranty: 0.0
weight: 0.0 weight: 0.0
weight_net: 0.0 weight_net: 0.0
- -
In order to test the purchase flow,I create a new record where "invoice_method" is From Picking In order to test the purchase flow,I create a new record where "invoice_method" is From Picking
- -
I create purchase order for iPod. I create purchase order for iPod.
- -
!record {model: purchase.order, id: purchase_order_po2}: !record {model: purchase.order, id: purchase_order_po2}:
company_id: base.main_company company_id: base.main_company
date_order: '2010-05-11' date_order: '2010-05-11'
invoice_method: picking invoice_method: picking
location_id: stock.stock_location_stock location_id: stock.stock_location_stock
name: PO00008
order_line: order_line:
- date_planned: '2010-05-13' - date_planned: '2010-05-13'
name: iPod name: iPod
@ -47,16 +46,16 @@
Initially purchase order is in the draft state. Initially purchase order is in the draft state.
- -
!assert {model: purchase.order, id: purchase_order_po2}: !assert {model: purchase.order, id: purchase_order_po2}:
- state == 'draft' - state == 'draft'
- -
I confirm the purchase order for iPod. I confirm the purchase order for iPod.
- -
!workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po2} !workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po2}
- -
I check that the order which was initially in the draft state has transit to confirm state. I check that the order which was initially in the draft state has transit to confirm state.
- -
!assert {model: purchase.order, id: purchase_order_po2}: !assert {model: purchase.order, id: purchase_order_po2}:
- state == 'approved' - state == 'approved'
- -
I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line. I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line.
- -
@ -68,7 +67,7 @@
assert search_ids, _('Purchase order line is not created!') assert search_ids, _('Purchase order line is not created!')
- -
To check that wizard "Create Invoices" gets opened. To check that wizard "Create Invoices" gets opened.
- -
I create purchase order line invoice entry. I create purchase order line invoice entry.
- -
!record {model: purchase.order.line_invoice, id: purchase_order_line_invoice_0}: !record {model: purchase.order.line_invoice, id: purchase_order_line_invoice_0}:
@ -77,7 +76,7 @@
I create invoice for products in the purchase order. I create invoice for products in the purchase order.
- -
!python {model: purchase.order.line_invoice}: | !python {model: purchase.order.line_invoice}: |
pur_obj=self.pool.get('purchase.order') pur_obj=self.pool.get('purchase.order')
ids = [] ids = []
pur_id1=pur_obj.browse(cr, uid, ref("purchase_order_po2")) pur_id1=pur_obj.browse(cr, uid, ref("purchase_order_po2"))
for line in pur_id1.order_line: for line in pur_id1.order_line:
@ -99,21 +98,21 @@
from tools.translate import _ from tools.translate import _
pur_id1=self.browse(cr, uid, ref("purchase_order_po2")) pur_id1=self.browse(cr, uid, ref("purchase_order_po2"))
account_obj = self.pool.get('account.invoice') account_obj = self.pool.get('account.invoice')
ids = account_obj.search(cr, uid, [('origin', '=', pur_id1.name)]) ids = account_obj.search(cr, uid, [('origin', '=', 'PO-'+str(pur_id1.id))])
assert ids, _('Pending Invoice is not created!') assert ids, _('Pending Invoice is not created!')
- -
I check that the order which was initially in the confirmed state has transit to approved state. I check that the order which was initially in the confirmed state has transit to approved state.
- -
!assert {model: purchase.order, id: purchase_order_po2}: !assert {model: purchase.order, id: purchase_order_po2}:
- state == 'approved' - state == 'approved'
- -
I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved. I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved.
- -
!python {model: purchase.order}: | !python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po2")) pur_id=self.browse(cr, uid, ref("purchase_order_po2"))
assert(pur_id.date_approve) assert(pur_id.date_approve)
- -
I check that an entry gets created in the stock.picking. I check that an entry gets created in the stock.picking.
- -
!python {model: purchase.order}: | !python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po2")) pur_id=self.browse(cr, uid, ref("purchase_order_po2"))
@ -130,15 +129,15 @@
search_id = move_obj.search(cr, uid, [('picking_id', '=', pick_id.name)]) search_id = move_obj.search(cr, uid, [('picking_id', '=', pick_id.name)])
assert search_id, 'No Incoming Product!' assert search_id, 'No Incoming Product!'
- -
Then I create an invoice from picking by clicking on "Create Invoice" wizard Then I create an invoice from picking by clicking on "Create Invoice" wizard
- -
!python {model: stock.invoice.onshipping}: | !python {model: stock.invoice.onshipping}: |
pur_obj=self.pool.get('purchase.order') pur_obj=self.pool.get('purchase.order')
pur_id1=pur_obj.browse(cr, uid, ref("purchase_order_po2")) pur_id1=pur_obj.browse(cr, uid, ref("purchase_order_po2"))
pick_ids = [x.id for x in pur_id1.picking_ids] pick_ids = [x.id for x in pur_id1.picking_ids]
id = self.create(cr, uid, {'invoice_date': '2010-05-11', 'journal_id': ref('account.expenses_journal')}, id = self.create(cr, uid, {'invoice_date': '2010-05-11', 'journal_id': ref('account.expenses_journal')},
{'active_ids': pick_ids}) {'active_ids': pick_ids})
self.create_invoice(cr, uid, [id], {"active_ids": pick_ids}) self.create_invoice(cr, uid, [id], {"active_ids": pick_ids, "active_id": pick_ids[0]})
- -
I check that an invoice_id field of Delivery&Invoices gets bind with the value. I check that an invoice_id field of Delivery&Invoices gets bind with the value.
- -

View File

@ -398,3 +398,14 @@ msgstr ""
msgid "Purchase Orders" msgid "Purchase Orders"
msgstr "" msgstr ""
#. module: purchase_requisition
#: code:addons/purchase_requisition/wizard/purchase_requisition_partner.py:0
#, python-format
msgid "Error!"
msgstr ""
#. module: purchase_requisition
#: code:addons/purchase_requisition/wizard/purchase_requisition_partner.py:0
#, python-format
msgid "No Product in Tender"
msgstr ""

View File

@ -1,27 +1,30 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<openerp> <openerp>
<data noupdate="1"> <data noupdate="1">
<record id="base.user_demo" model="res.users">
<field eval="[(4, ref('group_purchase_requisition_user'))]" name="groups_id"/>
</record>
<!--Resource: purchase.requisition--> <!--Resource: purchase.requisition-->
<record id="order_purchase_requisition1" model="purchase.requisition"> <record id="order_purchase_requisition1" model="purchase.requisition">
<field name="name">TE0001</field> <field name="name">TE0001</field>
<field name="user_id" model="res.users"/> <field name="user_id" model="res.users"/>
<field name="exclusive">multiple</field> <field name="exclusive">multiple</field>
<field name="date_start">2010/09/16 15:56:14</field> <field name="date_start">2010/09/16 15:56:14</field>
<field name="warehouse_id" model="stock.warehouse"/> <field name="warehouse_id" ref="stock.stock_warehouse_shop0"/>
</record> </record>
<!--Resource: purchase.requisition.line--> <!--Resource: purchase.requisition.line-->
<record id="line_purchase_requisition1" model="purchase.requisition.line"> <record id="line_purchase_requisition1" model="purchase.requisition.line">
<field name="requisition_id" ref="order_purchase_requisition1"/> <field name="requisition_id" ref="order_purchase_requisition1"/>
<field name="product_id" ref="product.product_product_pc3"/> <field name="product_id" ref="product.product_product_pc3"/>
<field name="product_uom_id" model="product.uom" search="[]"/> <field name="product_uom_id" model="product.uom" search="[]"/>
<field name="product_qty">5</field> <field name="product_qty">5</field>
</record> </record>
</data> </data>
</openerp> </openerp>

View File

@ -3,3 +3,5 @@
"access_purchase_requisition_line","purchase.requisition.line","model_purchase_requisition_line","purchase.group_purchase_user",1,1,1,1 "access_purchase_requisition_line","purchase.requisition.line","model_purchase_requisition_line","purchase.group_purchase_user",1,1,1,1
"access_purchase_requisition_manager","purchase.requisition manager","model_purchase_requisition","purchase.group_purchase_manager",1,0,0,0 "access_purchase_requisition_manager","purchase.requisition manager","model_purchase_requisition","purchase.group_purchase_manager",1,0,0,0
"access_purchase_requisition_line_manager","purchase.requisition.line manager","model_purchase_requisition_line","purchase.group_purchase_manager",1,0,0,0 "access_purchase_requisition_line_manager","purchase.requisition.line manager","model_purchase_requisition_line","purchase.group_purchase_manager",1,0,0,0
"access_purchase_requisition","purchase.requisition","model_purchase_requisition","stock.group_stock_manager",1,0,1,0
"access_purchase_requisition_line","purchase.requisition.line","model_purchase_requisition_line","stock.group_stock_manager",1,0,1,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
3 access_purchase_requisition_line purchase.requisition.line model_purchase_requisition_line purchase.group_purchase_user 1 1 1 1
4 access_purchase_requisition_manager purchase.requisition manager model_purchase_requisition purchase.group_purchase_manager 1 0 0 0
5 access_purchase_requisition_line_manager purchase.requisition.line manager model_purchase_requisition_line purchase.group_purchase_manager 1 0 0 0
6 access_purchase_requisition purchase.requisition model_purchase_requisition stock.group_stock_manager 1 0 1 0
7 access_purchase_requisition_line purchase.requisition.line model_purchase_requisition_line stock.group_stock_manager 1 0 1 0

View File

@ -5,6 +5,7 @@
<record id="group_purchase_requisition_manager" model="res.groups"> <record id="group_purchase_requisition_manager" model="res.groups">
<field name="name">Purchase Requisition / Manager</field> <field name="name">Purchase Requisition / Manager</field>
</record> </record>
<record id="group_purchase_requisition_user" model="res.groups"> <record id="group_purchase_requisition_user" model="res.groups">
<field name="name">Purchase Requisition / User</field> <field name="name">Purchase Requisition / User</field>
</record> </record>

View File

@ -24,6 +24,7 @@ from datetime import datetime
from dateutil.relativedelta import relativedelta from dateutil.relativedelta import relativedelta
from osv import fields, osv from osv import fields, osv
from osv.orm import browse_record, browse_null from osv.orm import browse_record, browse_null
from tools.translate import _
class purchase_requisition_partner(osv.osv_memory): class purchase_requisition_partner(osv.osv_memory):
_name = "purchase.requisition.partner" _name = "purchase.requisition.partner"
@ -38,7 +39,7 @@ class purchase_requisition_partner(osv.osv_memory):
record_id = context and context.get('active_id', False) or False record_id = context and context.get('active_id', False) or False
tender = self.pool.get('purchase.requisition').browse(cr, uid, record_id) tender = self.pool.get('purchase.requisition').browse(cr, uid, record_id)
if not tender.line_ids: if not tender.line_ids:
raise osv.except_osv('Error!','No Product in Tender') raise osv.except_osv(_('Error!'), _('No Product in Tender'))
True True
def onchange_partner_id(self, cr, uid, ids, partner_id): def onchange_partner_id(self, cr, uid, ids, partner_id):

View File

@ -1453,7 +1453,7 @@ msgstr ""
#. module: sale #. module: sale
#: view:sale.order:0 #: view:sale.order:0
msgid "Logistic" msgid "Logistics"
msgstr "" msgstr ""
#. module: sale #. module: sale

View File

@ -1460,7 +1460,7 @@ msgstr ""
#. module: sale #. module: sale
#: view:sale.order:0 #: view:sale.order:0
msgid "Logistic" msgid "Logistics"
msgstr "" msgstr ""
#. module: sale #. module: sale
@ -2114,7 +2114,7 @@ msgstr "Фактура базирана на доставки"
#~ msgid "My sales in shipping exception" #~ msgid "My sales in shipping exception"
#~ msgstr "Моите продажби с грешка при доставка" #~ msgstr "Моите продажби с грешка при доставка"
#~ msgid "Configure Sale Order Logistic" #~ msgid "Configure Sale Order Logistics"
#~ msgstr "Конфигуриране на реда на доставка при продажба" #~ msgstr "Конфигуриране на реда на доставка при продажба"
#~ msgid "Sales Configuration" #~ msgid "Sales Configuration"

View File

@ -1457,7 +1457,7 @@ msgstr ""
#. module: sale #. module: sale
#: view:sale.order:0 #: view:sale.order:0
msgid "Logistic" msgid "Logistics"
msgstr "" msgstr ""
#. module: sale #. module: sale
@ -2215,7 +2215,7 @@ msgstr "Račun sa referencom na isporuku"
#~ "Ovaj korak pri konfiguraciji se koristi da bi se definisalo podrazumjevanje " #~ "Ovaj korak pri konfiguraciji se koristi da bi se definisalo podrazumjevanje "
#~ "opcija izbora u toku kreiranja naloga za prodaju" #~ "opcija izbora u toku kreiranja naloga za prodaju"
#~ msgid "Configure Sale Order Logistic" #~ msgid "Configure Sale Order Logistics"
#~ msgstr "Konfigurisanje logistike prodajnog naloga" #~ msgstr "Konfigurisanje logistike prodajnog naloga"
#~ msgid "Sales Configuration" #~ msgid "Sales Configuration"

Some files were not shown because too many files have changed in this diff Show More