[IMP] Improve code for blocking point in sale, purchase, warehouse, accounting, mrp, project

bzr revid: jap@tinyerp.com-20120430091138-n37zmlrl48qyx20r
This commit is contained in:
Jagdish Panchal (Open ERP) 2012-04-30 14:41:38 +05:30
parent 7dbf665c5d
commit 7584c565c2
12 changed files with 30 additions and 26 deletions

View File

@ -38,7 +38,8 @@ class account_config_settings(osv.osv_memory):
'has_default_company': fields.boolean('Has default company', readonly=True),
'expects_chart_of_accounts': fields.related('company_id', 'expects_chart_of_accounts', type='boolean',
string='Chart of Accounts for this Company'),
string='Chart of Accounts for this Company',
help=""" Check this box if this company is a legal entity."""),
'currency_id': fields.related('company_id', 'currency_id', type='many2one', relation='res.currency', required=True,
string='Default Company Currency', help="Default Company Currency of the company."),
'paypal_account': fields.related('company_id', 'paypal_account', type='char', size=128,
@ -78,8 +79,7 @@ class account_config_settings(osv.osv_memory):
help="""This allows you to check writing and printing.
This installs the module account_check_writing."""),
'module_account_accountant': fields.boolean('Accountant Features',
help="""This allows you to access all the accounting features, like the journal items and the chart of accounts.
This installs the module account_accountant."""),
help="""If you do not check this box, you will be able to do Invoicing & Payments, but not accounting (Journal Items, Chart of Accounts, ...)."""),
'module_account_asset': fields.boolean('Assets Management',
help="""This allows you to manage the assets owned by a company or a person.
It keeps track of the depreciation occurred on those assets, and creates account move for those depreciation lines.

View File

@ -22,11 +22,11 @@
</div>
<sheet layout="auto">
<field name="has_default_company" invisible="1" />
<field name="has_chart_of_accounts" invisible="1"/>
<field name="company_id" widget="selection" on_change="onchange_company_id(company_id)"
attrs="{'invisible': [('has_default_company', '=', True)]}"/>
<field name="expects_chart_of_accounts"/>
<field name="has_chart_of_accounts" invisible="1"/>
<group string="No Chart of Accounts exists for this Company" colspan="4" attrs="{'invisible': ['|', ('expects_chart_of_accounts','=',False), ('has_chart_of_accounts','=',True)]}">
<label string="Please select a chart template to install a chart of accounts." colspan="4"/>
<field name="chart_template_id" widget="selection" on_change="onchange_chart_template_id(chart_template_id)" domain="[('visible','=', True)]"/>

View File

@ -41,7 +41,7 @@ class mrp_config_settings(osv.osv_memory):
* Repair quotation report
* Notes for the technician and for the final customer.
This installs the module mrp_repair."""),
'module_mrp_operations': fields.boolean("Track Dates in Work Order Operations",
'module_mrp_operations': fields.boolean("Detailed Planning of Work Orders",
help="""This allows to add state, date_start,date_stop in production order operation lines (in the "Work Centers" tab).
This installs the module mrp_operations."""),
'module_mrp_subproduct': fields.boolean("Produce Several Product from One Production",

View File

@ -165,7 +165,7 @@ class project(osv.osv):
'members': fields.many2many('res.users', 'project_user_rel', 'project_id', 'uid', 'Project Members',
help="Project's members are users who can have an access to the tasks related to this project.", states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}),
'tasks': fields.one2many('project.task', 'project_id', "Project tasks"),
'tasks': fields.one2many('project.task', 'project_id', "Task Activities"),
'planned_hours': fields.function(_progress_rate, multi="progress", string='Planned Time', help="Sum of planned hours of all tasks related to this project and its child projects.",
store = {
'project.project': (_get_project_and_parents, ['tasks', 'parent_id', 'child_ids'], 10),

View File

@ -204,6 +204,7 @@ class purchase_order(osv.osv):
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position'),
'product_id': fields.related('order_line','product_id', type='many2one', relation='product.product', string='Product'),
'create_uid': fields.many2one('res.users', 'Responsible'),
'decimal_precision': fields.many2one('decimal.precision', 'Decimal Precision on Purchase Price'),
'company_id': fields.many2one('res.company','Company',required=True,select=1),
}
_defaults = {

View File

@ -145,6 +145,7 @@
<page string="Purchase Order">
<field name="partner_id" on_change="onchange_partner_id(partner_id)" context="{'search_default_supplier':1,'default_supplier':1,'default_customer':0}" options='{"quick_create": false}'/>
<field domain="[('type','=','purchase')]" name="pricelist_id" groups="product.group_purchase_pricelist"/>
<field name="decimal_precision"/>
<field name="origin"/>
<newline/>
<field colspan="4" name="order_line" nolabel="1" mode="tree,form">

View File

@ -7,8 +7,8 @@
<field name="type">form</field>
<field name="inherit_id" ref="purchase.view_purchase_configuration"/>
<field name="arch" type="xml">
<field name="module_purchase_double_validation" position="replace">
<field name="limit_amount"/>
<field name="module_purchase_double_validation" position="after">
<field name="limit_amount" attrs="{'required': [('module_purchase_double_validation','=',True)]}"/>
</field>
</field>
</record>

View File

@ -269,6 +269,7 @@ class sale_order(osv.osv):
'invoice_quantity': fields.selection([('order', 'Ordered Quantities'), ('procurement', 'Shipped Quantities')], 'Invoice on', help="The sale order will automatically create the invoice proposition (draft invoice). Ordered and delivered quantities may not be the same. You have to choose if you want your invoice based on ordered or shipped quantities. If the product is a service, shipped quantities means hours spent on the associated tasks.", required=True, readonly=True, states={'draft': [('readonly', False)]}),
'payment_term': fields.many2one('account.payment.term', 'Payment Term'),
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position'),
'decimal_precision': fields.many2one('decimal.precision', 'Decimal Precision on Sales Price'),
'company_id': fields.related('shop_id','company_id',type='many2one',relation='res.company',string='Company',store=True,readonly=True)
}
_defaults = {

View File

@ -133,6 +133,7 @@
<notebook colspan="5">
<page string="Sales Order">
<field name="partner_id" on_change="onchange_partner_id(partner_id)" domain="[('customer','=',True)]" context="{'search_default_customer':1}" required="1"/>
<field name="decimal_precision"/>
<field domain="[('parent_id','=',partner_id)]" name="partner_invoice_id" groups="sale.group_delivery_invoice_address" options='{"quick_create": false}'/>
<field domain="[('parent_id','=',partner_id)]" name="partner_shipping_id" groups="sale.group_delivery_invoice_address" options='{"quick_create": false}'/>
<field domain="[('type','=','sale')]" name="pricelist_id" groups="product.group_sale_pricelist" on_change="onchange_pricelist_id(pricelist_id,order_line)"/>

View File

@ -82,13 +82,13 @@ stock_report_prodlots()
class stock_report_tracklots(osv.osv):
_name = "stock.report.tracklots"
_description = "Stock report by tracking lots"
_description = "Stock report by Logistic Serial Number"
_auto = False
_columns = {
'name': fields.float('Quantity', readonly=True),
'location_id': fields.many2one('stock.location', 'Location', readonly=True, select=True),
'product_id': fields.many2one('product.product', 'Product', readonly=True, select=True),
'tracking_id': fields.many2one('stock.tracking', 'Tracking lot', readonly=True, select=True),
'tracking_id': fields.many2one('stock.tracking', 'Logistic Serial Number', readonly=True, select=True),
}
def init(self, cr):

View File

@ -19,7 +19,7 @@
</record>
<record id="group_tracking_lot" model="res.groups">
<field name="name">Manage Tracking lots</field>
<field name="name">Manage Logistic Serial Number</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>

View File

@ -756,10 +756,10 @@
<field name="product_packaging" groups="product.group_stock_packaging" domain="[('product_id','=',product_id)]" colspan="4"/>
</group>
<group colspan="2" col="2">
<group colspan="2" col="2" groups="stock.group_locations">
<separator string="Locations" colspan="2" />
<field name="location_id" domain="[('usage','&lt;&gt;','view')]" />
<field name="location_dest_id" domain="[('usage','=','internal')]" />
<field name="location_id" domain="[('usage','&lt;&gt;','view')]"/>
<field name="location_dest_id" domain="[('usage','=','internal')]"/>
</group>
<group colspan="2" col="2">
@ -945,10 +945,10 @@
<field name="product_packaging" groups="product.group_stock_packaging" domain="[('product_id','=',product_id)]" colspan="4" />
</group>
<group colspan="2" col="2">
<group colspan="2" col="2" groups="stock.group_locations">
<separator string="Locations" colspan="2" />
<field name="location_id" domain="[('usage','=','internal')]" />
<field name="location_dest_id" domain="[('usage','&lt;&gt;','view')]" />
<field name="location_id" domain="[('usage','=','internal')]"/>
<field name="location_dest_id" domain="[('usage','&lt;&gt;','view')]"/>
</group>
<group colspan="2" col="2">
@ -1162,10 +1162,10 @@
<field name="product_packaging" groups="product.group_stock_packaging" domain="[('product_id','=',product_id)]" colspan="4"/>
</group>
<group colspan="2" col="2">
<group colspan="2" col="2" groups="stock.group_locations">
<separator string="Locations" colspan="2" />
<field name="location_id" domain="[('usage','&lt;&gt;','view')]" />
<field name="location_dest_id" domain="[('usage','=','internal')]" />
<field name="location_id" domain="[('usage','&lt;&gt;','view')]"/>
<field name="location_dest_id" domain="[('usage','=','internal')]"/>
</group>
<group colspan="2" col="2">
@ -1383,8 +1383,8 @@
groups="product.group_stock_packaging"
icon="terp-stock_effects-object-colorize"
states="draft,assigned,confirmed,done"/>
<field name="location_id"/>
<field name="location_dest_id"/>
<field name="location_id" groups="stock.group_locations"/>
<field name="location_dest_id" groups="stock.group_locations"/>
<field name="date" groups="base.group_no_one"/>
<field name="date_expected"/>
<field name="state"/>
@ -1411,8 +1411,8 @@
icon="gtk-convert" context="{'scrap': True}"
states="draft,waiting,confirmed,assigned" colspan="1"/>
<newline/>
<field name="location_id"/>
<field name="location_dest_id"/>
<field name="location_id" groups="stock.group_locations"/>
<field name="location_dest_id" groups="stock.group_locations"/>
<field name="partner_id" context="{'contact_display':'partner'}"/>
</group>
@ -1597,8 +1597,8 @@
icon="gtk-convert" context="{'scrap': True}"
states="draft,waiting,confirmed,assigned" colspan="1"/>
<newline/>
<field name="location_id"/>
<field name="location_dest_id"/>
<field name="location_id" groups="stock.group_locations"/>
<field name="location_dest_id" groups="stock.group_locations"/>
<field name="partner_id"/>
</group>