bzr revid: vir@tinyerp.com-20100806043513-ct3a1prtx6eaacc5
This commit is contained in:
Vir (Open ERP)
2010-08-06 10:05:13 +05:30
44 changed files with 1089 additions and 655 deletions
+478 -138
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -942,6 +942,9 @@ class account_invoice(osv.osv):
number = self.pool.get('ir.sequence').get_id(cr, uid, sid, 'id', {'fiscalyear_id': obj_inv.period_id.fiscalyear_id.id})
else:
number = self.pool.get('ir.sequence').get(cr, uid, 'account.invoice.' + invtype)
if not number:
raise osv.except_osv(_('Warning !'), _('There is no active invoice sequence defined for the journal !'))
if invtype in ('in_invoice', 'in_refund'):
ref = reference
+35 -33
View File
@@ -72,14 +72,14 @@ class auction_dates(osv.osv):
_columns = {
'name': fields.char('Auction Name', size=64, required=True),
'expo1': fields.date('First Exposition Day', required=True),
'expo2': fields.date('Last Exposition Day', required=True),
'auction1': fields.date('First Auction Day', required=True),
'auction2': fields.date('Last Auction Day', required=True),
'journal_id': fields.many2one('account.journal', 'Buyer Journal', required=True),
'journal_seller_id': fields.many2one('account.journal', 'Seller Journal', required=True),
'buyer_costs': fields.many2many('account.tax', 'auction_buyer_taxes_rel', 'auction_id', 'tax_id', 'Buyer Costs'),
'seller_costs': fields.many2many('account.tax', 'auction_seller_taxes_rel', 'auction_id', 'tax_id', 'Seller Costs'),
'expo1': fields.date('First Exposition Day', required=True, help="Beginning Exposition Date For Auction"),
'expo2': fields.date('Last Exposition Day', required=True, help="Last Exposition Date For Auction"),
'auction1': fields.date('First Auction Day', required=True, help="Start Date Of Auction"),
'auction2': fields.date('Last Auction Day', required=True, help="End Date Of Auction"),
'journal_id': fields.many2one('account.journal', 'Buyer Journal', required=True, help="Account Journal For Buyer"),
'journal_seller_id': fields.many2one('account.journal', 'Seller Journal', required=True, help="Account Journal For Seller"),
'buyer_costs': fields.many2many('account.tax', 'auction_buyer_taxes_rel', 'auction_id', 'tax_id', 'Buyer Costs', help="Account Tax For Buyer"),
'seller_costs': fields.many2many('account.tax', 'auction_seller_taxes_rel', 'auction_id', 'tax_id', 'Seller Costs', help="Account Tax For Seller"),
'acc_income': fields.many2one('account.account', 'Income Account', required=True),
'acc_expense': fields.many2one('account.account', 'Expense Account', required=True),
'adj_total': fields.function(_adjudication_get, method=True, string='Total Adjudication', store=True),
@@ -289,6 +289,7 @@ class auction_lots(osv.osv):
elif name == "gross_revenue":
if lot.auction_id:
result = lot.buyer_price - lot.seller_price
elif name == "net_revenue":
if lot.auction_id:
result = lot.buyer_price - lot.seller_price - lot.costs
@@ -343,39 +344,40 @@ class auction_lots(osv.osv):
_columns = {
'bid_lines':fields.one2many('auction.bid_line', 'lot_id', 'Bids'),
'auction_id': fields.many2one('auction.dates', 'Auction Date', select=1),
'bord_vnd_id': fields.many2one('auction.deposit', 'Depositer Inventory', required=True),
'name': fields.char('Short Description', size=64, required=True),
'auction_id': fields.many2one('auction.dates', 'Auctions', select=1, help="Auction For Objects"),
'bord_vnd_id': fields.many2one('auction.deposit', 'Depositer Inventory', required=True, help="Auction Deposit For Deposit Inventory"),
'name': fields.char('Title', size=64, required=True, help='Auction Objects Name'),
'name2': fields.char('Short Description (2)', size=64),
'lot_type': fields.selection(_type_get, 'Object category', size=64),
'author_right': fields.many2one('account.tax', 'Author rights'),
'lot_est1': fields.float('Minimum Estimation'),
'lot_est2': fields.float('Maximum Estimation'),
'lot_num': fields.integer('List Number', required=True, select=1),
'author_right': fields.many2one('account.tax', 'Author rights', help="Account Tax For Author Commission"),
'lot_est1': fields.float('Minimum Estimation', help="Minimum Estimate Price Of Objects"),
'lot_est2': fields.float('Maximum Estimation', help="Maximum Estimate Price Of Objects"),
'lot_num': fields.integer('List Number', required=True, select=1, help="List Number For selected Object in Deposit"),
'create_uid': fields.many2one('res.users', 'Created by', readonly=True),
'history_ids':fields.one2many('auction.lot.history', 'lot_id', 'Auction history'),
'lot_local':fields.char('Location', size=64),
'lot_local':fields.char('Location', size=64, help="Auction Location"),
'artist_id':fields.many2one('auction.artists', 'Artist/Author'),
'artist2_id':fields.many2one('auction.artists', 'Artist/Author 2'),
'artist2_id':fields.many2one('auction.artists', 'Artist/Author2'),
'important':fields.boolean('To be Emphatized'),
'product_id':fields.many2one('product.product', 'Product', required=True),
'obj_desc': fields.text('Object Description'),
'obj_num': fields.integer('Catalog Number'),
'obj_ret': fields.float('Price retired'),
'obj_ret': fields.float('Price retired', help="Objects Ret"),
'obj_comm': fields.boolean('Commission'),
'obj_price': fields.float('Adjudication price'),
'obj_price': fields.float('Adjudication price', help="Objects Price"),
'ach_avance': fields.float('Buyer Advance'),
'ach_login': fields.char('Buyer Username', size=64),
'ach_uid': fields.many2one('res.partner', 'Buyer'),
'ach_emp': fields.boolean('Taken Away', readonly=True),
'is_ok': fields.boolean('Buyer\'s payment'),
'ach_uid': fields.many2one('res.partner', 'Buyer'),
'seller_id': fields.related('bord_vnd_id','partner_id', type='many2one', relation='res.partner', string='Seller', readonly=True, help="Seller who is related to depositor Inventory"),
'ach_emp': fields.boolean('Taken Away', readonly=True, help="When This Field is True means, Objects is taken away by Buyer"),
'is_ok': fields.boolean('Buyer\'s payment', help="When Buyer Pay For Account Bank statement', This field is selected as True.", readonly=True),
'ach_inv_id': fields.many2one('account.invoice', 'Buyer Invoice', readonly=True, states={'draft':[('readonly', False)]}),
'sel_inv_id': fields.many2one('account.invoice', 'Seller Invoice', readonly=True, states={'draft':[('readonly', False)]}),
'vnd_lim': fields.float('Seller limit'),
'vnd_lim_net': fields.boolean('Net limit ?', readonly=True),
'image': fields.binary('Image'),
'paid_vnd':fields.function(_getprice, string='Seller Paid', method=True, type='boolean', store=True, multi="paid_vnd"),
'paid_ach':fields.function(_getprice, string='Buyer invoice reconciled', method=True, type='boolean', store=True, multi="paid_ach"),
'image': fields.binary('Image', help="Object Image"),
'paid_vnd':fields.function(_getprice, string='Seller Paid', method=True, type='boolean', store=True, multi="paid_vnd", help="When state of Seller Invoice is 'Paid', This field is selected as True."),
'paid_ach':fields.function(_getprice, string='Buyer Invoice Reconciled', method=True, type='boolean', store=True, multi="paid_ach", help="When state of Buyer Invoice is 'Paid', This field is selected as True."),
'state': fields.selection((
('draft', 'Draft'),
('unsold', 'Unsold'),
@@ -386,14 +388,14 @@ class auction_lots(osv.osv):
\n* The \'Unsold\' state is used when object does not sold for long time, user can also set it as draft state after unsold. \
\n* The \'Paid\' state is used when user pay for the object \
\n* The \'Sold\' state is used when user buy the object.'),
'buyer_price': fields.function(_getprice, method=True, string='Buyer price', store=True, multi="buyer_price"),
'seller_price': fields.function(_getprice, method=True, string='Seller price', store=True, multi="seller_price"),
'gross_revenue':fields.function(_getprice, method=True, string='Gross revenue', store=True, multi="gross_revenue"),
'gross_margin':fields.function(_getprice, method=True, string='Gross Margin (%)', store=True, multi="gross_margin"),
'costs':fields.function(_getprice, method=True, string='Indirect costs', store=True, multi="costs"),
'statement_id': fields.many2many('account.bank.statement.line', 'auction_statement_line_rel', 'auction_id', 'statement', 'Payment'),
'net_revenue':fields.function(_getprice, method=True, string='Net revenue', store=True, multi="net_revenue"),
'net_margin':fields.function(_getprice, method=True, string='Net Margin (%)', store=True, multi="net_margin"),
'buyer_price': fields.function(_getprice, method=True, string='Buyer price', store=True, multi="buyer_price", help="Objects Price which Buyer Given For Objects"),
'seller_price': fields.function(_getprice, method=True, string='Seller price', store=True, multi="seller_price", help="Seller Price"),
'gross_revenue':fields.function(_getprice, method=True, string='Gross revenue', store=True, multi="gross_revenue", help="Revenue Minus Cost Of Objects Sold."),
'gross_margin':fields.function(_getprice, method=True, string='Gross Margin (%)', store=True, multi="gross_margin", help="Gross Income Divided by Net Sales"),
'costs':fields.function(_getprice, method=True, string='Indirect costs', store=True, multi="costs", help="Total credit of analytic account"),
'statement_id': fields.many2many('account.bank.statement.line', 'auction_statement_line_rel', 'auction_id', 'statement', 'Payment', help="Account Bank statement Line For Given Buyer"),
'net_revenue':fields.function(_getprice, method=True, string='Net revenue', store=True, multi="net_revenue", help="Total Revenue Minus Returns"),
'net_margin':fields.function(_getprice, method=True, string='Net Margin (%)', store=True, multi="net_margin", help="The ratio of net profits to revenues"),
}
_defaults = {
'state':lambda *a: 'draft',
+129 -101
View File
@@ -55,6 +55,7 @@
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_auction_object_categories_form">
<field name="name">auction.lot.category.form</field>
<field name="model">auction.lot.category</field>
@@ -91,7 +92,6 @@
<field name="auction2" string="End of auction"/>
<field name="name" string="Names"/>
<field name="state"/>
<button string="Create Invoices" help="Create Invoices" name="close" states="draft" type="object" icon="gtk-yes"/>
</tree>
</field>
</record>
@@ -111,7 +111,7 @@
<separator string="Auction Dates" colspan="4"/>
<field name="auction1" select="1"/>
<field name="auction2" select="1"/>
<label string="" colspan="4"/>
<separator string="" colspan="4"/>
<field name="state"/>
<button name="close" states="draft" string="Create Invoices" type="object" colspan="2" icon="gtk-yes"/>
</page>
@@ -183,7 +183,7 @@
<field name="priority" eval="2"/>
<field name="arch" type="xml">
<calendar string="Next Auction"
date_start="auction1" color="name">
date_start="auction1" color="">
<field name="name" />
<field name="auction1"/>
</calendar>
@@ -191,7 +191,7 @@
</record>
<record model="ir.actions.act_window" id="action_auction_dates_next">
<field name="name">Next Auctions Dates</field>
<field name="name">Auctions</field>
<field name="res_model">auction.dates</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar</field>
@@ -206,9 +206,8 @@
id="act_auction_lot_line_open"/>
<menuitem name="Auction Dates" parent="auction_menu_root" id="auction_date_menu" sequence="1"/>
<menuitem name="Next Auction Dates" parent="auction_date_menu" id="menu_auction_dates_next1" action="action_auction_dates_next"/>
<menuitem name="Auctions" parent="auction_menu_root" id="auction_date_menu" sequence="1"/>
<menuitem name="Auctions" parent="auction_date_menu" id="menu_auction_dates_next1" action="action_auction_dates_next"/>
<record model="ir.ui.view" id="view_auction_lot_tree">
@@ -221,16 +220,11 @@
<field name="obj_num" string="Ref" select="1"/>
<field name="name" select="1"/>
<field name="ach_uid"/>
<field name="ach_login"/>
<field name="obj_price" sum="Total Adj."/>
<field name="state" select="1"/>
<field name="obj_comm"/>
<field name="bord_vnd_id"/>
<field name="lot_num"/>
<field name="lot_est1"/>
<field name="lot_est2"/>
<field name="lot_type" select="1"/>
<field name="auction_id"/>
<field name="state" select="1"/>
<button name="button_bought" string="Sold" states="draft" type="object" icon="gtk-jump-to"/>
<button name="button_not_bought" string="Not sold" states="draft" type="object" icon="gtk-undo"/>
<button name="button_taken_away" string="Taken away" states="sold" type="object" icon="gtk-goto-last"/>
@@ -246,100 +240,91 @@
<field name="priority" eval="8"/>
<field name="arch" type="xml">
<form string="Objects">
<group colspan="4" col="4">
<group colspan="2" col="4">
<field colspan="2" name="name"/>
<field name="obj_num" select="1"/>
<field name="lot_type"/>
<field name="auction_id" select="1"/>
<field name="artist_id"/>
<field name="artist2_id"/>
<field name="lot_est1"/>
<field name="lot_est2"/>
<field name="product_id"/>
<field name="lot_local"/>
<field name="bord_vnd_id" select="1"/>
<field name="lot_num"/>
<newline/>
</group>
<group colspan="2" col="1">
<field name="image" widget='image' nolabel="1"/>
</group>
</group>
<group colspan="4" col="8">
<field name="name" colspan="4"/>
<field name="obj_num"/>
<newline/>
<field name="auction_id"/>
<field name="lot_type"/>
<field name="lot_local"/>
</group>
<notebook colspan="4">
<page string="Buyer">
<separator string="Buyer information" colspan="4"/>
<page string="Catalog">
<separator string="Inventory" colspan="2"/>
<group colspan="4" col="6">
<field name="ach_uid" />
<field name="ach_login" select="1" />
<field name="author_right" domain="[('domain','=','sabam'),('parent_id','=',False),('type_tax_use','&lt;&gt;','sale')]"/>
<field name="obj_price"/>
<field name="obj_ret"/>
<field name="obj_comm"/>
<field name="buyer_price"/>
<field name="seller_price"/>
<field name="ach_emp"/>
<field name="gross_revenue"/>
<field name="net_revenue"/>
<field name="gross_margin"/>
<field name="net_margin"/>
<field name="costs"/>
<newline/>
<field name="ach_inv_id"/>
<field name="paid_ach"/>
<field name="is_ok"/>
</group>
<field name="statement_id" domain="[('state','=','draft')]" colspan="4" nolabel="1"
widget="one2many_list">
<tree string="Payment's history">
<field name="statement_id"/>
<field name="amount"/>
<field name="date"/>
</tree>
<form string="Bank Statement">
<field name="name"/>
<field name="sequence"/>
<field name="date"/>
<field name="partner_id"/>
<field name="account_id"/>
<field name="type"/>
<field name="statement_id"/>
<field name="reconcile_id"/>
<field name="amount"/>
<field name="reconcile_amount"/>
</form>
</field>
<field name="state" colspan="1"/>
<group col="8" colspan="2">
<button name="button_bought" string="Sold" states="draft" type="object" icon="gtk-jump-to"/>
<button name="button_not_bought" string="Not sold" states="draft" type="object" icon="gtk-undo"/>
<button name="button_taken_away" string="Taken away" states="sold" type="object" icon="gtk-goto-last"/>
<button name="button_unpaid" string="Set to draft" states="sold,unsold,paid" type="object" icon="gtk-convert"/>
</group>
<group colspan="2" col="4">
<field name="product_id" colspan="4"/>
<field name="lot_num" select="1" />
<field name="bord_vnd_id"/>
</group>
<group colspan="2" col="1">
<field name="image" widget='image' nolabel="1"/>
</group>
</group>
<group colspan="4" col="6">
<group colspan="2" col="1">
<separator string="Authors" colspan="2"/>
<field name="artist_id"/>
<field name="artist2_id"/>
<field name="author_right" domain="[('domain','=','sabam'),('parent_id','=',False),('type_tax_use','&lt;&gt;','sale')]"/>
</group>
<group colspan="2" col="1">
<separator string="Price" colspan="4"/>
<field name="lot_est1"/>
<field name="lot_est2"/>
<field name="obj_price"/>
<field name="seller_price"/>
<field name="buyer_price"/>
<field name="obj_comm"/>
</group>
<group colspan="2" col="1">
<separator string="Statistical" colspan="4"/>
<field name="gross_revenue"/>
<field name="net_revenue"/>
<field name="gross_margin"/>
<field name="net_margin"/>
<field name="costs"/>
</group>
</group>
<group colspan="4" col="4">
<group colspan="2" col="4">
<separator string="Buyer Information" colspan="4"/>
<field name="ach_uid"/>
<field name="is_ok"/>
<field name="ach_login" />
<field name="paid_ach"/>
<field name="ach_inv_id"/>
<field name="ach_emp"/>
</group>
<group colspan="2" col="4">
<separator string="Seller Information" colspan="4"/>
<field name="seller_id"/>
<newline/>
<field name="vnd_lim"/>
<field name="vnd_lim_net"/>
<field name="sel_inv_id"/>
<field name="paid_vnd"/>
</group>
</group>
<group colspan="4" col="4">
<separator string="" colspan="4"/>
<field name="state" colspan="1"/>
<group col="8" colspan="2">
<button name="button_bought" string="Sold" states="draft" type="object" icon="gtk-jump-to"/>
<button name="button_not_bought" string="Not sold" states="draft" type="object" icon="gtk-undo"/>
<button name="button_taken_away" string="Taken away" states="sold" type="object" icon="gtk-goto-last"/>
<button name="button_unpaid" string="Set to draft" states="sold,unsold,paid" type="object" icon="gtk-convert"/>
</group>
</group>
</page>
<page string="Seller">
<separator string="Seller information" colspan="4"/>
<field name="vnd_lim"/>
<field name="vnd_lim_net"/>
<field name="sel_inv_id"/>
<field name="paid_vnd"/>
<field name="history_ids" colspan="4" readonly="1" nolabel="1">
<tree string="History">
<field name="name"/>
<field name="lot_id"/>
<field name="auction_id"/>
<field name="price"/>
</tree>
</field>
</page>
<page string="Bids">
<field name="bid_lines" colspan="4" nolabel="1" editable="top">
<tree string="Bids" editable="top">
<page string="Bids">
<field name="bid_lines" colspan="4" nolabel="1" editable="top">
<tree string="Bids Details" editable="top">
<field name="bid_id"/>
<field name="price"/>
<field name="call"/>
</tree>
<form string="Bids" >
<form string="Bids Details" >
<field name="bid_id"/>
<field name="lot_id" domain="[('auction_id','=',parent['auction_id'])]" on_change="onchange_name(lot_id)"/>
<field name="price"/>
@@ -350,6 +335,41 @@
<page string="Note">
<field name="obj_desc" colspan="4" nolabel="1"/>
</page>
<page string="History" groups="base.group_extended">
<group colspan="2" col="2">
<field name="statement_id" domain="[('state','=','draft')]" colspan="4" nolabel="1"
widget="one2many_list">
<tree string="Buyer's Payment History">
<field name="statement_id"/>
<field name="amount"/>
<field name="date"/>
</tree>
<form string="Buyer's Payment History">
<field name="name"/>
<field name="sequence"/>
<field name="date"/>
<field name="partner_id"/>
<field name="account_id"/>
<field name="type"/>
<field name="statement_id"/>
<field name="reconcile_id"/>
<field name="amount"/>
<field name="reconcile_amount"/>
</form>
</field>
</group>
<group colspan="2" col="2">
<field name="history_ids" colspan="4" readonly="1" nolabel="1">
<tree string="History">
<field name="name"/>
<field name="lot_id"/>
<field name="auction_id"/>
<field name="price"/>
</tree>
</field>
</group>
</page>
</notebook>
</form>
</field>
@@ -421,6 +441,14 @@
<field name="search_view_id" ref="view_auction_lots_filter"/>
<field name="context">{"search_default_draft": "1"}</field>
</record>
<!-- Action for Bids -->
<act_window name="Open Bids"
domain="[('lot_id', '=', active_id)]"
res_model="auction.bid_line"
src_model="auction.lots"
id="act_auction_lot_open_bid"/>
<menuitem name="Objects" parent="auction_menu_root" id="auction_objects_menu" sequence="2"/>
<menuitem name="Objects" action="action_all_objects" parent="auction_objects_menu" id="auction_all_objects_menu"/>
@@ -684,7 +712,7 @@
<menuitem name="Reporting" id="auction_report_menu" parent="auction_menu_root" sequence="6"/>
<act_window name="Bordereau de dépôt"
<act_window name="Deposit slip"
domain="[('partner_id', '=', active_id)]"
res_model="auction.deposit"
src_model="res.partner"
@@ -7,16 +7,15 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Change Auction Date">
<label string="Warning, this will erase the object adjudication price and its buyer!" colspan="4"/>
<newline/>
<separator string="" colspan="4"/>
<field name="auction_id"/>
<separator string="" colspan="4" />
<label string ="Warning, This will Erase The Object Adjudication Price and Its Buyer!" colspan="4"/>
<separator string="" colspan="4"/>
<field name="auction_id"/>
<separator string="" colspan="4"/>
<group colspan="4" col="4">
<label string=" " colspan="2"/>
<button icon="gtk-close" special="cancel" string="Close"/>
<button icon="gtk-redo" string="Move to Auction date" name="auction_move_set" type="object"/>
</group>
<label string=" " colspan="2"/>
<button icon="gtk-close" special="cancel" string="Close"/>
<button icon="gtk-redo" string="Move to Auction date" name="auction_move_set" type="object"/>
</group>
</form>
</field>
</record>
@@ -31,7 +31,7 @@ class auction_lots_make_invoice(osv.osv_memory):
_description = "Make invoice"
_columns = {
'amount': fields.float('Invoiced Amount', required =True, readonly=True),
'amount': fields.float('Invoiced Amount', required =True, readonly=True, help="Seller Price"),
'objects':fields.integer('# of objects', required =True, readonly=True),
'number':fields.char('Invoice Number', size=64),
}
@@ -25,14 +25,12 @@ class auction_lots_make_invoice_buyer(osv.osv_memory):
_name = "auction.lots.make.invoice.buyer"
_description = __doc__
_columns= {
'amount': fields.float('Invoiced Amount', required =True, readonly=True),
'amount': fields.float('Invoiced Amount', required =True, readonly=True, help="Buyer Price"),
'objects':fields.integer('# of objects', required =True, readonly=True),
'number':fields.char('Invoice Number', size=64),
'buyer_id':fields.many2one('res.partner', 'Buyer', required=True),
}
_defaults={
'number': lambda *a: False,
}
@@ -6,16 +6,18 @@
<field name="model">auction.lots.make.invoice.buyer</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Paid">
<form string="Buyer Invoice">
<group colspan="4" >
<separator string="Create Invoices For Buyer" colspan="4"/>
<field name="amount"/>
<field name="objects"/>
<field name="number"/>
<label string="(Keep empty for automatic number)" colspan="2"/>
<field name="buyer_id"/>
</group>
<separator string="" colspan="4" />
<separator string="" colspan="4" />
<group colspan="4" col="6">
<label string=" " colspan="2"/>
<button icon="gtk-close" special="cancel" string="Close"/>
<button icon="gtk-yes" string="Create invoices" name="makeInvoices" type="object"/>
</group>
@@ -6,13 +6,15 @@
<field name="model">auction.lots.make.invoice</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Paid">
<form string="Seller Invoice">
<group colspan="4" >
<separator string="Create Invoices For Seller" colspan="4"/>
<field name="amount"/>
<field name="objects"/>
<field name="number" colspan="3"/>
<field name="number" colspan="1"/>
<label string="(Keep empty for automatic number)" colspan="2"/>
</group>
<separator string="" colspan="4" />
<separator string="" colspan="4"/>
<group colspan="4" col="6">
<button icon="gtk-close" special="cancel" string="Close"/>
<button icon="gtk-yes" string="Create invoices" name="makeInvoices" type="object"/>
+7 -7
View File
@@ -28,14 +28,14 @@ class auction_pay_buy(osv.osv_memory):
_name = "auction.pay.buy"
_description = "Pay buy"
_columns= {
'amount': fields.float('Amount paid', digits= (16, 2)),
'amount': fields.float('Amount', digits= (16, 2), help="Amount For First Bank Statement"),
'buyer_id':fields.many2one('res.partner', 'Buyer'),
'statement_id1':fields.many2one('account.bank.statement', 'Statement', required=True),
'amount2': fields.float('Amount paid', digits= (16, 2)),
'statement_id2':fields.many2one('account.bank.statement', 'Statement'),
'amount3': fields.float('Amount paid', digits = (16, 2)),
'statement_id3':fields.many2one('account.bank.statement', 'Statement'),
'total': fields.float('Amount paid', digits = (16, 2), readonly =True),
'statement_id1':fields.many2one('account.bank.statement', 'Statement', required=True, help="First Bank Statement For Buyer"),
'amount2': fields.float('Amount', digits= (16, 2), help="Amount For Second Bank Statement"),
'statement_id2':fields.many2one('account.bank.statement', 'Statement', help="Second Bank Statement For Buyer"),
'amount3': fields.float('Amount', digits = (16, 2), help="Amount For Third Bank Statement"),
'statement_id3':fields.many2one('account.bank.statement', 'Statement', help="Third Bank Statement For Buyer"),
'total': fields.float('Total Amount', digits = (16, 2), readonly =True),
}
def default_get(self, cr, uid, fields, context=None):
+27 -17
View File
@@ -7,23 +7,33 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Pay objects">
<group colspan="4" >
<separator string="Pay Objects" colspan="4" />
<field name="amount"/>
<field name="statement_id1" domain="[('state','=','draft')]"/>
<field name="amount2"/>
<field name="statement_id2" domain="[('state','=','draft')]"/>
<field name="amount3"/>
<field name="statement_id3" domain="[('state','=','draft')]"/>
<newline/>
<field name="buyer_id"/>
<field name="total"/>
</group>
<separator string="" colspan="4" />
<group colspan="4" col="6">
<button icon="gtk-close" special="cancel" string="Close"/>
<button icon="gtk-yes" string="Pay" name="pay_and_reconcile" type="object"/>
</group>
<group colspan="4" col="4" >
<separator string="Pay Objects" colspan="4" />
<field name="buyer_id"/>
<field name="total"/>
<newline/>
</group>
<separator string="Payment Lines" colspan="4"/>
<group colspan="4" col="4">
<label string="Line1"/>
<field name="amount"/>
<field name="statement_id1" domain="[('state','=','draft')]"/>
</group>
<group colspan="4" col="4">
<label string="Line2"/>
<field name="amount2"/>
<field name="statement_id2" domain="[('state','=','draft')]"/>
</group>
<group colspan="4" col="4">
<label string="Line3" />
<field name="amount3"/>
<field name="statement_id3" domain="[('state','=','draft')]"/>
</group>
<separator string="" colspan="4" />
<group colspan="4" col="6">
<button icon="gtk-close" special="cancel" string="Close"/>
<button icon="gtk-yes" string="Pay" name="pay_and_reconcile" type="object"/>
</group>
</form>
</field>
</record>
+4 -4
View File
@@ -45,9 +45,9 @@ class res_partner_contact(osv.osv):
return res
_columns = {
'name': fields.char('Last Name', size=30, required=True),
'first_name': fields.char('First Name', size=30),
'mobile': fields.char('Mobile', size=30),
'name': fields.char('Last Name', size=64, required=True),
'first_name': fields.char('First Name', size=64),
'mobile': fields.char('Mobile', size=64),
'title': fields.many2one('res.partner.title','Title'),
'website': fields.char('Website', size=120),
'lang_id': fields.many2one('res.lang', 'Language'),
@@ -203,7 +203,7 @@ class res_partner_job(osv.osv):
'address_id': fields.many2one('res.partner.address', 'Address', \
help='Address which is linked to the Partner'), # TO Correct: domain=[('partner_id', '=', name)]
'contact_id': fields.many2one('res.partner.contact','Contact', required=True, ondelete='cascade'),
'function': fields.char('Partner Function', size=34, help="Function of this contact with this partner"),
'function': fields.char('Partner Function', size=64, help="Function of this contact with this partner"),
'sequence_contact': fields.integer('Contact Seq.',help='Order of\
importance of this address in the list of addresses of the linked contact'),
'sequence_partner': fields.integer('Partner Seq.',help='Order of importance\
+10 -11
View File
@@ -23,18 +23,17 @@
<attribute name="string">Install Generic Modules</attribute>
</separator>
<group colspan="8">
<field name="crm" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction,profile_bookstore)"/> <field name="sale" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction,profile_bookstore)"/>
<field name="project" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction,profile_bookstore)"/> <field name="knowledge" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction,profile_bookstore)"/>
<field name="stock" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction,profile_bookstore)"/> <field name="mrp" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction,profile_bookstore)"/>
<field name="account" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction,profile_bookstore)"/> <field name="purchase" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction,profile_bookstore)"/>
<field name="hr" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction,profile_bookstore)"/> <field name="point_of_sale" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction,profile_bookstore)"/>
<field name="marketing" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction,profile_bookstore)"/> <field name="misc_tools" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction,profile_bookstore)"/>
<field name="report_designer" groups="base.group_extended" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction,profile_bookstore)"/>
<field name="crm" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/> <field name="sale" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/>
<field name="project" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/> <field name="knowledge" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/>
<field name="stock" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/> <field name="mrp" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/>
<field name="account" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/> <field name="purchase" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/>
<field name="hr" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/> <field name="point_of_sale" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/>
<field name="marketing" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/> <field name="misc_tools" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/>
<field name="report_designer" groups="base.group_extended" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/>
<separator string="Install Specific Business Modules" colspan="4"/>
<field name="association" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction,profile_bookstore)"/>
<field name="auction" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction,profile_bookstore)"/>
<field name="profile_bookstore" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction,profile_bookstore)"/>
<field name="product_expiry" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction,profile_bookstore)"/>
<field name="association" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/>
<field name="auction" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/>
<field name="product_expiry" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,auction)"/>
</group>
</data>
</field>
-4
View File
@@ -86,10 +86,6 @@ class base_setup_installer(osv.osv_memory):
help="Installs a preselected set of OpenERP "
"applications selected to help you manage your auctions "
"as well as the business processes around them."),
'profile_bookstore':fields.boolean('Book Stores',
help="Installs a preselected set of OpenERP "
"applications which will help you manage your book store "
"or your library."),
}
_defaults = {
'crm': True,
+1 -1
View File
@@ -1,7 +1,7 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# 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
+1 -1
View File
@@ -40,7 +40,7 @@ class crm_lead(osv.osv, crm_case):
""" CRM Lead Case """
_name = "crm.lead"
_description = "Lead"
_order = "priority, id desc"
_order = "date_action, priority, id desc"
_inherit = ['mailgate.thread','res.partner.address']
def _compute_day(self, cr, uid, ids, fields, args, context={}):
"""
-1
View File
@@ -20,7 +20,6 @@
##############################################################################
import time
import netsvc
from osv import fields,osv
from tools.translate import _
-2
View File
@@ -19,10 +19,8 @@
#
##############################################################################
import netsvc
from osv import fields,osv
from tools.translate import _
import tools
import decimal_precision as dp
+8 -8
View File
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-08-03 04:57+0000\n"
"Last-Translator: mga (Open ERP) <Unknown>\n"
"PO-Revision-Date: 2010-08-05 20:50+0000\n"
"Last-Translator: Grzegorz Grzelak (Cirrus.pl) <Unknown>\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-08-04 03:45+0000\n"
"X-Launchpad-Export-Date: 2010-08-06 03:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr
@@ -36,13 +36,13 @@ msgstr "Błąd! Nie możesz tworzyć rekurencyjnych działów"
#. module: hr
#: field:hr.employee,sinid:0
msgid "SIN No"
msgstr ""
msgstr "NIP"
#. module: hr
#: model:ir.module.module,shortdesc:hr.module_meta_information
#: model:ir.ui.menu,name:hr.menu_hr_root
msgid "Human Resources"
msgstr "Zasoby kadrowe"
msgstr "Kadry"
#. module: hr
#: selection:hr.timesheet,dayofweek:0
@@ -141,7 +141,7 @@ msgstr "Struktura pracowników"
#. module: hr
#: view:hr.employee:0
msgid "Social IDs"
msgstr ""
msgstr "ID"
#. module: hr
#: field:hr.employee,work_phone:0
@@ -330,7 +330,7 @@ msgstr "Utwórz użytkownika OpenERP"
#. module: hr
#: model:process.node,note:hr.process_node_employee0
msgid "Employee Complete Form"
msgstr ""
msgstr "Formularz pracownika"
#. module: hr
#: view:hr.department:0
@@ -431,7 +431,7 @@ msgstr "Narodowość"
#. module: hr
#: field:hr.employee,otherid:0
msgid "Other ID"
msgstr ""
msgstr "Inne ID"
#. module: hr
#: field:hr.timesheet,name:0
+22 -22
View File
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-08-03 06:06+0000\n"
"Last-Translator: mga (Open ERP) <Unknown>\n"
"PO-Revision-Date: 2010-08-05 19:25+0000\n"
"Last-Translator: Grzegorz Grzelak (Cirrus.pl) <Unknown>\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-08-04 03:45+0000\n"
"X-Launchpad-Export-Date: 2010-08-06 03:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_holidays
@@ -34,7 +34,7 @@ msgstr "Nieprawidłowa nazwa modelu w definicji akcji."
#. module: hr_holidays
#: field:hr.holidays.per.user,remaining_leaves:0
msgid "Remaining Leaves"
msgstr "Pozostało dni wolnych"
msgstr "Pozostało dni urlopu"
#. module: hr_holidays
#: model:ir.actions.act_window,name:hr_holidays.action_holiday_waiting
@@ -79,7 +79,7 @@ msgstr "Ustaw na projekt"
#: model:ir.model,name:hr_holidays.model_hr_holidays
#: model:process.node,name:hr_holidays.process_node_holidays0
msgid "Holidays"
msgstr "Dni wolne od pracy"
msgstr "Urlopy"
#. module: hr_holidays
#: xsl:holidays.summary:0
@@ -150,7 +150,7 @@ msgstr "Uwagi"
#: field:hr.holidays.log,holiday_status:0
#: field:hr.holidays.per.user,holiday_status:0
msgid "Holiday's Status"
msgstr "Stan dni wolnych"
msgstr "Rodzaj urlopu"
#. module: hr_holidays
#: model:process.transition,note:hr_holidays.process_transition_refusedrequest0
@@ -180,12 +180,12 @@ msgstr "Urlop został ustawiony w kalendarzu"
#. module: hr_holidays
#: view:hr.holidays.status:0
msgid "Holiday status"
msgstr "Stan urlopu"
msgstr "Rodzaje urlopu"
#. module: hr_holidays
#: model:ir.model,name:hr_holidays.model_hr_holidays_status
msgid "Holidays Status"
msgstr "Stany urlopów"
msgstr "Rodzaje urlopu"
#. module: hr_holidays
#: field:hr.holidays,date_to:0
@@ -200,7 +200,7 @@ msgstr "Dozwolone urlopy"
#. module: hr_holidays
#: model:process.node,note:hr_holidays.process_node_legaldeclaration0
msgid "Legal Declaration Document to declare new employee"
msgstr ""
msgstr "Formalny dokument deklaracji składanej przez nowego pracownika"
#. module: hr_holidays
#: selection:hr.holidays.status,color_name:0
@@ -215,7 +215,7 @@ msgstr "Urlopy na użytkownika"
#. module: hr_holidays
#: view:hr.holidays.status:0
msgid "Define holiday status"
msgstr "Zdefiniuj stan urlopu"
msgstr "Zdefiniuj rodzaj urlopu"
#. module: hr_holidays
#: selection:hr.holidays.summary,init,holiday_type:0
@@ -271,7 +271,7 @@ msgstr "Pracownik dostaje urlop"
#. module: hr_holidays
#: selection:hr.holidays.status,color_name:0
msgid "Light Salmon"
msgstr ""
msgstr "Jasno-łososiowy"
#. module: hr_holidays
#: selection:hr.holidays.status,color_name:0
@@ -299,7 +299,7 @@ msgstr "Liczba dni"
#: model:ir.actions.act_window,name:hr_holidays.open_view_holiday_status
#: model:ir.ui.menu,name:hr_holidays.menu_open_view_holiday_status
msgid "Holiday Status"
msgstr "Stan urlopu"
msgstr "Rodzaj urlopu"
#. module: hr_holidays
#: wizard_view:hr.holidays.summary,init:0
@@ -320,7 +320,7 @@ msgstr "Jego zwierzchnik zaaprobował wniosek"
#. module: hr_holidays
#: model:process.transition,note:hr_holidays.process_transition_holidaysdefrequest0
msgid "If holidays available, employee can take it and fill it."
msgstr ""
msgstr "Jeśli urlop jest dostępny, to pracownik może o niego wnioskować"
#. module: hr_holidays
#: wizard_view:hr.holidays.summary.employee,notify:0
@@ -330,7 +330,7 @@ msgstr "Musisz wybrać co najmniej jednego pracownika. Spróbuj ponownie."
#. module: hr_holidays
#: model:ir.ui.menu,name:hr_holidays.menu_action_my_holiday_validate
msgid "My Validated Holidays Requests"
msgstr ""
msgstr "Moje wnioski urlopowe - zatwierdzone"
#. module: hr_holidays
#: wizard_field:hr.holidays.summary.employee,init,emp:0
@@ -357,7 +357,7 @@ msgstr "Pozwól przekroczyć limit"
#. module: hr_holidays
#: field:hr.holidays.log,holiday_user_id:0
msgid "Holidays user"
msgstr ""
msgstr "Użytkownik urlopu"
#. module: hr_holidays
#: selection:hr.holidays.status,color_name:0
@@ -456,7 +456,7 @@ msgstr "Czarny"
#. module: hr_holidays
#: model:ir.ui.menu,name:hr_holidays.menu_action_my_holiday_refuse
msgid "My Refused Holidays Requests"
msgstr "Moje odrzucone wnioski o urlop"
msgstr "Moje wnioski urlopowe - odrzucone"
#. module: hr_holidays
#: model:process.transition,name:hr_holidays.process_transition_setholiday0
@@ -466,7 +466,7 @@ msgstr "Ustaw urlop"
#. module: hr_holidays
#: model:ir.ui.menu,name:hr_holidays.menu_action_my_holiday_draft
msgid "My Draft Holidays Requests"
msgstr "Moje projekty wniosków urlopowych"
msgstr "Moje wnioski urlopowe - projekty"
#. module: hr_holidays
#: field:hr.holidays.per.user,max_leaves:0
@@ -491,7 +491,7 @@ msgstr "Moje wnioski urlopowe"
#. module: hr_holidays
#: field:hr.holidays.status,color_name:0
msgid "Color of the status"
msgstr "Kolor stanu"
msgstr "Kolor dla rodzaju"
#. module: hr_holidays
#: selection:hr.holidays.summary,init,holiday_type:0
@@ -601,7 +601,7 @@ msgstr "Zatwierdzony"
#. module: hr_holidays
#: model:ir.actions.act_window,name:hr_holidays.action_my_holiday_refuse
msgid "My Holidays Request Refused"
msgstr "Moje odrzucone wnioski o urlop"
msgstr "Moje wnioski urlopowe - odrzucone"
#. module: hr_holidays
#: constraint:ir.model:0
@@ -658,7 +658,7 @@ msgstr "Wybierz typ urlopu"
#. module: hr_holidays
#: field:hr.holidays,case_id:0
msgid "Case"
msgstr "Przypadek"
msgstr "Sprawa"
#. module: hr_holidays
#: field:hr.holidays,holiday_user_id:0
@@ -688,7 +688,7 @@ msgstr "Czerwony"
#. module: hr_holidays
#: model:ir.module.module,shortdesc:hr_holidays.module_meta_information
msgid "Human Resources: Holidays management"
msgstr "Zasoby ludzkie: zarządzanie urlopami"
msgstr "Kadry: Urlopy"
#. module: hr_holidays
#: model:process.process,name:hr_holidays.process_process_holidaysprocess0
@@ -703,7 +703,7 @@ msgstr "Musisz wybrac co najmniej jeden dział. Spróbuj ponownie."
#. module: hr_holidays
#: model:ir.actions.act_window,name:hr_holidays.action_my_holiday_validate
msgid "My Holidays Request Validated"
msgstr "Moje zatwierdzone wnioski urlopowe"
msgstr "Moje wnioski urlopowe - zatwierdzone"
#. module: hr_holidays
#: field:hr.holidays.log,holiday_req_id:0
+25
View File
@@ -325,6 +325,17 @@ class payroll_advice(osv.osv):
_name = 'hr.payroll.advice'
_description = 'Bank Advice Note'
def _get_bank(self, cr, uid, ids, field_name, args, context=None):
res = {}
if context is None:
context = {}
for rec in self.browse(cr, uid, ids, context=context):
if rec.company_id and rec.company_id.partner_id.bank_ids:
res[rec.id] = rec.company_id.partner_id.bank_ids[0].bank.name
else:
res[rec.id] = ''
return res
_columns = {
'register_id':fields.many2one('hr.payroll.register', 'Payroll Register', required=False),
'name':fields.char('Name', size=2048, required=True, readonly=False),
@@ -340,6 +351,7 @@ class payroll_advice(osv.osv):
'chaque_nos':fields.char('Chaque Nos', size=256, required=False, readonly=False),
'account_id': fields.many2one('account.account', 'Account', required=True),
'company_id':fields.many2one('res.company', 'Company', required=False),
'bank': fields.function(_get_bank, method=True, string='Bank', type="char"),
}
_defaults = {
@@ -368,6 +380,19 @@ class payroll_advice(osv.osv):
self.write(cr, uid, ids, {'state':'cancel'}, context=context)
return True
def onchange_company_id(self, cr, uid, ids, company_id=False, context=None):
res = {}
if context is None:
context = {}
if company_id:
company = self.pool.get('res.company').browse(cr, uid, company_id, context=context)
if company.partner_id.bank_ids:
res.update({'bank': company.partner_id.bank_ids[0].bank.name})
return {
'value':res
}
payroll_advice()
class payroll_advice_line(osv.osv):
+9 -6
View File
@@ -606,7 +606,7 @@
<filter icon="terp-check" string="Deduction" domain="[('type','=','deduction')]"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="code" select="1"/>
<field name="type"/>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="4" groups="base.group_extended">
@@ -692,11 +692,11 @@
</field>
</record>
<record id="view_hr_company_contribution_filter" model="ir.ui.view">
<record id="view_hr_company_contribution_filter" model="ir.ui.view">
<field name="name">company.contribution.select</field>
<field name="model">company.contribution</field>
<field name="type">search</field>
<field name="arch" type="xml">
<field name="arch" type="xml">
<search string="Search Company Contribution">
<group col="8" colspan="4">
<filter icon="terp-document-new" string="Fixed Amount" domain="[('amount_type','=','fix')]" help="Draft Slip"/>
@@ -720,7 +720,7 @@
<field name="res_model">company.contribution</field>
<field name="view_type">form</field>
<field name="view_id" ref="hr_company_contribution_tree"/>
<field name="search_view_id" ref="view_hr_company_contribution_filter"/>
<field name="search_view_id" ref="view_hr_company_contribution_filter"/>
</record>
<menuitem
id="menu_hr_company_contribution_tree"
@@ -814,10 +814,13 @@
<field name="flag"/>
</tree>
</field>
<field name="company_id"/>
<field name="chaque_nos"/>
</page>
<page string="Letter Content">
<group colspan="4" col="6">
<field name="company_id" on_change="onchange_company_id(company_id)"/>
<field name="chaque_nos"/>
<field name="bank"/>
</group>
<separator colspan="4" string="Letter Details"/>
<field name="note" colspan="4" nolabel="1"/>
</page>
+10 -10
View File
@@ -2,7 +2,7 @@
<document filename="test.pdf">
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
<frame id="first" x1="57.0" y1="57.0" width="480" height="728"/>
</pageTemplate>
</template>
<stylesheet>
@@ -104,7 +104,7 @@
<para style="P3">
<font color="white"> </font>
</para>
<blockTable colWidths="72.0,295.0,47.0,68.0" style="Table3">
<blockTable colWidths="72.0,294.0,46.0,68.0" style="Table3">
<tr>
<td>
<para style="P6">Expanse To</para>
@@ -130,7 +130,7 @@
<para style="P6">Date</para>
</td>
<td>
<para style="P12">[[o.date]]</para>
<para style="P12">[[formatLang(time.strftime('%Y-%m-%d'), date = True)]]</para>
</td>
</tr>
</blockTable>
@@ -177,22 +177,22 @@
<para style="P8">[[ l.employee_id.name ]]</para>
</td>
<td>
<para style="P10">[[l.basic]]</para>
<para style="P10">[[formatLang(l.basic)]]</para>
</td>
<td>
<para style="P10">[[l.other_pay]]</para>
<para style="P10">[[formatLang(l.other_pay)]]</para>
</td>
<td>
<para style="P10">[[l.allounce]]</para>
<para style="P10">[[formatLang(l.allounce)]]</para>
</td>
<td>
<para style="P10">[[l.grows]]</para>
<para style="P10">[[formatLang(l.grows)]]</para>
</td>
<td>
<para style="P10">[[l.deduction]]</para>
<para style="P10">[[formatLang(l.deduction)]]</para>
</td>
<td>
<para style="P10">[[l.net]]</para>
<para style="P10">[[formatLang(l.net)]]</para>
</td>
</tr>
</blockTable>
@@ -230,7 +230,7 @@
<font color="white"> </font>
</para>
</section>
<blockTable colWidths="241.0,241.0" style="Table5">
<blockTable colWidths="240.0,240.0" style="Table5">
<tr>
<td>
<para style="P6">For [[company.name]],</para>
+21 -44
View File
@@ -72,15 +72,9 @@
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="5,0" stop="5,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
</blockTableStyle>
<blockTableStyle id="Table18">
<blockAlignment value="LEFT"/>
@@ -95,15 +89,9 @@
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="5,0" stop="5,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
</blockTableStyle>
<blockTableStyle id="Table10">
<blockAlignment value="LEFT"/>
@@ -240,18 +228,18 @@
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
<paraStyle name="Standard" fontName="Times-Roman"/>
<paraStyle name="Standard" fontName="Helvetica"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Times-Roman" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Times-Roman"/>
<paraStyle name="Table Contents" fontName="Times-Roman"/>
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER"/>
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Helvetica"/>
<paraStyle name="Table Contents" fontName="Helvetica"/>
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_8" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Footer" fontName="Times-Roman"/>
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
<paraStyle name="Footer" fontName="Helvetica"/>
<paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
@@ -272,11 +260,11 @@
<paraStyle name="terp_default_2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_White_2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#ffffff"/>
<paraStyle name="terp_default_Note" rightIndent="0.0" leftIndent="9.0" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Table" fontName="Times-Roman" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Table" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_space" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="14.0" leading="17" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<images/>
</stylesheet>
<images/>
<story>
<para style="terp_default_8">[[repeatIn(objects,'o')]]</para>
<blockTable colWidths="539.0" style="Table2">
@@ -296,7 +284,7 @@
<para style="terp_default_9">
<font color="white"> </font>
</para>
<blockTable colWidths="43.0,101.0,67.0,328.0" style="Table15">
<blockTable colWidths="42.0,207.0,93.0,197.0" style="Table15">
<tr>
<td>
<para style="terp_default_Bold_9">Code</para>
@@ -312,7 +300,7 @@
</td>
</tr>
</blockTable>
<blockTable colWidths="43.0,496.0" style="Table16">
<blockTable colWidths="42.0,497.0" style="Table16">
<tr>
<td>
<para style="terp_default_Bold_9">Address </para>
@@ -322,7 +310,7 @@
</td>
</tr>
</blockTable>
<blockTable colWidths="43.0,168.0,65.0,263.0" style="Table1">
<blockTable colWidths="42.0,207.0,93.0,197.0" style="Table1">
<tr>
<td>
<para style="terp_default_Bold_9">Email</para>
@@ -338,7 +326,7 @@
</td>
</tr>
</blockTable>
<blockTable colWidths="43.0,102.0,66.0,169.0,68.0,91.0" style="Table17">
<blockTable colWidths="42.0,207.0,93.0,197.0" style="Table17">
<tr>
<td>
<para style="terp_default_Bold_9">Slip ID</para>
@@ -346,12 +334,6 @@
<td>
<para style="terp_default_9">[[ o.number or '' ]]</para>
</td>
<td>
<para style="terp_default_Bold_9">Bill No</para>
</td>
<td>
<para style="terp_default_9">[[ o.move_id and o.move_id.name or '' ]]</para>
</td>
<td>
<para style="terp_default_Bold_9">PAN No</para>
</td>
@@ -360,7 +342,7 @@
</td>
</tr>
</blockTable>
<blockTable colWidths="43.0,102.0,66.0,169.0,68.0,91.0" style="Table18">
<blockTable colWidths="42.0,207.0,93.0,197.0" style="Table18">
<tr>
<td>
<para style="terp_default_Bold_9">Register</para>
@@ -368,17 +350,11 @@
<td>
<para style="terp_default_9">[[ o.register_id and o.register_id.name or '' ]]</para>
</td>
<td>
<para style="terp_default_Bold_9">Payment</para>
</td>
<td>
<para style="terp_default_9">[[ o.payment_id and o.payment_id.name or '' ]]</para>
</td>
<td>
<para style="terp_default_Bold_9">Designation </para>
</td>
<td>
<para style="terp_default_9">[[ o.employee_id.contract_ids and o.employee_id.contract_ids[0].function.name or '' ]]</para>
<para style="terp_default_9">[[ o.employee_id.contract_ids and o.employee_id.contract_ids[0].job_id.name or '' ]]</para>
</td>
</tr>
</blockTable>
@@ -515,7 +491,7 @@
</tr>
<tr>
<td>
<para style="terp_default_9"><font>[[repeatIn(get_earnings(o.line_ids),'a') ]]</font><font>[[ a.code or removeParentNode('tr') ]]</font></para>
<para style="terp_default_9">[[repeatIn(get_earnings(o.line_ids),'a') ]] [[ a.code or removeParentNode('tr') ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(a.total) ]]</para>
@@ -669,3 +645,4 @@
</para>
</story>
</document>
@@ -64,14 +64,14 @@
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Standard" fontName="Times-Roman"/>
<paraStyle name="Standard" fontName="Helvetica"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Helvetica"/>
<paraStyle name="Table Contents" fontName="Times-Roman"/>
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER"/>
<paraStyle name="Table Contents" fontName="Helvetica"/>
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
@@ -81,8 +81,8 @@
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Footer" fontName="Times-Roman"/>
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
<paraStyle name="Footer" fontName="Helvetica"/>
<paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
@@ -97,10 +97,10 @@
<paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_8_space" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="1.0"/>
<paraStyle name="Drawing" fontName="Helvetica-Oblique" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Header" fontName="Times-Roman"/>
<paraStyle name="Endnote" rightIndent="0.0" leftIndent="14.0" fontName="Times-Roman" fontSize="10.0" leading="13"/>
<paraStyle name="Addressee" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="3.0"/>
<paraStyle name="Signature" fontName="Times-Roman"/>
<paraStyle name="Header" fontName="Helvetica"/>
<paraStyle name="Endnote" rightIndent="0.0" leftIndent="14.0" fontName="Helvetica" fontSize="10.0" leading="13"/>
<paraStyle name="Addressee" fontName="Helvetica" spaceBefore="0.0" spaceAfter="3.0"/>
<paraStyle name="Signature" fontName="Helvetica"/>
<paraStyle name="Heading 8" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 7" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 6" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
@@ -109,15 +109,15 @@
<paraStyle name="Heading 1" fontName="Helvetica-Bold" fontSize="115%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 10" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 2" fontName="Helvetica-BoldOblique" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="First line indent" rightIndent="0.0" leftIndent="0.0" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Hanging indent" rightIndent="0.0" leftIndent="28.0" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Salutation" fontName="Times-Roman"/>
<paraStyle name="Text body indent" rightIndent="0.0" leftIndent="0.0" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="First line indent" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Hanging indent" rightIndent="0.0" leftIndent="28.0" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Salutation" fontName="Helvetica"/>
<paraStyle name="Text body indent" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Heading 3" fontName="Helvetica-Bold" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="List Indent" rightIndent="0.0" leftIndent="142.0" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Marginalia" rightIndent="0.0" leftIndent="113.0" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List Indent" rightIndent="0.0" leftIndent="142.0" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Marginalia" rightIndent="0.0" leftIndent="113.0" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<images/>
</stylesheet>
<images/>
<story>
<para style="terp_default_8">[[repeatIn(objects,'o')]]</para>
<para style="terp_tblheader_Details_Centre">Payment Advice</para>
@@ -132,7 +132,9 @@
</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(o.date,date=True) ]]</para>
<para style="terp_default_Right_9">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
@@ -147,7 +149,7 @@
</tr>
<tr>
<td>
<para style="terp_default_Bold_9">Axis Bank</para>
<para style="terp_default_Bold_9">[[o.bank or 'Bank']]</para>
</td>
<td>
<para style="terp_default_Bold_9">
@@ -172,7 +174,7 @@
<blockTable colWidths="539.0" style="Table2">
<tr>
<td>
<para style="terp_tblheader_General_Centre"><u>[[ o.name ]] for period [[ get_month(o.date)['mname'] ]]</u></para>
<para style="terp_tblheader_General_Centre">[[ o.name ]] for period [[ get_month(o.date)['mname'] ]]</para>
</td>
</tr>
</blockTable>
@@ -335,3 +337,4 @@
</para>
</story>
</document>
+16 -13
View File
@@ -234,16 +234,16 @@ class mailgate_tool(osv.osv_memory):
msg_pool = self.pool.get('mailgate.message')
for res_id in res_ids:
msg_data = {
'name': msg.get('subject', 'No subject'),
'date': msg.get('date') ,
'description': msg.get('body', msg.get('from')),
'name': msg.get('subject', 'No subject'),
'date': msg.get('date'),
'description': msg.get('body', msg.get('from')),
'history': True,
'res_model': model,
'email_cc': msg.get('cc'),
'email_from': msg.get('from'),
'res_model': model,
'email_cc': msg.get('cc'),
'email_from': msg.get('from'),
'email_to': msg.get('to'),
'message_id': msg.get('message-id'),
'references': msg.get('references'),
'message_id': msg.get('message-id'),
'references': msg.get('references') or msg.get('in-reply-to'),
'res_id': res_id,
'user_id': uid,
'attachment_ids': [(6, 0, attach)]
@@ -380,6 +380,9 @@ class mailgate_tool(osv.osv_memory):
if 'References' in fields:
msg['references'] = msg_txt.get('References')
if 'In-Reply-To' in fields:
msg['in-reply-to'] = msg_txt.get('In-Reply-To')
if 'X-Priority' in fields:
msg['priority'] = msg_txt.get('X-Priority', '3 (Normal)').split(' ')[0]
@@ -425,12 +428,12 @@ class mailgate_tool(osv.osv_memory):
res_ids = []
attachment_ids = []
new_res_id = False
if msg.get('references'):
references = msg.get('references')
if msg.get('references') or msg.get('in-reply-to'):
references = msg.get('references') or msg.get('in-reply-to')
if '\r\n' in references:
references = msg.get('references').split('\r\n')
references = references.split('\r\n')
else:
references = msg.get('references').split(' ')
references = references.split(' ')
for ref in references:
ref = ref.strip()
res_id = tools.misc.reference_re.search(ref)
@@ -464,7 +467,7 @@ class mailgate_tool(osv.osv_memory):
email_from = msg.get('from'),
email_cc = msg.get('cc'),
message_id = msg.get('message-id'),
references = msg.get('references', False),
references = msg.get('references', False) or msg.get('in-reply-to', False),
attach = attachments.items(),
context = context)
else:
+3 -3
View File
@@ -23,15 +23,15 @@
"version" : "1.0",
"author" : "OpenERP SA",
"website" : "http://www.openerp.com/",
"depends" : ["base"],
"depends" : ["base", "mail_gateway"],
"category" : "Generic Modules/Outlook interface",
"description": '''
This module provide the Outlook plug-in.
Outlook plug-in allows you to select an object that you’d like to add
to your email and its attachments from MS Outlook. You can select a partner, a task,
a project, an analytical account, or any other object and attach selected
mail as .eml file in attachment of selected record.
a project, an analytical account, or any other object and Archived selected
mail in mailgate.messages with attachments.
''',
"init_xml" : [],
+1 -1
View File
@@ -711,7 +711,7 @@ def SearchObjectsForText(btnProcessor,*args):
search_txt = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0])
if not search_txt:
win32ui.MessageBox("Enter text to search for", "", flag_info)
win32ui.MessageBox("Enter text to search for", "Archive to OpenERP", flag_info)
return
# Get titles from list
obj_titles=[]
Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

File diff suppressed because one or more lines are too long
@@ -33,8 +33,7 @@ STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU | DS_MODALFRAME
CAPTION "OpenERP Configuarion"
FONT 8, "Tahoma", 1000, 0, 0x0
BEGIN
DEFPUSHBUTTON "Done",ID_DONE,400,239,50,14//,WS_VISIBLE //| WS_TABSTOP
PUSHBUTTON "Cancel",IDCANCEL,340,239,50,14//, WS_VISIBLE //| WS_TABSTOP
DEFPUSHBUTTON "Cancel",ID_DONE,400,239,50,14//,WS_VISIBLE //| WS_TABSTOP
CONTROL "",IDC_TAB,"SysTabControl32",0x0,8,7,440,228
CONTROL "",IDC_LIST,"SysListView32",WS_CHILD | WS_VISIBLE | WS_BORDER | WS_HSCROLL | WS_VSCROLL |
LVS_SHOWSELALWAYS | LVS_REPORT | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES,0,0,0,0
@@ -57,7 +56,7 @@ BEGIN
EDITTEXT ID_USERNAME,85,70,154,12,ES_AUTOHSCROLL | WS_VISIBLE | WS_TABSTOP
LTEXT "Password : ",IDC_STATIC,30,90,100,17
EDITTEXT ID_PASSWORD,85,90,154,12,ES_AUTOHSCROLL | WS_VISIBLE | WS_TABSTOP | ES_PASSWORD
PUSHBUTTON "Test Connection",ID_BUT_TESTCONNECTION,179,110,60,13, WS_VISIBLE | WS_TABSTOP
PUSHBUTTON "Connect",ID_BUT_TESTCONNECTION,179,110,60,13, WS_VISIBLE | WS_TABSTOP
END
IDD_OBJECT_SETTINGS DIALOGEX 0, 0, 430, 210
@@ -92,25 +91,21 @@ BEGIN
LTEXT "",IDC_ABOUT,80,90,250,100
END
IDD_SERVER_PORT_DIALOG DIALOGEX 0, 0, 160, 90
IDD_SERVER_PORT_DIALOG DIALOGEX 0, 0, 160, 55
STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP
CAPTION "Server and Port"
CAPTION "OpenERP Connection"
FONT 8, "Tahoma", 400, 0, 0x0
BEGIN
LTEXT "Server : ",IDC_STATIC,5,3,150,17
EDITTEXT ID_SERVER,40,3,94,12,ES_AUTOHSCROLL | WS_TABSTOP
EDITTEXT ID_SERVER,40,3,100,12,ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Port : ",IDC_STATIC,5,18,100,17
EDITTEXT ID_PORT,40,18,94,12,ES_AUTOHSCROLL | WS_TABSTOP
GROUPBOX " Protocol ", IDC_STATIC_GROUP, 5, 35, 150, 30
PUSHBUTTON "XML-RPC",IDR_XML_PROTOCOL,8,45,50,14,BS_AUTORADIOBUTTON | BST_CHECKED |WS_TABSTOP
PUSHBUTTON "XML-RPCS",IDR_XMLS_PROTOCOL,55,45,50,14,BS_AUTORADIOBUTTON | WS_TABSTOP
PUSHBUTTON "NET-RPC",IDR_NETRPC_PROTOCOL,105,45,45,14,BS_AUTORADIOBUTTON | WS_TABSTOP
PUSHBUTTON "Close",IDCANCEL,60,70,45,14,WS_TABSTOP
DEFPUSHBUTTON "OK",IDOK,110,70,45,14,WS_TABSTOP
EDITTEXT ID_PORT,40,18,100,12,ES_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "Close",IDCANCEL,110,35,45,14,WS_TABSTOP
DEFPUSHBUTTON "OK",IDOK,60,35,45,14,WS_TABSTOP
END
IDD_SYNC DIALOGEX 0, 0, 470, 300
IDD_SYNC DIALOGEX 0, 0, 470, 320
STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP
CAPTION "Archive to OpenERP"
@@ -120,8 +115,9 @@ BEGIN
LTEXT "Search for : ",IDC_STATIC,15,17,40,12
EDITTEXT ID_SEARCH_TEXT,60,15,120,12,ES_AUTOHSCROLL | WS_TABSTOP// left top width height
PUSHBUTTON "Search",ID_SEARCH,187,15,40,14,WS_TABSTOP
LTEXT "Documents : ",IDC_STATIC,15,140,100,14
CONTROL "List1",IDC_NAME_LIST,"SysListView32",WS_CHILD | WS_VISIBLE | WS_BORDER | LVS_SHOWSELALWAYS | LVS_REPORT | WS_TABSTOP, 15,150,234,110
PUSHBUTTON "Upload to OpenERP",ID_MAKE_ATTACHMENT,160,270,85,14,WS_TABSTOP
PUSHBUTTON "Archive to OpenERP",ID_MAKE_ATTACHMENT,160,270,85,14,WS_TABSTOP
GROUPBOX " Create a Document ", IDC_STATIC_GROUP, 263,5,202,100,WS_TABSTOP
LTEXT "Type of Document : ",IDC_STATIC,266,25,100,12
@@ -132,7 +128,7 @@ BEGIN
GROUPBOX " Create a Contact ", IDC_STATIC_GROUP, 263, 110,202,185,WS_TABSTOP
LTEXT "Create a New Contact : ",IDC_STATIC,280,140,100,12
PUSHBUTTON "Create Contact",ID_CREATE_CONTACT,360,138,60,14,WS_TABSTOP
PUSHBUTTON "Cancel",IDCANCEL,385,270,60,14,WS_TABSTOP
PUSHBUTTON "Close",IDCANCEL,385,300,60,14,WS_TABSTOP
END
IDD_NEW_CONTACT_DIALOG DIALOGEX 0, 0, 350, 190
+3 -2
View File
@@ -37,7 +37,8 @@ def generateEML(mail):
eml_name= ustr(sub).encode('iso-8859-1')+'-'+str(mail.EntryID)[-9:]
ls = ['*', '/', '\\', '<', '>', ':', '?', '"', '|', '\t', '\n']
attachments_folder_path = os.path.abspath(os.path.dirname(__file__)+"\\dialogs\\resources\\attachments\\")
mails_folder_path = os.path.abspath(os.path.dirname(__file__)+"\\dialogs\\resources\\mails\\")
attachments_folder_path = mails_folder_path + "\\attachments\\"
if not os.path.exists(attachments_folder_path):
os.makedirs(attachments_folder_path)
for i in xrange(1, attachments.Count+1):
@@ -62,7 +63,7 @@ def generateEML(mail):
print mail.lastErrorText()
sys.exit()
mails_folder_path = os.path.abspath(os.path.dirname(__file__)+"\\dialogs\\resources\\mails\\")
if not os.path.exists(mails_folder_path):
os.makedirs(mails_folder_path)
for c in ls:
+63 -48
View File
@@ -26,11 +26,11 @@ import os
import pythoncom
import time
from manager import ustr
waittime = 10
wait_count = 0
wait_limit = 12
import binascii
import base64
def execute(connector, method, *args):
global wait_count
res = False
@@ -119,7 +119,7 @@ class XMLRpcConn(object):
def InsertObj(self, obj_title,obj_name,image_path):
self._obj_list=list(self._obj_list)
self._obj_list.append((obj_title,obj_name,ustr(image_path).encode('iso-8859-1')))
self._obj_list.append((obj_title,obj_name,ustr(image_path)))
self._obj_list.sort(reverse=True)
def DeleteObject(self,sel_text):
@@ -133,46 +133,53 @@ class XMLRpcConn(object):
import win32ui, win32con
conn = xmlrpclib.ServerProxy(self._uri + '/xmlrpc/object')
import eml
msg = ""
ext_msg = ""
new_msg = files = ext_msg =""
eml_path=eml.generateEML(mail)
att_name = ustr(eml_path.split('\\')[-1])
cnt=1
flag=False
for rec in recs: #[('res.partner', 3, 'Agrolait')]
cnt+=1
obj = rec[0]
obj_id = rec[1]
ids=execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.attachment','search',[('res_id','=',obj_id),('name','=',att_name)])
object_ids = execute ( conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','search',[('model','=',obj)])
object_name = execute( conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','read',object_ids,['name'])[0]['name']
sub = ustr(mail.Subject)
if ids:
name=execute(conn,'execute',self._dbname,int(self._uid),self._pwd,obj,'read',obj_id,['name'])['name']
ext_msg+=""" - File "{0}.eml" is already archived to {1} "{2}" .
""".format(sub,object_name,name)
continue
if len(sub) > 60:
l = 60 - len(sub)
sub = sub[0:l]
res={}
res['res_model'] = obj
content = "".join(open(eml_path,"r").readlines()).encode('base64')
res['name'] = att_name
res['datas_fname'] = sub+".eml"
res['datas'] = content
res['res_id'] = obj_id
execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.attachment','create',res)
msg+=""" - File "{0}.eml" archived to {1} "{2}".
""".format(sub,object_name,str(rec[2]))
flag=True
if flag:
t = "Mail archived to OpenERP.\nArchive Summary : \n"
if ext_msg != "" :
t+="\nAlready Attached Documents : \n"+ext_msg +"\n"
t+="Newly Attachment Documents:\n"+msg
win32ui.MessageBox(t,"Archive To OpenERP",win32con.MB_ICONINFORMATION)
attachments=mail.Attachments
for rec in recs: #[('res.partner', 3, 'Agrolait')]
model = rec[0]
res_id = rec[1]
object_ids = execute ( conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','search',[('model','=',model)])
object_name = execute( conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','read',object_ids,['name'])[0]['name']
#Reading the Object ir.model Name
ext_ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'mailgate.message','search',[('message_id','=',mail.EntryID),('model','=',model),('res_id','=',res_id)])
if ext_ids:
name = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,model,'read',res_id,['name'])['name']
ext_msg += """This mail is already archived to {1} '{2}'.
""".format(object_name,name)
continue
msg = {
'subject':mail.Subject,
'date':str(mail.ReceivedTime),
'body':mail.Body,
'cc':mail.CC,
'from':mail.SenderEmailAddress,
'to':mail.To,
'message-id':str(mail.EntryID),## we are use Entry_Id as a MessageID Because MessageID is not provided by Outlook API, http://msdn.microsoft.com/en-us/library/bb176688%28v=office.12%29.aspx
'references':False,
}
result = {}
if attachments:
result = self.MakeAttachment([rec], mail)
attachment_ids = result.get(model, {}).get(res_id, [])
ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'email.server.tools','history',model, res_id, msg, attachment_ids)
new_msg += """- {0} : {1}\n""".format(object_name,str(rec[2]))
flag = True
if flag:
t = ext_msg
t += """Mail archived Successfully with attachments.\n"""+new_msg
win32ui.MessageBox(t,"Archived to OpenERP",win32con.MB_ICONINFORMATION)
return flag
def IsCRMInstalled(self):
@@ -189,7 +196,7 @@ class XMLRpcConn(object):
obj_list.append((-999, ustr('')))
for id in ids:
object = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.partner','read',[id],['id','name'])[0]
obj_list.append((object['id'], ustr(object['name']).encode('iso-8859-1')))
obj_list.append((object['id'], ustr(object['name'])))
return obj_list
def GetObjectItems(self, search_list=[], search_text=''):
@@ -203,17 +210,17 @@ class XMLRpcConn(object):
ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,obj,'search',['|',('name','ilike',ustr(search_text)),('email','ilike',ustr(search_text))])
recs = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,obj,'read',ids,['id','name','street','city'])
for rec in recs:
name = ustr(rec['name']).encode('iso-8859-1')
name = ustr(rec['name'])
if rec['street']:
name += ', ' + ustr(rec['street']).encode('iso-8859-1')
name += ', ' + ustr(rec['street'])
if rec['city']:
name += ', ' + ustr(rec['city']).encode('iso-8859-1')
name += ', ' + ustr(rec['city'])
res.append((obj,rec['id'],name,object_name))
else:
ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,obj,'search',[('name','ilike',ustr(search_text))])
recs = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,obj,'read',ids,['id','name'])
for rec in recs:
name = ustr(rec['name']).encode('iso-8859-1')
name = ustr(rec['name'])
res.append((obj,rec['id'],name,object_name))
return res
@@ -247,17 +254,22 @@ class XMLRpcConn(object):
def MakeAttachment(self, recs, mail):
attachments = mail.Attachments
result = {}
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
att_folder_path = os.path.abspath(os.path.dirname(__file__)+"\\dialogs\\resources\\attachments\\")
if not os.path.exists(att_folder_path):
os.makedirs(att_folder_path)
for rec in recs: #[('res.partner', 3, 'Agrolait')]
obj = rec[0]
obj_id = rec[1]
res={}
res['res_model'] = obj
attachment_ids = []
if obj not in result:
result[obj] = {}
for i in xrange(1, attachments.Count+1):
fn = ustr(attachments[i].FileName).encode('iso-8859-1')
fn = ustr(attachments[i].FileName)
if len(fn) > 64:
l = 64 - len(fn)
f = fn.split('.')
@@ -271,7 +283,10 @@ class XMLRpcConn(object):
res['datas_fname'] = ustr(fn)
res['datas'] = content
res['res_id'] = obj_id
execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.attachment','create',res)
id = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.attachment','create',res)
attachment_ids.append(id)
result[obj].update({obj_id: attachment_ids})
return result
def CreateContact(self, sel=None, res=None):
res=eval(str(res))
@@ -345,7 +360,7 @@ class XMLRpcConn(object):
state_ids = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.country.state', 'search', [])
for state_id in state_ids:
obj = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.country.state', 'read', [state_id],['id','name'])[0]
state_list.append((obj['id'], ustr(obj['name']).encode('iso-8859-1')))
state_list.append((obj['id'], ustr(obj['name'])))
return state_list
def GetAllCountry(self):
@@ -356,5 +371,5 @@ class XMLRpcConn(object):
country_ids = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.country', 'search', [])
for country_id in country_ids:
obj = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.country','read', [country_id], ['id','name'])[0]
country_list.append((obj['id'], ustr(obj['name']).encode('iso-8859-1')))
country_list.append((obj['id'], ustr(obj['name'])))
return country_list
+74 -90
View File
@@ -29,12 +29,12 @@ from osv import fields, osv
class project_task_type(osv.osv):
_name = 'project.task.type'
_description = 'Task Stage'
_order = 'sequence'
_columns = {
'name': fields.char('Stage Name', required=True, size=64, translate=True),
'description': fields.text('Description'),
'sequence': fields.integer('Sequence'),
}
_order = 'sequence'
_defaults = {
'sequence': 1
@@ -55,8 +55,7 @@ class project(osv.osv):
LEFT JOIN account_analytic_account account ON account.id = project.analytic_account_id
LEFT JOIN project_user_rel rel ON rel.project_id = project.analytic_account_id
WHERE (account.user_id = %s or rel.uid = %s)"""%(user, user))
res = cr.fetchall()
return [(r[0]) for r in res]
return [(r[0]) for r in cr.fetchall()]
return super(project, self).search(cr, user, args, offset=offset, limit=limit, order=order,
context=context, count=count)
@@ -66,10 +65,6 @@ class project(osv.osv):
res[m.id] = (m.parent_id and (m.parent_id.name + '/') or '') + m.name
return res
def check_recursion(self, cursor, user, ids, parent=None):
return super(project, self).check_recursion(cursor, user, ids,
parent=parent)
def onchange_partner_id(self, cr, uid, ids, part=False, context=None):
partner_obj = self.pool.get('res.partner')
if not part:
@@ -80,30 +75,29 @@ class project(osv.osv):
return {'value':{'contact_id': addr['contact'], 'pricelist_id': pricelist_id}}
def get_all_child_projects(self, cr, uid, ids, context=None):
# Calculate child project for Given project id => For progress rate + planned time + Time spent
cr.execute('''select prpc.id as id from account_analytic_account as p
join account_analytic_account as c on p.id = c.parent_id
join project_project as prp on prp.analytic_account_id = p.id
join project_project as prpc on prpc.analytic_account_id = c.id
where prp.id in %s''',(tuple(ids),))
join account_analytic_account as c on p.id = c.parent_id
join project_project as prp on prp.analytic_account_id = p.id
join project_project as prpc on prpc.analytic_account_id = c.id
where prp.id in %s''',(tuple(ids),))
child_ids = cr.fetchall()
if child_ids:
child_ids = [x[0] for x in child_ids]
child_ids = self.get_all_child_projects(cr, uid, child_ids)
child_ids = [x[0] for x in child_ids]
child_ids = self.get_all_child_projects(cr, uid, child_ids)
return ids + child_ids
return ids+child_ids
def _get_user_and_default_uom_ids(self, cr, uid):
users_obj = self.pool.get('res.users')
model_data_obj = self.pool.get('ir.model.data')
model_data_id = model_data_obj._get_id(cr, uid, 'product', 'uom_hour')
default_uom = user_uom = model_data_obj.read(cr, uid, [model_data_id], ['res_id'])[0]['res_id']
obj_tm = users_obj.browse(cr, uid, uid).company_id.project_time_mode_id
if obj_tm:
user_uom = obj_tm.id
return user_uom, default_uom
def _progress_rate(self, cr, uid, ids, names, arg, context=None):
res = {}.fromkeys(ids, 0.0)
progress = {}
@@ -138,19 +132,19 @@ where prp.id in %s''',(tuple(ids),))
p = tocompute.pop()
for i in range(3):
s[i] += progress.get(p, (0.0, 0.0, 0.0))[i]
uom_obj = self.pool.get('product.uom')
uom_obj = self.pool.get('product.uom')
user_uom, def_uom = self._get_user_and_default_uom_ids(cr, uid)
if user_uom != def_uom:
s[0] = uom_obj._compute_qty(cr, uid, user_uom, s[0], def_uom)
s[1] = uom_obj._compute_qty(cr, uid, user_uom, s[1], def_uom)
s[2] = uom_obj._compute_qty(cr, uid, user_uom, s[2], def_uom)
if project.state == 'close':
progress_rate = 100.0
else:
progress_rate = s[1] and round(min(100.0 * s[2] / s[1], 99.99), 2)
res[project.id] = {
'planned_hours': s[0],
'effective_hours': s[2],
@@ -164,7 +158,7 @@ where prp.id in %s''',(tuple(ids),))
if proj.tasks:
raise osv.except_osv(_('Operation Not Permitted !'), _('You can not delete a project with tasks. I suggest you to deactivate it.'))
return super(project, self).unlink(cr, uid, ids, *args, **kwargs)
_columns = {
'complete_name': fields.function(_complete_name, method=True, string="Project Name", type='char', size=250),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the project without removing it."),
@@ -253,21 +247,20 @@ where prp.id in %s''',(tuple(ids),))
default['name'] = proj.name+_(' (copy)')
res = super(project, self).copy(cr, uid, id, default, context)
task_ids = task_obj.search(cr, uid, [('project_id','=', res), ('active','=',True)])
tasks = task_obj.browse(cr, uid, task_ids)
for task in tasks:
date_deadline = None
if task.date_start:
ds = date(*time.strptime(task.date_start,'%Y-%m-%d %H:%M:%S')[:3])
if task.date_deadline:
dd = date(*time.strptime(task.date_deadline,'%Y-%m-%d')[:3])
diff = dd-ds
date_deadline = (datetime.now()+diff).strftime('%Y-%m-%d %H:%M:%S')
task_obj.write(cr, uid, task.id, {'active':True,
'date_start': False,
'date_end': False,
'date_deadline':date_deadline,
})
# task_ids = task_obj.search(cr, uid, [('project_id','=', res), ('active','=',True)])
# tasks = task_obj.browse(cr, uid, task_ids)
# for task in tasks:
# date_deadline = None
# if task.date_start:
# ds = date(*time.strptime(task.date_start,'%Y-%m-%d %H:%M:%S')[:3])
# if task.date_deadline:
# dd = date(*time.strptime(task.date_deadline,'%Y-%m-%d')[:3])
# diff = dd-ds
# date_deadline = (datetime.now()+diff).strftime('%Y-%m-%d %H:%M:%S')
# task_obj.write(cr, uid, task.id, {'date_start': False,
# 'date_end': False,
# 'date_deadline':date_deadline,
# })
return res
@@ -335,28 +328,29 @@ class task(osv.osv):
_description = "Task"
_log_create = True
_date_name = "date_start"
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False):
obj_project = self.pool.get('project.project')
for domain in args:
if domain[0] == 'project_id' and (not isinstance(domain[2], str)):
id = isinstance(domain[2], list) and int(domain[2][0]) or int(domain[2])
if id:
if self.pool.get('project.project').read(cr, user, id, ['state'])['state'] == 'template':
args.append(['active', '=', False])
id = isinstance(domain[2], list) and domain[2][0] or domain[2]
if id and isinstance(id, (long, int)):
if obj_project.read(cr, user, id, ['state'])['state'] == 'template':
args.append(('active', '=', False))
return super(task, self).search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count)
def _str_get(self, task, level=0, border='***', context=None):
return border+' '+(task.user_id and task.user_id.name.upper() or '')+(level and (': L'+str(level)) or '')+(' - %.1fh / %.1fh'%(task.effective_hours or 0.0,task.planned_hours))+' '+border+'\n'+ \
border[0]+' '+(task.name or '')+'\n'+ \
(task.description or '')+'\n\n'
# Compute: effective_hours, total_hours, progress
def _hours_get(self, cr, uid, ids, field_names, args, context=None):
project_obj = self.pool.get('project.project')
res = {}
cr.execute("SELECT task_id, COALESCE(SUM(hours),0) FROM project_task_work WHERE task_id IN %s GROUP BY task_id",(tuple(ids),))
hours = dict(cr.fetchall())
uom_obj = self.pool.get('product.uom')
user_uom, default_uom = project_obj._get_user_and_default_uom_ids(cr, uid)
if user_uom != default_uom:
@@ -364,7 +358,7 @@ class task(osv.osv):
if hours.get(task.id, False):
dur_in_user_uom = uom_obj._compute_qty(cr, uid, default_uom, hours.get(task.id, 0.0), user_uom)
hours[task.id] = dur_in_user_uom
for task in self.browse(cr, uid, ids, context=context):
res[task.id] = {'effective_hours': hours.get(task.id, 0.0), 'total_hours': task.remaining_hours + hours.get(task.id, 0.0)}
res[task.id]['delay_hours'] = res[task.id]['total_hours'] - task.planned_hours
@@ -412,7 +406,7 @@ class task(osv.osv):
if task.project_id.active == False or task.project_id.state == 'template':
res[task.id] = False
return res
_columns = {
'active': fields.function(_is_template, method=True, store=True, string='Not a Template Task', type='boolean', help="This field is computed automatically and have the same behavior than the boolean 'active' field: if the task is linked to a template or unactivated project, it will be hidden unless specifically asked."),
'name': fields.char('Task Summary', size=128, required=True),
@@ -460,7 +454,7 @@ class task(osv.osv):
_order = "sequence, priority, date_start, id"
_constraints = [
(_check_dates, 'Error! task start-date must be lower then task end-date.', ['date_start', 'date_end'])
(_check_dates, 'Error! Task start-date must be lower then task end-date.', ['date_start', 'date_end'])
]
#
# Override view according to the company definition
@@ -492,7 +486,6 @@ class task(osv.osv):
for f in res['fields']:
if 'Hours' in res['fields'][f]['string']:
res['fields'][f]['string'] = res['fields'][f]['string'].replace('Hours',tm)
return res
def do_close(self, cr, uid, ids, *args):
@@ -601,7 +594,6 @@ class task(osv.osv):
self.write(cr, uid, ids, {'state': 'draft'})
return True
def do_pending(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {'state': 'pending'})
for (id, name) in self.name_get(cr, uid, ids):
@@ -635,7 +627,7 @@ task()
class project_work(osv.osv):
_name = "project.task.work"
_description = "Task Work"
_description = "Project Task Work"
_columns = {
'name': fields.char('Work summary', size=128),
'date': fields.datetime('Date'),
@@ -651,34 +643,36 @@ class project_work(osv.osv):
}
_order = "date desc"
def create(self, cr, uid, vals, *args, **kwargs):
if (not 'task_id' in vals) or (not 'hours' in vals):
return super(project_work,self).create(cr, uid, vals, *args, **kwargs)
if not vals['hours']:
vals['hours'] = 0.00
project_obj = self.pool.get('project.project')
uom_obj = self.pool.get('product.uom')
if (not 'task_id' in vals) or (not 'hours' in vals):
return super(project_work, self).create(cr, uid, vals, *args, **kwargs)
if not vals['hours']:
vals['hours'] = 0.00
user_uom, default_uom = project_obj._get_user_and_default_uom_ids(cr, uid)
duration = vals['hours']
if user_uom != default_uom:
duration = uom_obj._compute_qty(cr, uid, default_uom, duration, user_uom)
cr.execute('update project_task set remaining_hours=remaining_hours - %s where id=%s', (duration, vals['task_id']))
return super(project_work,self).create(cr, uid, vals, *args, **kwargs)
def write(self, cr, uid, ids, vals, context=None):
project_obj = self.pool.get('project.project')
uom_obj = self.pool.get('product.uom')
if context is None:
context = {}
if not vals['hours']:
vals['hours'] = 0.00
project_obj = self.pool.get('project.project')
uom_obj = self.pool.get('product.uom')
user_uom, default_uom = project_obj._get_user_and_default_uom_ids(cr, uid)
vals['hours'] = 0.00
user_uom, default_uom = project_obj._get_user_and_default_uom_ids(cr, uid)
duration = vals['hours']
if user_uom == default_uom:
for work in self.browse(cr, uid, ids, context):
cr.execute('update project_task set remaining_hours=remaining_hours - %s + (%s) where id=%s', (duration, work.hours, work.task_id.id))
@@ -687,14 +681,14 @@ class project_work(osv.osv):
duration = uom_obj._compute_qty(cr, uid, default_uom, duration, user_uom)
del_work = uom_obj._compute_qty(cr, uid, default_uom, work.hours, user_uom)
cr.execute('update project_task set remaining_hours=remaining_hours - %s + (%s) where id=%s', (duration, del_work, work.task_id.id))
return super(project_work,self).write(cr, uid, ids, vals, context)
def unlink(self, cr, uid, ids, *args, **kwargs):
context = kwargs.get('context', {})
project_obj = self.pool.get('project.project')
user_uom, default_uom = project_obj._get_user_and_default_uom_ids(cr, uid)
user_uom, default_uom = project_obj._get_user_and_default_uom_ids(cr, uid)
if user_uom == default_uom:
for work in self.browse(cr, uid, ids, context):
cr.execute('update project_task set remaining_hours=remaining_hours + %s where id=%s', (work.hours, work.task_id.id))
@@ -709,64 +703,54 @@ project_work()
class config_compute_remaining(osv.osv_memory):
_name='config.compute.remaining'
def _get_remaining(self,cr, uid, ctx):
task_obj = self.pool.get('project.task')
if 'active_id' in ctx:
return task_obj.browse(cr, uid, ctx['active_id'], context=ctx).remaining_hours
def _get_remaining(self,cr, uid, context=None):
if context and 'active_id' in context:
return self.pool.get('project.task').browse(cr, uid, context['active_id'], context=context).remaining_hours
return False
_columns = {
'remaining_hours' : fields.float('Remaining Hours', digits=(16,2), help="Put here the remaining hours required to close the task."),
}
def _get_analytic_account(self, cr, uid, context={}):
if context.get('account_id', False):
return context.get('account_id')
return False
_defaults = {
'account_id' : _get_analytic_account,
}
_defaults = {
'remaining_hours': _get_remaining
}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
users_obj = self.pool.get('res.users')
obj_tm = users_obj.browse(cr, uid, uid, context).company_id.project_time_mode_id
tm = obj_tm and obj_tm.name or 'Hours'
res = super(config_compute_remaining, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar, submenu=submenu)
if tm in ['Hours','Hour']:
return res
eview = etree.fromstring(res['arch'])
def _check_rec(eview):
if eview.attrib.get('widget','') == 'float_time':
eview.set('widget','float')
for child in eview:
_check_rec(child)
return True
_check_rec(eview)
res['arch'] = etree.tostring(eview)
for f in res['fields']:
if 'Hours' in res['fields'][f]['string']:
res['fields'][f]['string'] = res['fields'][f]['string'].replace('Hours',tm)
return res
def compute_hours(self, cr, uid, ids, context=None):
if context is None:
context = {}
task_obj = self.pool.get('project.task')
request = self.pool.get('res.request')
if 'active_id' in context:
remaining_hrs=self.browse(cr,uid,ids)[0].remaining_hours
remaining_hrs = self.browse(cr,uid,ids)[0].remaining_hours
task_obj.write(cr,uid,context['active_id'],{'remaining_hours':remaining_hrs})
if context.get('button_reactivate', False):
tasks = task_obj.browse(cr, uid, [context['active_id']], context=context)
@@ -786,7 +770,7 @@ class config_compute_remaining(osv.osv_memory):
return {
'type': 'ir.actions.act_window_close',
}
config_compute_remaining()
class message(osv.osv):
-1
View File
@@ -535,7 +535,6 @@ class purchase_order(osv.osv):
'fiscal_position': porder.fiscal_position and porder.fiscal_position.id or False,
})
else:
#order_infos['name'] += ', %s' % porder.name
if porder.notes:
order_infos['notes'] = (order_infos['notes'] or '') + ('\n%s' % (porder.notes,))
if porder.origin:
+1 -1
View File
@@ -1,7 +1,7 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# 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
@@ -2,7 +2,7 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
@@ -23,8 +23,6 @@
import time
from osv import fields,osv
from osv import orm
import netsvc
from tools.translate import _
class purchase_requisition(osv.osv):
@@ -23,9 +23,6 @@ import time
from mx import DateTime
from osv import fields, osv
from service import web_services
import netsvc
import pooler
from osv.orm import browse_record, browse_null
class purchase_requisition_partner(osv.osv_memory):
+73
View File
@@ -0,0 +1,73 @@
# Estonian 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.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2010-06-28 09:21+0000\n"
"PO-Revision-Date: 2010-08-05 08:10+0000\n"
"Last-Translator: lyyser <logard.1961@gmail.com>\n"
"Language-Team: Estonian <et@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-08-06 03:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: sale_mrp
#: help:mrp.production,sale_ref:0
msgid "Indicate the Customer Reference from sale order."
msgstr ""
#. module: sale_mrp
#: help:mrp.production,sale_name:0
msgid "Indicate the name of sale order."
msgstr ""
#. module: sale_mrp
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "Vigane XML vaate arhitektuurile!"
#. module: sale_mrp
#: constraint:ir.model:0
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
"Objekti nimi peab algama x_'ga ja ei tohi sisaldada ühtegi erisümbolit !"
#. module: sale_mrp
#: field:mrp.production,sale_name:0
msgid "Sale Name"
msgstr ""
#. module: sale_mrp
#: model:ir.model,name:sale_mrp.model_mrp_production
msgid "Manufacturing Order"
msgstr ""
#. module: sale_mrp
#: model:ir.module.module,description:sale_mrp.module_meta_information
msgid ""
"\n"
" This module provides facility to the user to install mrp and sale "
"modules\n"
" at a time. It is basically used when we want to keep track of "
"production\n"
" orders generated from sale orders.\n"
" It adds sale name and sale Reference on production order\n"
" "
msgstr ""
#. module: sale_mrp
#: field:mrp.production,sale_ref:0
msgid "Sale Reference"
msgstr ""
#. module: sale_mrp
#: model:ir.module.module,shortdesc:sale_mrp.module_meta_information
msgid "Sales and MRP Management"
msgstr ""
+4 -5
View File
@@ -276,12 +276,11 @@
<font color="white"> </font>
</para>
</section>
<para style="terp_default_5cm_Above_Space">[[ (move_lines.state == 'done' or move_lines.state == 'confirmed') and removeParentNode('para') ]]</para>
<para style="terp_default_Bold_9">Non Assigned Products: [[ ( move_lines.state == 'assigned' or move_lines.state == 'done' or move_lines.state == 'confirmed' ) and removeParentNode('para') ]]</para>
<para style="terp_default_1cm_above_space">[[ (move_lines.state == 'done' or move_lines.state == 'confirmed') and removeParentNode('para') ]]</para>
<section>
<para style="terp_default_8">[[ repeatIn([line for line in picking.move_lines if (line.state != 'assigned' )],'move_lines') ]]</para>
<para style="terp_default_Bold_9">[[ ([line for line in picking.move_lines if (line.state == 'draft' )]) and 'Non Assigned Products:' or removeParentNode('para') ]]</para>
<section>
<blockTable colWidths="197.0,68.0,61.0,57,46.0,26.0,74.0" style="Move_Line_Content_Other_State">
<para style="terp_default_8">[[ repeatIn([line for line in picking.move_lines if (line.state != 'assigned' )],'move_lines') ]]</para>
<tr>
<td>
<para style="terp_default_9">[ [[ move_lines.product_id.default_code ]] ] [[ move_lines.product_id.name ]] [[ move_lines.product_id.variants or '']]</para>
-3
View File
@@ -24,9 +24,6 @@ from tools.translate import _
import tools
from tools.sql import drop_view_if_exists
#
# Check if it works with UoM ???
#
class stock_report_prodlots(osv.osv):
_name = "stock.report.prodlots"
_description = "Stock report by production lots"
+1 -1
View File
@@ -24,7 +24,7 @@ import time
from report.misc import choice_colors
#
# dRAw a graph for stocks
# Draw a graph for stocks
#
class stock_graph(object):
def __init__(self, io):
@@ -20,13 +20,7 @@
##############################################################################
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 wizard
class stock_inventory_merge(osv.osv_memory):
_name = "stock.inventory.merge"
+2 -8
View File
@@ -186,8 +186,7 @@ class stock_partial_move(osv.osv_memory):
res['move%s_product_qty'%(m.id)] = m.product_qty
if 'move%s_product_uom'%(m.id) in fields:
res['move%s_product_uom'%(m.id)] = m.product_uom.id
if (m.picking_id.type == 'out') and (m.product_id.cost_method == 'average'):
if (m.picking_id.type == 'out') and (m.product_id.cost_method == 'average') and 'sale_id' in m.picking_id._columns.keys():
price = 0
if hasattr(m, 'sale_line_id') and m.sale_line_id:
price = m.sale_line_id.price_unit
@@ -201,7 +200,7 @@ class stock_partial_move(osv.osv_memory):
if 'move%s_product_currency'%(m.id) in fields:
res['move%s_product_currency'%(m.id)] = currency
if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average'):
if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average') and 'purchase_id' in m.picking_id._columns.keys():
price = 0
if hasattr(m, 'purchase_line_id') and m.purchase_line_id:
price = m.purchase_line_id.price_unit
@@ -227,11 +226,6 @@ class stock_partial_move(osv.osv_memory):
"""
rec_id = context and context.get('active_id', False)
#tracking_lot = context.get('tracking_lot', False)
#if tracking_lot:
# tracking = self.pool.get('stock.tracking')
# tracking_lot = tracking.get_create_tracking_lot(cr, uid,[rec_id], tracking_lot)
# context ['tracking_lot'] = tracking_lot
move_obj = self.pool.get('stock.move')
move_ids = context.get('active_ids', False)
partial = self.browse(cr, uid, ids[0], context)