Framework Agreement
framework_agreement · OCA/purchase-workflow
Health
70/100
fair
-
Security25/25No findings
-
Activity0/25Last human commit 102 months ago
-
Required by20/253 modules depend on it
-
Maturity25/25In 4 Odoo series since 7.0
Heuristic over the facts below, not an audit · How it's computed
Required by
3
Modules depending on it
External deps
0 pip · 0 bin
Python packages / system binaries
License
AGPL-3
No conflicts with its dependencies
Folder size
0.09 MB
Module directory on disk
Code analysis
16 migration notes
9 models
11 views
0 HTTP endpoints
Migration considerations
Portfolio— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · sourcePurchaseOrder— Migrating to 13.0: `@api.multi`/`@api.one` were removed (multi is the default): drop them, looping over `self` where `@api.one` was used. (1 methods) (2 occurrences in this file) migration-api-multi-one · sourceadd_onchange_on_pruchase_order_form— Migrating to 17.0: `attrs=`/`states=` are rejected in views: convert them to Python expressions in `invisible`/`readonly`/`required`, keeping the original AND/OR logic. migration-view-attrs-states · sourceagreement in product view— Migrating to 17.0: `attrs=`/`states=` are rejected in views: convert them to Python expressions in `invisible`/`readonly`/`required`, keeping the original AND/OR logic. migration-view-attrs-states · sourceframework_agreement— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · sourceframework_agreement— Migrating to 13.0: `@api.multi`/`@api.one` were removed (multi is the default): drop them, looping over `self` where `@api.one` was used. (8 methods) migration-api-multi-one · sourceframework_agreement_form_view— Migrating to 17.0: `attrs=`/`states=` are rejected in views: convert them to Python expressions in `invisible`/`readonly`/`required`, keeping the original AND/OR logic. (2 occurrences in this file) migration-view-attrs-states · sourceframework_agreement_list_view— Migrating to 18.0: the `tree` view type was renamed to `list` (`<list>` roots, `view_mode`). migration-view-tree-tag · sourceportfolio_tree_view— Migrating to 18.0: the `tree` view type was renamed to `list` (`<list>` roots, `view_mode`). migration-view-tree-tag · sourceproduct_pricelist— Class 'product_pricelist' still inherits from the old-style `orm.Model` API: rewrite it against `models.Model`/`models.TransientModel`/`models.AbstractModel` - the old `osv`/`orm` API was removed entirely in modern Odoo. migration-old-api-base · source- Since 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp.tools`) (2 occurrences in this file) migration-openerp-import · source
- Since 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp`) (2 occurrences in this file) migration-openerp-import · source
- Since 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp`) migration-openerp-import · source
- Since 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp`) migration-openerp-import · source
- Since 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp`) migration-openerp-import · source
- Since 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp`) (4 occurrences in this file) migration-openerp-import · source
Migration review checklist, not a compatibility verdict. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
Description
Dependencies
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- framework_agreement_requisition, framework_agreement_sourcing, ngo_purchase
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 11
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
add agreement setting on company |
add agreement setting on company | res.company | form | Inherits base.view_company_form |
add_onchange_on_pruchase_order_form |
purchase_order_form | purchase.order | form | Inherits purchase.purchase_order_form |
add_onchange_on_pruchase_order_line_form_standalone |
purchase_order_line_form | purchase.order.line | form | Inherits purchase.purchase_order_line_form |
agreement in product view |
agreement in product view | product.product | form | Inherits product.product_normal_form_view |
agreement_in_portfolio_form_view |
agreement_in_portfolio_form_view | framework.agreement | form | New |
framework_agreement_form_view |
framework agreement form | framework.agreement | form | New |
framework_agreement_list_view |
framework agreement list view | framework.agreement | tree | New |
framework_agreement_search_view |
framework_agreement_search_view | framework.agreement | search | New |
portfolio_form_view |
portfolio_form_view | framework.agreement.portfolio | form | New |
portfolio_search_view |
portfolio_search_view | framework.agreement.portfolio | search | New |
portfolio_tree_view |
portfolio_tree_view | framework.agreement.portfolio | tree | New |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 9
New fields (21)
-
available_quantityIntegercompute='_get_available_qty'default=0readonly=Truestore=Truestring='Available quantity' -
clausesHtmlargs: 'Clauses' -
company_idMany2one → res.companyreadonly=Truerelated='portfolio_id.company_id' args: 'res.company', 'Company' -
delayIntegerargs: 'Lead time in days' -
delivery_remarkTextargs: 'Delivery Remarks' -
draftBooleanargs: 'Is draft' -
end_dateDateargs: 'End of Agreement' -
framework_agreement_pricelist_idsOne2many → framework.agreement.pricelistargs: 'framework.agreement.pricelist', 'framework_agreement_id', 'Price lists' -
incoterm_addressCharargs: 'Incoterm Address' -
incoterm_idMany2one → stock.incotermshelp='International Commercial Terms are a series of predefined commercial terms used in international transactions.' args: 'stock.incoterms', 'Incoterm' -
nameCharreadonly=True args: 'Number' -
originCharargs: 'Origin' -
payment_term_idMany2one → account.payment.termargs: 'account.payment.term', 'Payment Term' -
portfolio_idMany2one → framework.agreement.portfoliorequired=True args: 'framework.agreement.portfolio', 'Portfolio' -
product_idMany2one → product.productrequired=True args: 'product.product', 'Product' -
purchase_line_idsOne2many → purchase.order.linecomodel_name='purchase.order.line'inverse_name='framework_agreement_id' -
quantityIntegerrequired=True args: 'Negociated quantity' -
shipment_origin_idMany2one → res.partnerargs: 'res.partner', 'Shipment Origin' -
start_dateDateargs: 'Begin of Agreement' -
stateSelectioncompute='_get_state'search='_search_state'selection=[('draft', 'Draft'), ('future', 'Future'), ('running', 'Running'), ('consumed', 'Consumed'), ('closed', 'Closed')]string='State' -
supplier_idMany2one → res.partnerreadonly=Truerelated='portfolio_id.supplier_id' args: 'res.partner', 'Supplier'
-
check_overlap(self)@api.one@api.constrains('supplier_id', 'product_id', 'start_date', 'end_date', 'company_id', 'incoterm_id', 'incoterm_address')Check that there are no similar agreements at the same time. Depending on the one_agreement_per_product flag on the company, agreements from different companies are tolerated or not. -
create(self, vals)@api.model@api.returns('self', <expr>)We want to have increment sequence only at creation When set by a default in a o2m form default consume sequence. But we do not want to use no_gap sequence -
get_agreement_domain(self, product_id, qty, portfolio_id=None, date_planned=None, incoterm_id=None, incoterm_address=None)@api.model -
get_all_product_agreements(self, product_id, lookup_dt, qty=None)@api.modelGet the all the active agreement of a given product at a given date :param product_id: product id of the product :param lookup_dt: date string of the lookup date :param qty: quantity that should be available if parameter is passed and qty is insuffisant no agreement would be returned :returns: a list of corresponding agreements or None -
get_cheapest_agreement_for_qty(self, product_id, date, qty, currency=None)@api.modelReturn the cheapest agreement that has enough available qty. If not enough quantity fallback on the cheapest agreement available for quantity. :param product_id: id of the product :param date: lookup date :param qty: lookup qty :param currency: currency record to make price convertion :return: cheapest agreement and qty state :rtype: namedtuple('Cheapest', ['cheapest_agreement', 'enough']) -
get_price(self, qty=0, currency=None)@api.multiReturn price negociated for quantity :param currency: currency record :param qty: qty to lookup :returns: price float -
get_product_agreement(self, product_id, supplier_id, lookup_dt, qty=None)@api.modelGet the matching agreement for a given product/supplier at date :param product_id: id of the product :param supplier_id: supplier to look for agreement :param lookup_dt: date string of the lookup date :param qty: quantity that should be available if parameter is passed and qty is insuffisant no aggrement would be returned :returns: a corresponding agreement or None -
has_currency(self, currency)@api.multiPredicate that check that agreement has a given currency pricelist :returns: boolean (True if a price list in given currency is present) -
open_agreement(self, strict=True)@api.multiOpen agreement Agreement goes from state draft to X
New fields (3)
-
framework_agreement_pricelist_idMany2one → framework.agreement.pricelistrequired=True args: 'framework.agreement.pricelist', 'Price list' -
priceFloatdigits=dp.get_precision('Product Price')required=Truestring='Negociated price' -
quantityIntegerrequired=True args: 'Quantity'
No public methods.
New fields (4)
-
agreement_idsOne2many → framework.agreementargs: 'framework.agreement', 'portfolio_id', 'Agreements' -
company_idMany2one → res.companydefault=_company_get args: 'res.company', 'Company' -
nameCharrequired=True args: 'Name' -
supplier_idMany2one → res.partnerrequired=True args: 'res.partner', 'Supplier'
-
get_from_supplier(self, supplier)@api.returns('self')@api.model
New fields (3)
-
currency_idMany2one → res.currencyrequired=True args: 'res.currency', 'Currency' -
framework_agreement_idMany2one → framework.agreementrequired=True args: 'framework.agreement', 'Agreement' -
framework_agreement_line_idsOne2many → framework.agreement.linerequired=True args: 'framework.agreement.line', 'framework_agreement_pricelist_id', 'Price lines'
No public methods.
New fields (0)
No new fields.
Public methods (1)-
price_get(self, cr, uid, ids, prod_id, qty, partner=None, context=None)Override of price retrieval function in order to support framework agreement. If it is a supplier price list, agreement will be taken in account and use the price of the agreement if required. If there is not enough available qty on agreement, standard price will be used. This is maybe a faulty design and we should use on_change override
New fields (1)
-
framework_agreement_idsOne2many → framework.agreementcomodel_name='framework.agreement'copy=Falseinverse_name='product_id'string='Framework Agreements (LTA)'
No public methods.
New fields (1)
-
portfolio_idMany2one → framework.agreement.portfoliodomain="[('supplier_id', '=', partner_id)]" args: 'framework.agreement.portfolio', 'Portfolio'
-
onchange_partner_id(self, partner_id)@api.multiPrevent changes to the supplier if the portfolio is set. We use web_context_tunnel in order to keep the original signature. -
update_agreements_in_lines(self)@api.onchange('portfolio_id', 'pricelist_id', 'date_order', 'incoterm_id') -
update_currency_from_pricelist(self)@api.onchange('pricelist_id')Reproduce the old_api onchange_pricelist from the purchase module. We need new-style onchanges to be able to modify agreements on order lines, and we cannot have new-style and old-style onchanges at the same time.
New fields (2)
-
framework_agreement_idMany2one → framework.agreementdomain=[('portfolio_id', '=', 'order_id.portfolio_id')] args: 'framework.agreement', 'Agreement' -
portfolio_idMany2one → framework.agreement.portfolioreadonly=Truerelated='order_id.portfolio_id' args: 'framework.agreement.portfolio', 'Portfolio'
-
onchange_agreement(self)@api.onchange('framework_agreement_id') -
onchange_price_unit(self)@api.onchange('price_unit') -
onchange_product_id(self, pricelist_id, product_id, qty, uom_id, partner_id, date_order=False, fiscal_position_id=False, date_planned=False, name=False, price_unit=False, state='draft')@api.multi
New fields (1)
-
one_agreement_per_productBooleanhelp='If checked you can have only one framework agreement per product at the same time.' args: 'One agreement per product'
No public methods.
Loading…
Loading…
Loading…