[MERGE]: merging from the same branch

bzr revid: mga@tinyerp.com-20100623195017-o7nsrjir65y8rf8r
This commit is contained in:
Mantavya Gajjar
2010-06-24 01:20:17 +05:30
29 changed files with 327 additions and 619 deletions
+2 -4
View File
@@ -1144,6 +1144,7 @@ class account_move(osv.osv):
return amount
def _centralise(self, cr, uid, move, mode, context=None):
assert(mode in ('debit', 'credit'), 'Invalid Mode') #to prevent sql injection
if context is None:
context = {}
@@ -1191,10 +1192,7 @@ class account_move(osv.osv):
else:
line_id2 = 0
cr.execute('SELECT SUM(%s) '\
'FROM account_move_line '\
'WHERE move_id=%s AND id<>%s',
(mode, move.id, line_id2))
cr.execute('SELECT SUM(%s) FROM account_move_line WHERE move_id=%%s AND id!=%%s' % (mode,), (move.id, line_id2))
result = cr.fetchone()[0] or 0.0
cr.execute('update account_move_line set '+mode2+'=%s where id=%s', (result, line_id))
return True
+1
View File
@@ -309,6 +309,7 @@
<separator string="Other Configuration" colspan="4"/>
<field name="centralisation" groups="base.group_extended"/>
<field name="entry_posted"/>
<field name="update_posted"/>
<group colspan="2" col="2">
<separator string="Invoicing Data" colspan="4"/>
<field name="invoice_sequence_id"/>
@@ -68,8 +68,10 @@ class account_fiscalyear_close(osv.osv_memory):
fy_id = data[0]['fy_id']
period_ids = obj_acc_period.search(cr, uid, [('fiscalyear_id', '=', fy_id)])
periods_fy2 = obj_acc_period.search(cr, uid, [('fiscalyear_id', '=', data[0]['fy2_id'])])
cr.execute("SELECT id FROM account_period WHERE date_stop < (SELECT date_start FROM account_fiscalyear WHERE id = %s)" , (str(data[0]['fy2_id']),))
fy_period_set = ','.join(map(lambda id: str(id[0]), cr.fetchall()))
cr.execute("SELECT id FROM account_period WHERE date_start > (SELECT date_stop FROM account_fiscalyear WHERE id = %s)" , (str(fy_id),))
fy2_period_set = ','.join(map(lambda id: str(id[0]), cr.fetchall()))
period = obj_acc_period.browse(cr, uid, data[0]['period_id'], context=context)
new_fyear = obj_acc_fiscalyear.browse(cr, uid, data[0]['fy2_id'], context=context)
@@ -90,8 +92,7 @@ class account_fiscalyear_close(osv.osv_memory):
if move_ids:
raise osv.except_osv(_('UserError'),
_('The opening journal must not have any entry in the new fiscal year !'))
query = "SELECT id FROM account_fiscalyear WHERE date_stop < '" + str(new_fyear.date_start) + "'"
cr.execute(query)
cr.execute("SELECT id FROM account_fiscalyear WHERE date_stop < %s", (str(new_fyear.date_start),))
result = cr.dictfetchall()
fy_ids = ','.join([str(x['id']) for x in result])
query_line = obj_acc_move_line._query_get(cr, uid,
@@ -151,19 +152,17 @@ class account_fiscalyear_close(osv.osv_memory):
offset = 0
limit = 100
while True:
#TODO: this query could be improved in order to work if there is more than 2 open FY
# a.period_id IN ('+fy2_period_set+') is the problematic clause
cr.execute('SELECT b.id, b.name, b.quantity, b.debit, b.credit, b.account_id, b.ref, ' \
cr.execute('SELECT DISTINCT b.id, b.name, b.quantity, b.debit, b.credit, b.account_id, b.ref, ' \
'b.amount_currency, b.currency_id, b.blocked, b.partner_id, ' \
'b.date_maturity, b.date_created ' \
'FROM account_move_line a, account_move_line b ' \
'WHERE b.account_id = %s ' \
'AND b.reconcile_id is NOT NULL ' \
'AND a.reconcile_id = b.reconcile_id ' \
'AND b.period_id IN %s'\
'AND a.period_id IN %s' \
'AND b.period_id IN ('+fy_period_set+') ' \
'AND a.period_id IN ('+fy2_period_set+') ' \
'ORDER BY id ' \
'LIMIT %s OFFSET %s', (account.id,tuple(period_ids),tuple(periods_fy2),limit, offset))
'LIMIT %s OFFSET %s', (account.id, limit, offset))
result = cr.dictfetchall()
if not result:
break
+6 -2
View File
@@ -24,8 +24,12 @@
'name': 'Customer & Supplier Relationship Management',
'version': '1.0',
'category': 'Generic Modules/CRM & SRM',
'description': """claim""",
'author': 'Tiny',
'description': """
This modules allows you to track your customers/suppliers claims and flames.
It is fully integrated with the email gateway so that you can create
automatically new claims based on incoming emails.
""",
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'depends': ['crm'],
'init_xml': [
+20 -18
View File
@@ -395,9 +395,9 @@ class marketing_campaign_workitem(osv.osv):
'object': wi.activity_id,
'transition': wi.activity_id.to_ids
}
expr = eval(str(wi.activity_id.condition), eval_context)
if expr:
try:
try:
expr = eval(str(wi.activity_id.condition), eval_context)
if expr:
result = True
if wi.campaign_id.mode in ('manual','active'):
result = self.pool.get('marketing.campaign.activity').process(
@@ -410,11 +410,10 @@ class marketing_campaign_workitem(osv.osv):
if type(result) == type({}) and 'error_msg' in result:
vals['error_msg'] = result['error_msg']
self.write(cr, uid, wi.id, vals)
except Exception,e:
self.write(cr, uid, wi.id, {'state': 'exception', 'error_msg': str(e)})
else :
self.write(cr, uid, wi.id, {'state': 'cancelled'})
else:
self.write(cr, uid, wi.id, {'state': 'cancelled'})
except Exception,e:
self.write(cr, uid, wi.id, {'state': 'exception', 'error_msg': str(e)})
return True
def process_all(self, cr, uid, camp_ids=None, context={}):
@@ -422,16 +421,19 @@ class marketing_campaign_workitem(osv.osv):
if not camp_ids:
camp_ids = camp_obj.search(cr, uid, [('state','=','running')], context=context)
for camp in camp_obj.browse(cr, uid, camp_ids, context=context):
if camp.mode in ('test_realtime','active'):
workitem_ids = self.search(cr, uid, [('state', '=', 'todo'),
('date','<=', time.strftime('%Y-%m-%d %H:%M:%S'))])
elif camp.mode == 'test':
workitem_ids = self.search(cr, uid, [('state', '=', 'todo')])
else:
# manual states are not processed automatically
workitem_ids = []
if workitem_ids:
self.process(cr, uid, workitem_ids, context)
while True:
if camp.mode in ('test_realtime','active'):
workitem_ids = self.search(cr, uid, [('state', '=', 'todo'),
('date','<=', time.strftime('%Y-%m-%d %H:%M:%S'))])
elif camp.mode == 'test':
workitem_ids = self.search(cr, uid, [('state', '=', 'todo')])
else:
# manual states are not processed automatically
workitem_ids = []
if workitem_ids:
self.process(cr, uid, workitem_ids, context)
else:
break
def preview(self, cr, uid, ids, context):
res = {}
@@ -26,13 +26,13 @@ class campaign_analysis(osv.osv): #{{{
_description = "Campaign Analysis"
_auto = False
_rec_name = 'date'
def _total_cost(self, cr, uid, ids, field_name, arg, context={}):
""" @param cr: the current row, from the database cursor,
"""
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param ids: List of case and section Data’s IDs
@param context: A standard dictionary for contextual values """
@param context: A standard dictionary for contextual values
"""
result = {}
for ca_obj in self.browse(cr, uid, ids, context):
wi_ids = self.pool.get('marketing.campaign.workitem').search(cr, uid,
@@ -41,7 +41,6 @@ class campaign_analysis(osv.osv): #{{{
(ca_obj.campaign_id.fixed_cost / len(wi_ids))
result[ca_obj.id] = total_cost
return result
_columns = {
'year': fields.char('Year', size=4, readonly=True),
'month':fields.selection([('01','January'), ('02','February'),
@@ -61,36 +60,33 @@ class campaign_analysis(osv.osv): #{{{
type='many2one', relation='res.country',string='Country'),
'total_cost' : fields.function(_total_cost, string='Cost', method=True,
type="float" ),
'revenue': fields.float('Revenue',readonly=True),
# 'case_id': fields.many2one('crm.lead', 'Opportunity', readonly=True),
# 'count' : fields.integer('Count', readonly=True),
'revenue': fields.float('Revenue',digits=(16,2),readonly=True),
'count' : fields.integer('# of Actions', readonly=True),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'campaign_analysis')
cr.execute("""
create or replace view campaign_analysis as (
select
wi.id as id,
to_char(wi.date, 'YYYY') as year,
to_char(wi.date, 'MM') as month,
wi.date as date,
s.campaign_id as campaign_id,
wi.activity_id as activity_id,
wi.segment_id as segment_id,
wi.partner_id as partner_id ,
act.revenue as revenue
from
marketing_campaign_workitem wi
left join res_partner p on (p.id=wi.partner_id)
left join marketing_campaign_segment s on (s.id=wi.segment_id)
left join marketing_campaign_activity act on (act.id= wi.activity_id)
group by
to_char(wi.date, 'YYYY'),to_char(wi.date, 'MM'),
s.campaign_id,wi.activity_id,wi.segment_id,wi.partner_id,revenue,
wi.date,wi.id
)
""")
create or replace view campaign_analysis as (
select
min(wi.id) as id,
to_char(wi.date::date, 'YYYY') as year,
to_char(wi.date::date, 'MM') as month,
wi.date::date as date,
s.campaign_id as campaign_id,
wi.activity_id as activity_id,
wi.segment_id as segment_id,
wi.partner_id as partner_id ,
wi.state as state,
sum(act.revenue) as revenue,
count(*) as count
from
marketing_campaign_workitem wi
left join res_partner p on (p.id=wi.partner_id)
left join marketing_campaign_segment s on (s.id=wi.segment_id)
left join marketing_campaign_activity act on (act.id= wi.activity_id)
group by
s.campaign_id,wi.activity_id,wi.segment_id,wi.partner_id,wi.state,
wi.date::date
)
""")
campaign_analysis() #}}}
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<openerp>
<data>
<record id="view_campaign_analysis_tree" model="ir.ui.view">
<data>
<record id="view_campaign_analysis_tree" model="ir.ui.view">
<field name="name">campaign.analysis.tree</field>
<field name="model">campaign.analysis</field>
<field name="type">tree</field>
@@ -15,42 +15,52 @@
<field name="segment_id" invisible="1"/>
<field name="partner_id" invisible="1"/>
<field name="country_id" invisible="1"/>
<!--field name="case_id"/-->
<!--field name="count"/-->
<field name="count"/>
<field name="total_cost" string="Cost"/><!-- sum="Cost"/-->
<field name="revenue"/>
</tree>
</field>
</record>
<record id="view_campaign_analysis_search" model="ir.ui.view">
<record id="view_campaign_analysis_search" model="ir.ui.view">
<field name="name">campaign.analysis.search</field>
<field name="model">campaign.analysis</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Marketing Reports">
<group>
<filter icon="terp-go-year"
string="This Year"
domain="[('year','=',time.strftime('%%Y'))]"/>
<filter icon="terp-go-month"
string="This Month"
domain="[('month','=',time.strftime('%%m'))]"/>
<separator orientation="vertical"/>
<filter icon="terp-go-month"
string="Date"
domain="[('date','=',time.strftime('%%Y/%%m/%%d'))]"/>
<separator orientation="vertical"/>
<field name="campaign_id"/>
<field name="activity_id"/>
<field name="segment_id"/>
<field name="partner_id"/>
<field name="country_id"/>
<group>
<filter icon="terp-go-year"
string="This Year"
domain="[('year','=',time.strftime('%%Y'))]"/>
<filter icon="terp-go-month"
string="This Month"
domain="[('month','=',time.strftime('%%m'))]"/>
<filter icon="terp-go-month"
string="Today"
domain="[('date','=',time.strftime('%%Y/%%m/%%d'))]"/>
<separator orientation="vertical"/>
<filter icon="terp-gtk-go-back-rtl"
string="To Do"
domain="[('state','=','todo')]"/>
<filter icon="terp-camera_test"
string="Done"
domain="[('state','=','done')]"/>
<filter icon="terp-emblem-important"
string="Exceptions"
domain="[('state','=','exception')]"/>
<separator orientation="vertical"/>
<field name="campaign_id"/>
<field name="activity_id"/>
<field name="segment_id"/>
<field name="partner_id"/>
<field name="country_id"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="10" col="12">
<filter string="Campaign" name="Campaign" icon="terp-gtk-jump-to-rtl" context="{'group_by':'campaign_id'}" />
<filter string="Segment" name ="Segment" icon="terp-stock_symbol-selection" context="{'group_by':'segment_id'}" />
<filter string="State" icon="terp-stock_symbol-selection" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id'}"/>
<separator orientation="vertical"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
@@ -60,17 +70,17 @@
</field>
</record>
<record id="action_campaign_analysis_all" model="ir.actions.act_window">
<record id="action_campaign_analysis_all" model="ir.actions.act_window">
<field name="name">Campaigns</field>
<field name="res_model">campaign.analysis</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
<field name="context">{'group_by': [], 'search_default_Campaign': 1, 'search_default_Segment': 1}</field>
<field name="context">{'group_by': [], 'search_default_Campaign': 1, 'search_default_Segment': 1, 'group_by_no_leaf':1}</field>
<field name="search_view_id" ref="view_campaign_analysis_search"/>
</record>
<menuitem name="Reporting" id="menu_marketing_reporting" parent="marketing.marketing_menu"/>
<menuitem name="Reporting" id="menu_marketing_reporting" parent="marketing.marketing_menu"/>
<menuitem action="action_campaign_analysis_all" id="menu_action_campaign_analysis_all" parent="menu_marketing_reporting" sequence="40"/>
</data>
</data>
</openerp>
+10 -5
View File
@@ -543,16 +543,21 @@ class mrp_production(osv.osv):
return {'value': {'location_dest_id': src}}
return {}
def product_id_change(self, cr, uid, ids, product):
def product_id_change(self, cr, uid, ids, product, context=None):
""" Finds UoM of changed product.
@param product: Id of changed product.
@return: Dictionary of values.
"""
if not product:
return {}
res = self.pool.get('product.product').read(cr, uid, [product], ['uom_id'])[0]
uom = res['uom_id'] and res['uom_id'][0]
result = {'product_uom': uom}
return {'value': {
'product_uom': False,
'bom_id': False
}}
res = self.pool.get('product.product').browse(cr, uid, product, context=context)
result = {
'product_uom': res.uom_id and res.uom_id.id or False,
'bom_id': res.bom_ids and res.bom_ids[0].id or False
}
return {'value': result}
def bom_id_change(self, cr, uid, ids, product):
+1 -1
View File
@@ -99,7 +99,7 @@
<group colspan="2" col="2" name="status">
<separator string="Status" colspan="2"/>
<field name="categ_id" select="1" groups="base.group_extended"/>
<field name="categ_id" select="1"/>
<field name="state"/>
<field groups="base.group_extended" name="product_manager"/>
</group>
-2
View File
@@ -19,7 +19,5 @@
##############################################################################
import product_expiry
import wizard
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -20,7 +20,7 @@
{
"name" : "Products date of expiry",
"version" : "1.0",
"author" : "Tiny",
"author" : "OpenERP SA",
"category" : "Enterprise Specific Modules/Food Industries",
"depends" : ["base", "account", "product", "stock"],
"init_xml" : [],
@@ -31,7 +31,7 @@
- removal date
- alert date
Used, for example, in food industries.''',
"update_xml" : ["product_expiry_view.xml", "report/report_stock_view.xml", "wizard/stock_partial_view.xml"],
"update_xml" : ["product_expiry_view.xml"],
"active": False,
"installable": True
}
+19 -2
View File
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-06-30 15:09+0000\n"
"PO-Revision-Date: 2010-06-21 15:56+0000\n"
"PO-Revision-Date: 2010-01-10 22:56+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Catalan <ca@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-06-22 04:20+0000\n"
"X-Launchpad-Export-Date: 2010-04-24 04:01+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: product_expiry
@@ -161,3 +161,20 @@ msgstr ""
#: field:product.product,alert_time:0
msgid "Product alert time"
msgstr "Data alerta producte"
#~ msgid "Alert date"
#~ msgstr "Data alarma"
#~ msgid ""
#~ "Track different dates on products and lots. Used, for exampel, in food "
#~ "industries: expiry date, alert date, date of removal, eso."
#~ msgstr ""
#~ "Gestiona diferents dates per a productes i lots. Utilitzat, per exemple, en "
#~ "la indústria alimentària: Data de caducitat, data d'alarma, data "
#~ "d'eliminació, ..."
#~ msgid "DLUO"
#~ msgstr "Data caducitat"
#~ msgid "Removal date"
#~ msgstr "Data eliminació"
+20 -3
View File
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-06-30 15:09+0000\n"
"PO-Revision-Date: 2010-06-21 15:56+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"PO-Revision-Date: 2010-04-29 04:43+0000\n"
"Last-Translator: Rhubeni Lopes de Andrade <rhube.itsasecret@gmail.com>\n"
"Language-Team: Spanish <es@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-06-22 04:20+0000\n"
"X-Launchpad-Export-Date: 2010-04-30 03:57+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: product_expiry
@@ -161,3 +161,20 @@ msgstr ""
#: field:product.product,alert_time:0
msgid "Product alert time"
msgstr "Fecha alerta producto"
#~ msgid "Alert date"
#~ msgstr "Fecha alarma"
#~ msgid ""
#~ "Track different dates on products and lots. Used, for exampel, in food "
#~ "industries: expiry date, alert date, date of removal, eso."
#~ msgstr ""
#~ "Gestiona distintas fechas para productos y lotes. Utilizado, por ejemplo, en "
#~ "industria alimentaria: Fecha de caducidad, fecha de alarma, fecha de "
#~ "eliminación, ..."
#~ msgid "DLUO"
#~ msgstr "Fecha caducidad"
#~ msgid "Removal date"
#~ msgstr "Fecha eliminación"
+9 -10
View File
@@ -1,20 +1,19 @@
# French translation for openobject-addons
# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * product_expiry
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"Project-Id-Version: OpenERP Server 5.0.1\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-06-30 15:09+0000\n"
"PO-Revision-Date: 2010-06-21 15:56+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: French <fr@li.org>\n"
"PO-Revision-Date: 2010-01-04 18:19+0000\n"
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-06-22 04:20+0000\n"
"X-Launchpad-Export-Date: 2010-04-24 04:01+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: product_expiry
+21 -20
View File
@@ -21,21 +21,10 @@
import datetime
from osv import fields, osv
import pooler
import time
class stock_production_lot(osv.osv):
_name = 'stock.production.lot'
_inherit = 'stock.production.lot'
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
return []
result = []
for line in self.browse(cr, uid, ids, context):
if line.life_date:
result.append((line.id, (line.name or '')+' ('+line.life_date+')'))
else:
result.append((line.id, line.name))
return result
def _get_date(dtype):
"""Return a function to compute the limit date for this type"""
@@ -52,24 +41,36 @@ class stock_production_lot(osv.osv):
# set date to False when no expiry time specified on the product
date = duration and (datetime.datetime.today()
+ datetime.timedelta(days=duration))
return date and date.strftime('%Y-%m-%d')
return date and date.strftime('%Y-%m-%d %H:%M:%S')
return calc_date
_columns = {
'life_date': fields.date('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.'),
'use_date': fields.date('Best before Date',
'use_date': fields.datetime('Best before Date',
help='The date the lot starts deteriorating without becoming dangerous.'),
'removal_date': fields.date('Removal Date',
'removal_date': fields.datetime('Removal Date',
help='The date the lot should be removed.'),
'alert_date': fields.date('Alert Date'),
'alert_date': fields.datetime('Alert Date'),
}
# Assign dates according to products data
def create(self, cr, uid, vals, context=None):
newid = super(stock_production_lot, self).create(cr, uid, vals, context=context)
obj = self.browse(cr, uid, newid, context=context)
towrite = []
for f in ('life_date','use_date','removal_date','alert_date'):
if not getattr(obj, f):
towrite.append(f)
context = context or {}
context['product_id'] = obj.product_id.id
self.write(cr, uid, [obj.id], self.default_get(cr, uid, towrite, context=context))
return newid
_defaults = {
# 'life_date': _get_date('life_time'),
# 'use_date': _get_date('use_time'),
# 'removal_date': _get_date('removal_time'),
# 'alert_date': _get_date('alert_time'),
'life_date': _get_date('life_time'),
'use_date': _get_date('use_time'),
'removal_date': _get_date('removal_time'),
'alert_date': _get_date('alert_time'),
}
stock_production_lot()
-25
View File
@@ -1,25 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import report_stock
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -1,121 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import osv, fields
from tools.translate import _
import tools
from tools.sql import drop_view_if_exists
class stock_report_prodlots(osv.osv):
_name = "stock.report.prodlots1"
_description = "Stock report by production lots"
_auto = False
_columns = {
'name': fields.float('Quantity', readonly=True),
'location_id': fields.many2one('stock.location', 'Location', readonly=True, select=True),
'product_id': fields.many2one('product.product', 'Product', readonly=True, select=True),
'prodlot_id': fields.many2one('stock.production.lot', 'Production lot', readonly=True, select=True),
'life_date': fields.date('End of Life Date',
help='The date the lot may become dangerous and should not be consumed.'),
'use_date': fields.date('Best before Date',
help='The date the lot starts deteriorating without becoming dangerous.'),
'removal_date': fields.date('Removal Date',
help='The date the lot should be removed.'),
'alert_date': fields.date('Alert Date'),
}
def init(self, cr):
drop_view_if_exists(cr, 'stock_report_prodlots1')
cr.execute("""
create or replace view stock_report_prodlots1 as (
select max(id) as id,
location_id,
product_id,
prodlot_id,
life_date,
use_date,
removal_date,
alert_date,
sum(qty) as name
from (
select -max(sm.id) as id,
sm.location_id,
sm.product_id,
sm.prodlot_id,
spl.life_date,
spl.use_date,
spl.removal_date,
spl.alert_date,
-sum(sm.product_qty /uo.factor) as qty
from stock_move as sm
left join stock_location sl
on (sl.id = sm.location_id)
left join stock_production_lot spl
on (sm.prodlot_id=spl.id)
left join product_uom uo
on (uo.id=sm.product_uom)
where state = 'done'
group by sm.location_id, sm.product_id, sm.product_uom, sm.prodlot_id,
spl.life_date,
spl.use_date,
spl.removal_date,
spl.alert_date
union all
select max(sm.id) as id,
sm.location_dest_id as location_id,
sm.product_id,
sm.prodlot_id,
spl.life_date,
spl.use_date,
spl.removal_date,
spl.alert_date,
sum(sm.product_qty /uo.factor) as qty
from stock_move as sm
left join stock_location sl
on (sl.id = sm.location_dest_id)
left join stock_production_lot spl
on (sm.prodlot_id=spl.id)
left join product_uom uo
on (uo.id=sm.product_uom)
where sm.state = 'done'
group by sm.location_dest_id, sm.product_id, sm.product_uom, sm.prodlot_id,
spl.life_date,
spl.use_date,
spl.removal_date,
spl.alert_date
) as report
group by location_id, product_id, prodlot_id,
life_date,
use_date,
removal_date,
alert_date
)""")
def unlink(self, cr, uid, ids, context={}):
raise osv.except_osv(_('Error !'), _('You cannot delete any record!'))
stock_report_prodlots()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -1,103 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_stock_report_prodlots_filter" model="ir.ui.view">
<field name="name">stock.report.prodlots.filter</field>
<field name="model">stock.report.prodlots1</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Location">
<group col="10" colspan="4">
<filter icon="terp-go-home" name="internal_locations" string="Internal Locations" domain="[('location_id.usage', '=', 'internal')]" help="Internal Locations"/>
<filter icon="terp-go-home" string="Customer Locations" domain="[('location_id.usage', '=', 'customer')]" help="Customer Locations" />
<filter icon="terp-go-home" string="Supplier Locations" domain="[('location_id.usage', '=', 'supplier')]" help="Supplier Locations" />
<separator orientation="vertical"/>
<field name="location_id"/>
<field name="product_id"/>
<newline/>
<field name="use_date" />
<field name="life_date" string="End of Life" />
<field name="alert_date" />
<field name="removal_date" string="Removal D." />
</group>
<newline/>
<group expand="1" string="Group By..." colspan="4" col="10">
<filter string="Location" icon="terp-go-home" domain="[]" context="{'group_by':'location_id'}"/>
<filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
</group>
</search>
</field>
</record>
<record id="stock_report_prodlots_form" model="ir.ui.view">
<field name="name">stock.report.prodlots.view</field>
<field name="model">stock.report.prodlots1</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Stock by Lots">
<field name="location_id"/>
<field name="product_id"/>
<field name="prodlot_id" groups="base.group_extended"/>
<field name="name"/>
<field name="use_date" />
<field name="life_date" string="End of Life" />
<field name="alert_date" />
<field name="removal_date" string="Removal D." />
</form>
</field>
</record>
<record id="stock_report_prodlots_tree" model="ir.ui.view">
<field name="name">stock.report.prodlots.view</field>
<field name="model">stock.report.prodlots1</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Stock by Lots">
<field name="location_id"/>
<field name="product_id"/>
<field name="prodlot_id" groups="base.group_extended"/>
<field name="name"/>
<field name="use_date" />
<field name="life_date" string="End of Life" />
<field name="alert_date" />
<field name="removal_date" string="Removal D." />
</tree>
</field>
</record>
<record id="stock_report_prodlots_graph" model="ir.ui.view">
<field name="name">stock.report.prodlots.view</field>
<field name="model">stock.report.prodlots1</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Stock by Lots" type="bar">
<field name="product_id"/>
<field name="name"/>
</graph>
</field>
</record>
<record id="stock.action_stock_report_prodlots_form" model="ir.actions.act_window">
<field name="name">Inventory by Location</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.report.prodlots1</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'full':'1','search_default_internal_locations':1}</field>
<field name="search_view_id" ref="view_stock_report_prodlots_filter" />
</record>
<act_window
domain="[('product_id','=',active_id)]"
id="stock.act_product_product_2_stock_report_prodlots"
name="Stock by Lots"
res_model="stock.report.prodlots1"
src_model="product.product"
groups="base.group_extended"/>
</data>
</openerp>
-1
View File
@@ -1 +0,0 @@
import stock_partial
@@ -1,70 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
from service import web_services
from tools.misc import UpdateableStr, UpdateableDict
from tools.translate import _
import netsvc
import pooler
import time
import datetime, time
import wizard
class stock_production_lot(osv.osv):
_inherit = "stock.production.lot"
def create(self, cr, uid, vals, context={}):
new_id = super(stock_production_lot, self).create(cr, uid, vals, context=context)
prodlot_obj = self.pool.get('stock.production.lot')
prod = prodlot_obj.browse(cr, uid, new_id, context=context)
res = {}
current_date = time.strftime('%Y-%m-%d %H:%M:%S')
if not prod.life_date:
date_life = (datetime.datetime.strptime(current_date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=prod.product_id.life_time))
res['life_date'] = date_life.strftime('%Y-%m-%d')
if not prod.use_date:
date_use = (datetime.datetime.strptime(current_date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=prod.product_id.use_time))
res['use_date'] = date_use.strftime('%Y-%m-%d')
if not prod.removal_date:
date_removal = (datetime.datetime.strptime(current_date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=prod.product_id.removal_time))
res['removal_date'] = date_removal.strftime('%Y-%m-%d')
if not prod.alert_date:
date_alert = (datetime.datetime.strptime(current_date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=prod.product_id.alert_time))
res['alert_date'] = date_alert.strftime('%Y-%m-%d')
prodlot_obj.write(cr, uid, [prod.id], res)
return new_id
stock_production_lot()
class stock_move_split_lines_exist(osv.osv_memory):
_inherit = "stock.move.split.lines"
_columns = {
'date': fields.date('Expiry Date'),
}
# TODO: use this date instead of default one
def on_change_product(self, cr, uid, ids, product_id):
if not product_id:
return {'value':{'date': False}}
day_life = self.pool.get('product.product').browse(cr, uid, product_id).life_time
date_life = (datetime.datetime.now() + datetime.timedelta(days=day_life))
return {'value':
{'date': date_life.strftime('%Y-%m-%d')}
}
stock_move_split_lines_exist()
@@ -1,22 +0,0 @@
<?xml version="1.0"?>
<openerp>
<data>
<record id="view_split_in_lots" model="ir.ui.view">
<field name="name">Split in lots</field>
<field name="model">stock.move.split</field>
<field name="type">form</field>
<field name="inherit_id" ref="stock.view_split_in_lots"/>
<field name="arch" type="xml">
<data>
<xpath expr="//form/group/field[@name='line_ids']/tree/field[@name='name']" position="replace">
<field name="name" on_change="on_change_product(parent.product_id)"/>
</xpath>
<xpath expr="//form/group/field[@name='line_ids']/tree/field[@name='quantity']" position="after">
<field name="date"/>
</xpath>
</data>
</field>
</record>
</data>
</openerp>
+2 -2
View File
@@ -20,8 +20,8 @@
{
"name" : "Products Attributes & Manufacturers",
"version" : "1.0",
"author" : "Tiny",
"category" : "Enterprise Specific Modules/Industries",
"author" : "OpenERP SA",
"category" : "Enterprise Specific Modules/Manufacturer Industries",
"depends" : ["base", "account", "product", "stock"],
"init_xml" : [],
"demo_xml" : [],
+25 -25
View File
@@ -1,6 +1,6 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * product_electronic
# * product_manufacturer
#
msgid ""
msgstr ""
@@ -15,88 +15,88 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: product_electronic
#: model:ir.module.module,description:product_electronic.module_meta_information
#. module: product_manufacturer
#: model:ir.module.module,description:product_manufacturer.module_meta_information
msgid "A module that add manufacturers and attributes on the product form"
msgstr ""
#. module: product_electronic
#. module: product_manufacturer
#: field:product.product,manufacturer_pref:0
msgid "Manufacturer product code"
msgstr ""
#. module: product_electronic
#. module: product_manufacturer
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: product_electronic
#: view:product.electronic.attribute:0
#. module: product_manufacturer
#: view:product.manufacturer.attribute:0
msgid "Product Template Name"
msgstr ""
#. module: product_electronic
#. module: product_manufacturer
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: product_electronic
#: model:ir.model,name:product_electronic.model_product_electronic_attribute
#. module: product_manufacturer
#: model:ir.model,name:product_manufacturer.model_product_electronic_attribute
msgid "Product attributes"
msgstr ""
#. module: product_electronic
#. module: product_manufacturer
#: view:product.product:0
msgid "Manufacturing data"
msgstr ""
#. module: product_electronic
#. module: product_manufacturer
#: view:product.product:0
msgid "Product reference"
msgstr ""
#. module: product_electronic
#: field:product.electronic.attribute,name:0
#. module: product_manufacturer
#: field:product.manufacturer.attribute,name:0
msgid "Attribute"
msgstr ""
#. module: product_electronic
#: field:product.electronic.attribute,product_id:0
#. module: product_manufacturer
#: field:product.manufacturer.attribute,product_id:0
msgid "Product"
msgstr ""
#. module: product_electronic
#: field:product.electronic.attribute,value:0
#. module: product_manufacturer
#: field:product.manufacturer.attribute,value:0
msgid "Value"
msgstr ""
#. module: product_electronic
#. module: product_manufacturer
#: view:product.product:0
msgid "Manufacturing Data"
msgstr ""
#. module: product_electronic
#. module: product_manufacturer
#: view:product.product:0
msgid "Product name"
msgstr ""
#. module: product_electronic
#. module: product_manufacturer
#: view:product.product:0
#: field:product.product,attribute_ids:0
msgid "Attributes"
msgstr ""
#. module: product_electronic
#: model:ir.module.module,shortdesc:product_electronic.module_meta_information
#. module: product_manufacturer
#: model:ir.module.module,shortdesc:product_manufacturer.module_meta_information
msgid "Products Attributes & Manufacturers"
msgstr ""
#. module: product_electronic
#. module: product_manufacturer
#: field:product.product,manufacturer_pname:0
msgid "Manufacturer product name"
msgstr ""
#. module: product_electronic
#. module: product_manufacturer
#: field:product.product,manufacturer:0
msgid "Manufacturer"
msgstr ""
@@ -1,6 +1,6 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * product_electronic
# * product_manufacturer
#
msgid ""
msgstr ""
@@ -15,88 +15,88 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: product_electronic
#: model:ir.module.module,description:product_electronic.module_meta_information
#. module: product_manufacturer
#: model:ir.module.module,description:product_manufacturer.module_meta_information
msgid "A module that add manufacturers and attributes on the product form"
msgstr ""
#. module: product_electronic
#. module: product_manufacturer
#: field:product.product,manufacturer_pref:0
msgid "Manufacturer product code"
msgstr ""
#. module: product_electronic
#. module: product_manufacturer
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: product_electronic
#: view:product.electronic.attribute:0
#. module: product_manufacturer
#: view:product.manufacturer.attribute:0
msgid "Product Template Name"
msgstr ""
#. module: product_electronic
#. module: product_manufacturer
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: product_electronic
#: model:ir.model,name:product_electronic.model_product_electronic_attribute
#. module: product_manufacturer
#: model:ir.model,name:product_manufacturer.model_product_electronic_attribute
msgid "Product attributes"
msgstr ""
#. module: product_electronic
#. module: product_manufacturer
#: view:product.product:0
msgid "Manufacturing data"
msgstr ""
#. module: product_electronic
#. module: product_manufacturer
#: view:product.product:0
msgid "Product reference"
msgstr ""
#. module: product_electronic
#: field:product.electronic.attribute,name:0
#. module: product_manufacturer
#: field:product.manufacturer.attribute,name:0
msgid "Attribute"
msgstr ""
#. module: product_electronic
#: field:product.electronic.attribute,product_id:0
#. module: product_manufacturer
#: field:product.manufacturer.attribute,product_id:0
msgid "Product"
msgstr ""
#. module: product_electronic
#: field:product.electronic.attribute,value:0
#. module: product_manufacturer
#: field:product.manufacturer.attribute,value:0
msgid "Value"
msgstr ""
#. module: product_electronic
#. module: product_manufacturer
#: view:product.product:0
msgid "Manufacturing Data"
msgstr ""
#. module: product_electronic
#. module: product_manufacturer
#: view:product.product:0
msgid "Product name"
msgstr ""
#. module: product_electronic
#. module: product_manufacturer
#: view:product.product:0
#: field:product.product,attribute_ids:0
msgid "Attributes"
msgstr ""
#. module: product_electronic
#: model:ir.module.module,shortdesc:product_electronic.module_meta_information
#. module: product_manufacturer
#: model:ir.module.module,shortdesc:product_manufacturer.module_meta_information
msgid "Products Attributes & Manufacturers"
msgstr ""
#. module: product_electronic
#. module: product_manufacturer
#: field:product.product,manufacturer_pname:0
msgid "Manufacturer product name"
msgstr ""
#. module: product_electronic
#. module: product_manufacturer
#: field:product.product,manufacturer:0
msgid "Manufacturer"
msgstr ""
@@ -24,26 +24,13 @@ class product_product(osv.osv):
_inherit = 'product.product'
_name = 'product.product'
_columns = {
'manufacturer' : fields.many2one('res.partner', 'Manufacturer'),
'manufacturer_pname' : fields.char('Manufacturer Product Name', size=64),
'manufacturer_pref' : fields.char('Manufacturer Product Code', size=64),
'attribute_ids': fields.one2many('product.manufacturer.attribute', 'product_id', 'Attributes'),
'manufacturer_ids': fields.one2many('res.partner.manufacturer', 'product_id', 'Manufacturers'),
}
product_product()
class res_partner_manufacturer(osv.osv):
_name = 'res.partner.manufacturer'
_rec_name = 'manufacturer_id'
_columns = {
'manufacturer_id' : fields.many2one('res.partner', 'Manufacturer'),
'country_id' : fields.many2one('res.country', 'Country'),
'authorized' : fields.boolean('Authorized'),
'product_id': fields.many2one('product.product', 'Product', ondelete='cascade'),
}
_defaults = {
'authorized': lambda *a: True,
}
res_partner_manufacturer()
class product_attribute(osv.osv):
_name = "product.manufacturer.attribute"
_description = "Product attributes"
@@ -1,72 +1,56 @@
<?xml version="1.0" ?>
<openerp>
<data>
<data>
<record model="ir.ui.view" id="view_product_form_expiry">
<field name="name">product.normal.form</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view" />
<field name="type">form</field>
<field name="arch" type="xml">
<notebook position="inside">
<page string="Manufacturing Data">
<separator string="Manufacturing data" colspan="4" />
<field name="manufacturer_ids" colspan="4" nolabel="1" widget="one2many_list"/>
<record model="ir.ui.view" id="view_product_form_expiry">
<field name="name">product.normal.form</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view" />
<field name="type">form</field>
<field name="arch" type="xml">
<notebook position="inside">
<page string="Manufacturer">
<separator string="Manufacturer" colspan="4" />
<field name="manufacturer" />
<newline/>
<field name="manufacturer_pname"/>
<field name="manufacturer_pref"/>
<separator string="Attributes" colspan="4"/>
<field name="attribute_ids" colspan="4" nolabel="1" widget="one2many_list" />
</page>
</notebook>
</field>
</record>
<separator string="Attributes" colspan="4"/>
<field name="attribute_ids" colspan="4" nolabel="1">
<tree string="Product Attributes" editable="bottom">
<field name="name"/>
<field name="value"/>
</tree>
</field>
</page>
</notebook>
</field>
</record>
<record model="ir.ui.view" id="product_manufacturer_attribute_tree_view">
<field name="name">product.manufacturer.attribute.tree</field>
<field name="model">product.manufacturer.attribute</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Product Template Name">
<field name="name"/>
<field name="value"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="product_manufacturer_attribute_form_view">
<field name="name">product.manufacturer.attribute.form</field>
<field name="model">product.manufacturer.attribute</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Product Template Name">
<field name="name" select="1"/>
<field name="value" select="1"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="product_manufacturer_attribute_tree_view">
<field name="name">product.manufacturer.attribute.tree</field>
<field name="model">product.manufacturer.attribute</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Product Attributes" editable="bottom">
<field name="name"/>
<field name="value"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="product_manufacturer_attribute_form_view">
<field name="name">product.manufacturer.attribute.form</field>
<field name="model">product.manufacturer.attribute</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Product Template Name">
<field name="name"/>
<field name="value"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="product_manufacturer_manufact_tree_view">
<field name="name">res.partner.manufacturer.tree</field>
<field name="model">res.partner.manufacturer</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Manufacturers" editable="top">
<field name="manufacturer_id"/>
<field name="country_id"/>
<field name="authorized"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="product_manufacturer_manufa_form_view">
<field name="name">res.partner.manufacturer.form</field>
<field name="model">res.partner.manufacturer</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Manufacturers">
<field name="manufacturer_id" colspan="4"/>
<field name="country_id"/>
<field name="authorized"/>
</form>
</field>
</record>
</data>
</data>
</openerp>
@@ -1,5 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_product_manufacturer_attribute","product.manufacturer.attribute","model_product_manufacturer_attribute",,1,0,0,0
"access_product_manufacturer_attribute","product.manufacturer.attribute","model_product_manufacturer_attribute",base.group_user,1,0,0,0
"access_product_manufacturer_attribute_manager","product.manufacturer.attribute","model_product_manufacturer_attribute","product.group_product_manager",1,1,1,1
"access_partner_manufacturer","res.partner.manufacturer","model_res_partner_manufacturer",,1,0,0,0
"access_partner_manufacturer_manager","res.partner.manufacturer","model_res_partner_manufacturer","product.group_product_manager",1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_product_manufacturer_attribute product.manufacturer.attribute model_product_manufacturer_attribute base.group_user 1 0 0 0
3 access_product_manufacturer_attribute_manager product.manufacturer.attribute model_product_manufacturer_attribute product.group_product_manager 1 1 1 1
access_partner_manufacturer res.partner.manufacturer model_res_partner_manufacturer 1 0 0 0
access_partner_manufacturer_manager res.partner.manufacturer model_res_partner_manufacturer product.group_product_manager 1 1 1 1
+1 -1
View File
@@ -30,7 +30,7 @@
<form string="Sales Manager board">
<hpaned position="100">
<child1>
<action name="%(sale.action_quotatio_for_sale)d" string="Quotation For Sale"/>
<action name="%(sale.action_quotation_for_sale)d" string="Quotation For Sale"/>
<action width="510" name="%(sale.action_view_product_category_total_price_graph)d" string="Total Price By Product Category"/>
</child1>
<child2>
+37 -3
View File
@@ -171,6 +171,18 @@
<field name="domain">[('state','in',('manual','progress')),('date','&lt;=', time.strftime('%Y-%m-%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=90)).strftime('%Y-%m-%d'))]</field>
<field name="view_id" ref="view_sales_by_partner_graph"/>
</record>
<record id="open_view_sales_by_partner_graph" model="ir.actions.act_window.view">
<field eval="1" name="sequence"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="view_sales_by_partner_graph"/>
<field name="act_window_id" ref="action_sales_by_partner"/>
</record>
<record id="open_view_sales_by_partner_tree" model="ir.actions.act_window.view">
<field eval="2" name="sequence"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_sales_by_partner_tree"/>
<field name="act_window_id" ref="action_sales_by_partner"/>
</record>
<record id="view_sales_by_salesman_tree" model="ir.ui.view">
<field name="name">sales.by.salesman.tree</field>
@@ -204,7 +216,18 @@
<field name="domain">[('state','in',('manual','progress')),('date','&lt;=', time.strftime('%Y-%m-%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=90)).strftime('%Y-%m-%d'))]</field>
<field name="view_id" ref="view_sales_by_salesman_graph"/>
</record>
<record id="open_view_sales_by_salesman_graph" model="ir.actions.act_window.view">
<field eval="7" name="sequence"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="view_sales_by_salesman_graph"/>
<field name="act_window_id" ref="action_sales_by_salesman"/>
</record>
<record id="open_view_sales_by_salesman_tree" model="ir.actions.act_window.view">
<field eval="9" name="sequence"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_sales_by_salesman_tree"/>
<field name="act_window_id" ref="action_sales_by_salesman"/>
</record>
<record id="view_sales_product_total_price_tree" model="ir.ui.view">
<field name="name">sold.product.total.price.tree</field>
<field name="model">sale.report</field>
@@ -237,7 +260,18 @@
<field name="domain">[('state','in',('manual','progress')),('date','&lt;=', time.strftime('%Y-%m-%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=90)).strftime('%Y-%m-%d'))]</field>
<field name="view_id" ref="view_sales_product_total_price_graph"/>
</record>
<record id="open_view_sales_product_total_price_graph" model="ir.actions.act_window.view">
<field eval="3" name="sequence"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="view_sales_product_total_price_graph"/>
<field name="act_window_id" ref="action_sales_product_total_price_graph"/>
</record>
<record id="open_view_sales_product_total_price_tree" model="ir.actions.act_window.view">
<field eval="4" name="sequence"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_sales_product_total_price_tree"/>
<field name="act_window_id" ref="action_sales_product_total_price_graph"/>
</record>
<record id="view_product_category_total_price_tree" model="ir.ui.view">
<field name="name">sales.category.product.price.tree</field>
@@ -259,7 +293,7 @@
<field name="view_id" ref="view_product_category_total_price_tree"/>
</record>
<record id="action_quotatio_for_sale" model="ir.actions.act_window">
<record id="action_quotation_for_sale" model="ir.actions.act_window">
<field name="name">Quotation For Sale</field>
<field name="res_model">sale.order</field>
<field name="view_type">form</field>