Compare commits
22 Commits
12.0-mig-p
...
12.0-fix-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
676011f868 | ||
|
|
44b19dfe60 | ||
|
|
c082baa340 | ||
|
|
15ee1b2f59 | ||
|
|
b080dd11ab | ||
|
|
568e6b41ac | ||
|
|
0dee23aeba | ||
|
|
c7d1e13d0d | ||
|
|
e7fae291ee | ||
|
|
bdfe0ce20a | ||
|
|
32eafedf04 | ||
|
|
ba78791ab1 | ||
|
|
946d169665 | ||
|
|
cd51a6784f | ||
|
|
c01942b1a8 | ||
|
|
e11b29deab | ||
|
|
28be3e4e6a | ||
|
|
5c7985a15c | ||
|
|
9b6c34a860 | ||
|
|
f735f8a34d | ||
|
|
74665bb2e8 | ||
|
|
d1deeeac31 |
@@ -83,7 +83,7 @@ class AccountInvoice(models.Model):
|
||||
# top of the screen
|
||||
# That's why we have to cut the name_get() when it's too long
|
||||
def name_get(self):
|
||||
old_res = super(AccountInvoice, self).name_get()
|
||||
old_res = super().name_get()
|
||||
res = []
|
||||
for old_re in old_res:
|
||||
name = old_re[1]
|
||||
@@ -103,9 +103,8 @@ class AccountInvoice(models.Model):
|
||||
# 2) the 'name' field of the account.move.line is used in the overdue
|
||||
# letter, and '/' is not meaningful for our customer !
|
||||
# TODO mig to v12
|
||||
# @api.multi
|
||||
# def action_move_create(self):
|
||||
# res = super(AccountInvoice, self).action_move_create()
|
||||
# res = super().action_move_create()
|
||||
# for inv in self:
|
||||
# self._cr.execute(
|
||||
# "UPDATE account_move_line SET name= "
|
||||
@@ -216,7 +215,15 @@ class AccountInvoiceLine(models.Model):
|
||||
class AccountJournal(models.Model):
|
||||
_inherit = 'account.journal'
|
||||
|
||||
@api.multi
|
||||
hide_bank_statement_balance = fields.Boolean(
|
||||
string='Hide Bank Statement Balance',
|
||||
help="You may want to enable this option when your bank "
|
||||
"journal is generated from a bank statement file that "
|
||||
"doesn't handle start/end balance (QIF for instance) and "
|
||||
"you don't want to enter the start/end balance manually: it "
|
||||
"will prevent the display of wrong information in the accounting "
|
||||
"dashboard and on bank statements.")
|
||||
|
||||
@api.depends(
|
||||
'name', 'currency_id', 'company_id', 'company_id.currency_id', 'code')
|
||||
def name_get(self):
|
||||
@@ -262,7 +269,6 @@ class AccountJournal(models.Model):
|
||||
class AccountAccount(models.Model):
|
||||
_inherit = 'account.account'
|
||||
|
||||
@api.multi
|
||||
@api.depends('name', 'code')
|
||||
def name_get(self):
|
||||
if self._context.get('account_account_show_code_only'):
|
||||
@@ -271,7 +277,7 @@ class AccountAccount(models.Model):
|
||||
res.append((record.id, record.code))
|
||||
return res
|
||||
else:
|
||||
return super(AccountAccount, self).name_get()
|
||||
return super().name_get()
|
||||
|
||||
# https://github.com/odoo/odoo/issues/23040
|
||||
# TODO mig to v12
|
||||
@@ -354,7 +360,6 @@ class AccountAccount(models.Model):
|
||||
class AccountAnalyticAccount(models.Model):
|
||||
_inherit = 'account.analytic.account'
|
||||
|
||||
@api.multi
|
||||
def name_get(self):
|
||||
if self._context.get('analytic_account_show_code_only'):
|
||||
res = []
|
||||
@@ -362,7 +367,7 @@ class AccountAnalyticAccount(models.Model):
|
||||
res.append((record.id, record.code or record.name))
|
||||
return res
|
||||
else:
|
||||
return super(AccountAnalyticAccount, self).name_get()
|
||||
return super().name_get()
|
||||
|
||||
_sql_constraints = [(
|
||||
'code_company_unique',
|
||||
@@ -509,8 +514,9 @@ class AccountBankStatement(models.Model):
|
||||
end_date = fields.Date(
|
||||
compute='_compute_dates', string='End Date', readonly=True,
|
||||
store=True)
|
||||
hide_bank_statement_balance = fields.Boolean(
|
||||
related='journal_id.hide_bank_statement_balance', readonly=True)
|
||||
|
||||
@api.multi
|
||||
@api.depends('line_ids.date')
|
||||
def _compute_dates(self):
|
||||
for st in self:
|
||||
@@ -518,7 +524,14 @@ class AccountBankStatement(models.Model):
|
||||
st.start_date = dates and min(dates) or False
|
||||
st.end_date = dates and max(dates) or False
|
||||
|
||||
@api.multi
|
||||
def _balance_check(self):
|
||||
for stmt in self:
|
||||
if stmt.hide_bank_statement_balance:
|
||||
continue
|
||||
else:
|
||||
super(AccountBankStatement, stmt)._balance_check()
|
||||
return True
|
||||
|
||||
@api.depends('name', 'start_date', 'end_date')
|
||||
def name_get(self):
|
||||
res = []
|
||||
@@ -556,15 +569,14 @@ class AccountBankStatementLine(models.Model):
|
||||
# search_reconciliation_proposition=False, context=None):
|
||||
# # Make variable name shorted for PEP8 !
|
||||
# search_rec_prop = search_reconciliation_proposition
|
||||
# return super(AccountBankStatementLine, self).\
|
||||
# return super().\
|
||||
# get_data_for_reconciliations(
|
||||
# cr, uid, ids, excluded_ids=excluded_ids,
|
||||
# search_reconciliation_proposition=search_rec_prop,
|
||||
# context=context)
|
||||
|
||||
def _prepare_reconciliation_move(self, move_ref):
|
||||
vals = super(AccountBankStatementLine, self).\
|
||||
_prepare_reconciliation_move(move_ref)
|
||||
vals = super()._prepare_reconciliation_move(move_ref)
|
||||
# By default, ref contains the name of the statement + name of the
|
||||
# statement line. It causes 2 problems:
|
||||
# 1) The 'ref' field is too big
|
||||
@@ -669,8 +681,7 @@ class AccountReconciliation(models.AbstractModel):
|
||||
# bank statement
|
||||
@api.model
|
||||
def _domain_move_lines(self, search_str):
|
||||
str_domain = super(AccountReconciliation, self)._domain_move_lines(
|
||||
search_str)
|
||||
str_domain = super()._domain_move_lines(search_str)
|
||||
account_code_domain = [('account_id.code', '=ilike', search_str + '%')]
|
||||
str_domain = expression.OR([str_domain, account_code_domain])
|
||||
return str_domain
|
||||
@@ -685,6 +696,15 @@ class AccountReconciliation(models.AbstractModel):
|
||||
# We want to replace a domain item by another one
|
||||
position = domain.index(('payment_id', '<>', False))
|
||||
domain[position] = ['journal_id', '=', st_line.journal_id.id]
|
||||
if ('payment_id', '<>', False) in domain:
|
||||
# True on official v12:
|
||||
# https://github.com/odoo/odoo/blob/12.0/addons/account/models/reconciliation_widget.py#L490
|
||||
position = domain.index(('payment_id', '<>', False))
|
||||
domain[position] = ['journal_id', '=', st_line.journal_id.id]
|
||||
else:
|
||||
# OCB which has backport fixes from v13
|
||||
# https://github.com/OCA/OCB/blob/12.0/addons/account/models/reconciliation_widget.py#L486
|
||||
domain = expression.AND([domain, [('journal_id', '=', st_line.journal_id.id)]])
|
||||
return domain
|
||||
|
||||
|
||||
|
||||
@@ -409,6 +409,31 @@ module -->
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_journal_form" model="ir.ui.view">
|
||||
<field name="name">usability.account.journal.form</field>
|
||||
<field name="model">account.journal</field>
|
||||
<field name="inherit_id" ref="account.view_account_journal_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="bank_statements_source" position="after">
|
||||
<field name="hide_bank_statement_balance" groups="account.group_account_user"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="account_journal_dashboard_kanban_view" model="ir.ui.view">
|
||||
<field name="name">usability.account.journal.dashboard</field>
|
||||
<field name="model">account.journal</field>
|
||||
<field name="inherit_id" ref="account.account_journal_dashboard_kanban_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="kanban_dashboard" position="after">
|
||||
<field name="hide_bank_statement_balance"/>
|
||||
</field>
|
||||
<xpath expr="//div[@name='latest_statement']/.." position="attributes">
|
||||
<attribute name="t-if">dashboard.last_balance != dashboard.account_balance && !record.hide_bank_statement_balance.raw_value</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_journal_tree" model="ir.ui.view">
|
||||
<field name="name">usability.account.journal.tree</field>
|
||||
<field name="model">account.journal</field>
|
||||
@@ -447,10 +472,26 @@ module -->
|
||||
<field name="date" position="after">
|
||||
<field name="start_date"/>
|
||||
<field name="end_date"/>
|
||||
<field name="hide_bank_statement_balance" invisible="1"/>
|
||||
</field>
|
||||
<field name="date" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
<label for="balance_start" position="attributes">
|
||||
<attribute name="attrs">{'invisible': [('hide_bank_statement_balance', '=', True)]}</attribute>
|
||||
</label>
|
||||
<label for="balance_end_real" position="attributes">
|
||||
<attribute name="attrs">{'invisible': [('hide_bank_statement_balance', '=', True)]}</attribute>
|
||||
</label>
|
||||
<xpath expr="//field[@name='balance_start']/.." position="attributes">
|
||||
<attribute name="attrs">{'invisible': [('hide_bank_statement_balance', '=', True)]}</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='balance_end_real']/.." position="attributes">
|
||||
<attribute name="attrs">{'invisible': [('hide_bank_statement_balance', '=', True)]}</attribute>
|
||||
</xpath>
|
||||
<group name="sale_total" position="attributes">
|
||||
<attribute name="attrs">{'invisible': [('hide_bank_statement_balance', '=', True)]}</attribute>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -12,10 +12,6 @@
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<!-- Wider 'name' field -->
|
||||
<xpath expr="//sheet/div[hasclass('oe_title')]" position="attributes">
|
||||
<attribute name="style">width: 650px;</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='child_ids']/form//field[@name='email']" position="attributes">
|
||||
<attribute name="widget">email</attribute>
|
||||
</xpath>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
<xpath expr="//field[@name='bom_line_ids']/tree/field[@name='product_uom_id']" position="after">
|
||||
<xpath expr="//field[@name='bom_line_ids']/tree/field[@name='operation_id']" position="after">
|
||||
<field name="standard_price"/>
|
||||
</xpath>
|
||||
</field>
|
||||
|
||||
@@ -17,7 +17,7 @@ MRP Usability
|
||||
:target: https://github.com/akretion/odoo-usability/tree/12.0/mrp_usability
|
||||
:alt: akretion/odoo-usability
|
||||
|
||||
|badge1| |badge2| |badge3|
|
||||
|badge1| |badge2| |badge3|
|
||||
|
||||
Small usability improvements on MRP:
|
||||
|
||||
@@ -31,6 +31,8 @@ Small usability improvements on MRP:
|
||||
|
||||
* complete Manufacturing Order report with unvailable products
|
||||
|
||||
* improve smart button from products to BoMs (display BoM form if only one instead of displaying a list of one)
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
|
||||
@@ -1 +1 @@
|
||||
from . import mrp
|
||||
from . import models
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['mrp'],
|
||||
'data': [
|
||||
'mrp_view.xml',
|
||||
'views/mrp_views.xml',
|
||||
'views/product_views.xml',
|
||||
'report/mrp_report.xml'
|
||||
],
|
||||
'installable': True,
|
||||
|
||||
2
mrp_usability/models/__init__.py
Normal file
2
mrp_usability/models/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
from . import mrp, product
|
||||
44
mrp_usability/models/product.py
Normal file
44
mrp_usability/models/product.py
Normal file
@@ -0,0 +1,44 @@
|
||||
# Copyright (C) 2020 - Akretion
|
||||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class ProductTemplate(models.Model):
|
||||
_inherit = "product.template"
|
||||
|
||||
def action_view_bom(self):
|
||||
"""Replace native action `template_open_bom` to distinguish if we will display
|
||||
only one BoM form or a list of BoMs."""
|
||||
self.ensure_one()
|
||||
|
||||
act_window_xml_id = "mrp.mrp_bom_form_action"
|
||||
act_window = self.env.ref(act_window_xml_id).read()[0]
|
||||
if self.bom_count > 1:
|
||||
act_window["context"] = {
|
||||
"default_product_tmpl_id": self.id,
|
||||
"search_default_product_tmpl_id": self.id,
|
||||
}
|
||||
else:
|
||||
act_window["context"] = {"default_product_tmpl_id": self.id}
|
||||
act_window["views"] = [(self.env.ref("mrp.mrp_bom_form_view").id, "form")]
|
||||
act_window["res_id"] = (
|
||||
self.env["mrp.bom"].search([("product_tmpl_id", "=", self.id)]).id
|
||||
)
|
||||
|
||||
return act_window
|
||||
|
||||
|
||||
class ProductProduct(models.Model):
|
||||
_inherit = "product.product"
|
||||
|
||||
def action_view_bom(self):
|
||||
res = super().action_view_bom()
|
||||
|
||||
bom_target_ids = self.env["mrp.bom"].search(res["domain"])
|
||||
|
||||
if len(bom_target_ids) == 1:
|
||||
res["views"] = [(self.env.ref("mrp.mrp_bom_form_view").id, "form")]
|
||||
res["res_id"] = bom_target_ids[0].id
|
||||
|
||||
return res
|
||||
@@ -9,3 +9,5 @@ Small usability improvements on MRP:
|
||||
* show bom type in tree view + add group by
|
||||
|
||||
* complete Manufacturing Order report with unvailable products
|
||||
|
||||
* improve smart button from products to BoMs (display BoM form if only one instead of displaying a list of one)
|
||||
|
||||
25
mrp_usability/views/product_views.xml
Normal file
25
mrp_usability/views/product_views.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0"?>
|
||||
<odoo>
|
||||
|
||||
<record id="product_template_form_view_bom_button" model="ir.ui.view">
|
||||
<field name="name">product.template.procurement</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="mrp.product_template_form_view_bom_button" />
|
||||
<field name="arch" type="xml">
|
||||
|
||||
<xpath expr="//field[@name='bom_count']/.." position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='bom_count']/.." position="after">
|
||||
<button class="oe_stat_button" name="action_view_bom" type="object"
|
||||
attrs="{'invisible':[('type', 'not in', ['product', 'consu'])]}"
|
||||
icon="fa-flask">
|
||||
<field string="Bill of Materials" name="bom_count"
|
||||
widget="statinfo" />
|
||||
</button>
|
||||
</xpath>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
1
service_line_qty_update_base/__init__.py
Normal file
1
service_line_qty_update_base/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import wizard
|
||||
18
service_line_qty_update_base/__manifest__.py
Normal file
18
service_line_qty_update_base/__manifest__.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Copyright 2020 Akretion France (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Service Line Qty Update Base',
|
||||
'version': '12.0.1.0.0',
|
||||
'category': 'Tools',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Update delivery qty on service lines - Base module',
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['product'],
|
||||
'data': [
|
||||
'wizard/service_qty_update_view.xml',
|
||||
],
|
||||
'installable': True,
|
||||
}
|
||||
1
service_line_qty_update_base/wizard/__init__.py
Normal file
1
service_line_qty_update_base/wizard/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import service_qty_update
|
||||
70
service_line_qty_update_base/wizard/service_qty_update.py
Normal file
70
service_line_qty_update_base/wizard/service_qty_update.py
Normal file
@@ -0,0 +1,70 @@
|
||||
# Copyright 2020 Akretion France (http://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.tools import float_compare, float_is_zero
|
||||
import odoo.addons.decimal_precision as dp
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class ServiceQtyUpdate(models.TransientModel):
|
||||
_name = 'service.qty.update'
|
||||
_description = 'Wizard to update delivery qty on service lines'
|
||||
|
||||
line_ids = fields.One2many('service.qty.update.line', 'parent_id', string="Lines")
|
||||
|
||||
def run(self):
|
||||
self.ensure_one()
|
||||
prec = self.env['decimal.precision'].precision_get('Product Unit of Measure')
|
||||
for line in self.line_ids:
|
||||
if float_compare(line.post_delivered_qty, line.order_qty, precision_digits=prec) > 0:
|
||||
raise UserError(_(
|
||||
"On line '%s', the total delivered qty (%s) is superior to the ordered qty (%s).") % (line.name, line.post_delivered_qty, line.order_qty))
|
||||
fc_added = float_compare(line.added_delivered_qty, 0, precision_digits=prec)
|
||||
if fc_added < 0:
|
||||
raise UserError(_(
|
||||
"On line '%s', the added quantity is negative.") % line.name)
|
||||
if fc_added > 0:
|
||||
line.process_line()
|
||||
return True
|
||||
|
||||
|
||||
class ServiceQtyUpdateLine(models.TransientModel):
|
||||
_name = 'service.qty.update.line'
|
||||
_description = 'Lines of the wizard that updates delivery qty on service lines'
|
||||
|
||||
parent_id = fields.Many2one(
|
||||
'service.qty.update', string='Wizard', ondelete='cascade')
|
||||
product_id = fields.Many2one('product.product', string='Product', readonly=True)
|
||||
name = fields.Char()
|
||||
name_readonly = fields.Char(related='name', string='Description')
|
||||
order_qty = fields.Float(
|
||||
string='Order Qty',
|
||||
digits=dp.get_precision('Product Unit of Measure'))
|
||||
order_qty_readonly = fields.Float(related='order_qty', string='Product Unit of Measure')
|
||||
pre_delivered_qty = fields.Float(
|
||||
digits=dp.get_precision('Product Unit of Measure'))
|
||||
pre_delivered_qty_readonly = fields.Float(related='pre_delivered_qty', string='Current Delivered Qty')
|
||||
added_delivered_qty = fields.Float(
|
||||
string='Added Delivered Qty',
|
||||
digits=dp.get_precision('Product Unit of Measure'))
|
||||
post_delivered_qty = fields.Float(
|
||||
compute='_compute_post_delivered_qty',
|
||||
string='Total Delivered Qty',
|
||||
digits=dp.get_precision('Product Unit of Measure'))
|
||||
uom_id = fields.Many2one('uom.uom', string='UoM', readonly=True)
|
||||
comment = fields.Char(string='Comment')
|
||||
|
||||
@api.depends('pre_delivered_qty', 'added_delivered_qty')
|
||||
def _compute_post_delivered_qty(self):
|
||||
for line in self:
|
||||
line.post_delivered_qty = line.pre_delivered_qty + line.added_delivered_qty
|
||||
|
||||
def process_line(self):
|
||||
# Write and message_post
|
||||
return
|
||||
|
||||
# sale : qty_delivered
|
||||
# purchase : qty_received
|
||||
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2020 Akretion France (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
|
||||
<record id="service_qty_update_form" model="ir.ui.view">
|
||||
<field name="model">service.qty.update</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<group name="main">
|
||||
<field name="line_ids" nolabel="1">
|
||||
<tree editable="bottom">
|
||||
<field name="product_id"/>
|
||||
<field name="name" invisible="0"/>
|
||||
<field name="name_readonly"/>
|
||||
<field name="order_qty" invisible="1"/>
|
||||
<field name="order_qty_readonly"/>
|
||||
<field name="pre_delivered_qty" invisible="1"/>
|
||||
<field name="pre_delivered_qty_readonly"/>
|
||||
<field name="added_delivered_qty"/>
|
||||
<field name="post_delivered_qty"/>
|
||||
<field name="uom_id" groups="uom.group_uom"/>
|
||||
<field name="comment"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
<footer>
|
||||
<button name="run" type="object" string="Validate" class="btn-primary"/>
|
||||
<button special="cancel" string="Cancel" class="btn-default"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="service_qty_update_action" model="ir.actions.act_window">
|
||||
<field name="name">Service Order Lines - Update Delivered Qty</field>
|
||||
<field name="res_model">service.qty.update</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
2
service_line_qty_update_purchase/__init__.py
Normal file
2
service_line_qty_update_purchase/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from . import models
|
||||
from . import wizard
|
||||
22
service_line_qty_update_purchase/__manifest__.py
Normal file
22
service_line_qty_update_purchase/__manifest__.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# Copyright 2020 Akretion France (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Service Line Qty Update Purchase',
|
||||
'version': '12.0.1.0.0',
|
||||
'category': 'Tools',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Update delivery qty on service lines - Purchase module',
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': [
|
||||
'purchase',
|
||||
'service_line_qty_update_base',
|
||||
'purchase_reception_status',
|
||||
],
|
||||
'data': [
|
||||
'views/purchase_order.xml',
|
||||
],
|
||||
'installable': True,
|
||||
}
|
||||
1
service_line_qty_update_purchase/models/__init__.py
Normal file
1
service_line_qty_update_purchase/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import purchase_order
|
||||
21
service_line_qty_update_purchase/models/purchase_order.py
Normal file
21
service_line_qty_update_purchase/models/purchase_order.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# Copyright 2020 Akretion France (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class PurchaseOrder(models.Model):
|
||||
_inherit = 'purchase.order'
|
||||
|
||||
has_service = fields.Boolean(compute='_compute_has_service')
|
||||
|
||||
@api.depends('order_line.product_id.type')
|
||||
def _compute_has_service(self):
|
||||
for order in self:
|
||||
has_service = False
|
||||
for l in order.order_line:
|
||||
if l.product_id.type == 'service':
|
||||
has_service = True
|
||||
break
|
||||
order.has_service = has_service
|
||||
27
service_line_qty_update_purchase/views/purchase_order.xml
Normal file
27
service_line_qty_update_purchase/views/purchase_order.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2020 Akretion France (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
|
||||
<record id="purchase_order_form" model="ir.ui.view">
|
||||
<field name="name">purchase.order.form</field>
|
||||
<field name="model">purchase.order</field>
|
||||
<field name="inherit_id" ref="purchase.purchase_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_view_invoice" position="after">
|
||||
<button name="%(service_line_qty_update_base.service_qty_update_action)d" type="action" string="Update Service Qty" attrs="{'invisible': ['|', '|', ('state', 'not in', ('purchase', 'done')), ('has_service', '=', False), ('reception_status', '=', 'received')]}" groups="purchase.group_purchase_user"/>
|
||||
<field name="has_service" invisible="1"/>
|
||||
</button>
|
||||
<xpath expr="//field[@name='order_line']/tree/field[@name='qty_received']" position="attributes">
|
||||
<attribute name="readonly">1</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
1
service_line_qty_update_purchase/wizard/__init__.py
Normal file
1
service_line_qty_update_purchase/wizard/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import service_qty_update
|
||||
@@ -0,0 +1,62 @@
|
||||
# Copyright 2020 Akretion France (http://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.tools import float_compare
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class ServiceQtyUpdate(models.TransientModel):
|
||||
_inherit = 'service.qty.update'
|
||||
|
||||
@api.model
|
||||
def default_get(self, fields_list):
|
||||
res = super().default_get(fields_list)
|
||||
prec = self.env['decimal.precision'].precision_get('Product Unit of Measure')
|
||||
if self._context.get('active_model') == 'purchase.order' and self._context.get('active_id'):
|
||||
lines = []
|
||||
order = self.env['purchase.order'].browse(self._context['active_id'])
|
||||
for l in order.order_line.filtered(lambda x: x.product_id.type == 'service'):
|
||||
if float_compare(l.product_qty, l.qty_received, precision_digits=prec) > 0:
|
||||
lines.append((0, 0, {
|
||||
'purchase_line_id': l.id,
|
||||
'product_id': l.product_id.id,
|
||||
'name': l.name,
|
||||
'name_readonly': l.name,
|
||||
'order_qty': l.product_qty,
|
||||
'order_qty_readonly': l.product_qty,
|
||||
'pre_delivered_qty': l.qty_received,
|
||||
'pre_delivered_qty_readonly': l.qty_received,
|
||||
'uom_id': l.product_uom.id,
|
||||
}))
|
||||
if lines:
|
||||
res['line_ids'] = lines
|
||||
else:
|
||||
raise UserError(_(
|
||||
"All service lines are fully received."))
|
||||
return res
|
||||
|
||||
|
||||
class ServiceQtyUpdateLine(models.TransientModel):
|
||||
_inherit = 'service.qty.update.line'
|
||||
|
||||
purchase_line_id = fields.Many2one('purchase.order.line', string='Purchase Line', readonly=True)
|
||||
|
||||
def process_line(self):
|
||||
po_line = self.purchase_line_id
|
||||
if po_line:
|
||||
new_qty = po_line.qty_received + self.added_delivered_qty
|
||||
po_line.write({'qty_received': new_qty})
|
||||
body = """
|
||||
<p>Received qty updated on service line <b>%s</b>:
|
||||
<ul>
|
||||
<li>Added received qty: <b>%s</b></li>
|
||||
<li>Total received qty: %s</li>
|
||||
</ul></p>
|
||||
""" % (self.name, self.added_delivered_qty, new_qty)
|
||||
if self.comment:
|
||||
body += '<p>Comment: %s</p>' % self.comment
|
||||
po_line.order_id.message_post(body=body)
|
||||
return super().process_line()
|
||||
2
service_line_qty_update_sale/__init__.py
Normal file
2
service_line_qty_update_sale/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from . import models
|
||||
from . import wizard
|
||||
22
service_line_qty_update_sale/__manifest__.py
Normal file
22
service_line_qty_update_sale/__manifest__.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# Copyright 2020 Akretion France (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Service Line Qty Update Sale',
|
||||
'version': '12.0.1.0.0',
|
||||
'category': 'Tools',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Update delivery qty on service lines - Sale module',
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': [
|
||||
'sale',
|
||||
'service_line_qty_update_base',
|
||||
# 'purchase_reception_status',
|
||||
],
|
||||
'data': [
|
||||
'views/sale_order.xml',
|
||||
],
|
||||
'installable': True,
|
||||
}
|
||||
1
service_line_qty_update_sale/models/__init__.py
Normal file
1
service_line_qty_update_sale/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import sale_order
|
||||
21
service_line_qty_update_sale/models/sale_order.py
Normal file
21
service_line_qty_update_sale/models/sale_order.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# Copyright 2020 Akretion France (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class SaleOrder(models.Model):
|
||||
_inherit = 'sale.order'
|
||||
|
||||
has_service = fields.Boolean(compute='_compute_has_service')
|
||||
|
||||
@api.depends('order_line.product_id.type')
|
||||
def _compute_has_service(self):
|
||||
for order in self:
|
||||
has_service = False
|
||||
for l in order.order_line:
|
||||
if l.product_id.type == 'service':
|
||||
has_service = True
|
||||
break
|
||||
order.has_service = has_service
|
||||
26
service_line_qty_update_sale/views/sale_order.xml
Normal file
26
service_line_qty_update_sale/views/sale_order.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2020 Akretion France (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
|
||||
<record id="view_order_form" model="ir.ui.view">
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_quotation_send" position="after">
|
||||
<button name="%(service_line_qty_update_base.service_qty_update_action)d" type="action" string="Update Service Qty" attrs="{'invisible': ['|', ('state', 'not in', ('sale', 'done')), ('has_service', '=', False)]}" groups="sales_team.group_sale_salesman"/>
|
||||
<field name="has_service" invisible="1"/>
|
||||
</button>
|
||||
<xpath expr="//field[@name='order_line']/tree/field[@name='qty_delivered']" position="attributes">
|
||||
<attribute name="readonly">1</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
1
service_line_qty_update_sale/wizard/__init__.py
Normal file
1
service_line_qty_update_sale/wizard/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import service_qty_update
|
||||
62
service_line_qty_update_sale/wizard/service_qty_update.py
Normal file
62
service_line_qty_update_sale/wizard/service_qty_update.py
Normal file
@@ -0,0 +1,62 @@
|
||||
# Copyright 2020 Akretion France (http://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.tools import float_compare
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class ServiceQtyUpdate(models.TransientModel):
|
||||
_inherit = 'service.qty.update'
|
||||
|
||||
@api.model
|
||||
def default_get(self, fields_list):
|
||||
res = super().default_get(fields_list)
|
||||
prec = self.env['decimal.precision'].precision_get('Product Unit of Measure')
|
||||
if self._context.get('active_model') == 'sale.order' and self._context.get('active_id'):
|
||||
lines = []
|
||||
order = self.env['sale.order'].browse(self._context['active_id'])
|
||||
for l in order.order_line.filtered(lambda x: x.product_id.type == 'service'):
|
||||
if float_compare(l.product_qty, l.qty_delivered, precision_digits=prec) > 0:
|
||||
lines.append((0, 0, {
|
||||
'sale_line_id': l.id,
|
||||
'product_id': l.product_id.id,
|
||||
'name': l.name,
|
||||
'name_readonly': l.name,
|
||||
'order_qty': l.product_uom_qty,
|
||||
'order_qty_readonly': l.product_uom_qty,
|
||||
'pre_delivered_qty': l.qty_delivered,
|
||||
'pre_delivered_qty_readonly': l.qty_delivered,
|
||||
'uom_id': l.product_uom.id,
|
||||
}))
|
||||
if lines:
|
||||
res['line_ids'] = lines
|
||||
else:
|
||||
raise UserError(_(
|
||||
"All service lines are fully delivered."))
|
||||
return res
|
||||
|
||||
|
||||
class ServiceQtyUpdateLine(models.TransientModel):
|
||||
_inherit = 'service.qty.update.line'
|
||||
|
||||
sale_line_id = fields.Many2one('sale.order.line', string='Sale Line', readonly=True)
|
||||
|
||||
def process_line(self):
|
||||
so_line = self.sale_line_id
|
||||
if so_line:
|
||||
new_qty = so_line.qty_delivered + self.added_delivered_qty
|
||||
so_line.write({'qty_delivered': new_qty})
|
||||
body = """
|
||||
<p>Delivered qty updated on service line <b>%s</b>:
|
||||
<ul>
|
||||
<li>Added delivered qty: <b>%s</b></li>
|
||||
<li>Total delivered qty: %s</li>
|
||||
</ul></p>
|
||||
""" % (self.name, self.added_delivered_qty, new_qty)
|
||||
if self.comment:
|
||||
body += '<p>Comment: %s</p>' % self.comment
|
||||
so_line.order_id.message_post(body=body)
|
||||
return super().process_line()
|
||||
64
stock_user_default_warehouse_base/README.rst
Normal file
64
stock_user_default_warehouse_base/README.rst
Normal file
@@ -0,0 +1,64 @@
|
||||
===============================
|
||||
Default Stock Warehouse on User
|
||||
===============================
|
||||
|
||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||
:target: https://odoo-community.org/page/development-status
|
||||
:alt: Beta
|
||||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github
|
||||
:target: https://github.com/akretion/odoo-usability/tree/12.0/stock_user_default_warehouse_base
|
||||
:alt: akretion/odoo-usability
|
||||
|
||||
|badge1| |badge2| |badge3|
|
||||
|
||||
With this module, you will be able to configure a default warehouse in the preferences of the user.
|
||||
|
||||
This module doesn't do anything by itself. It should be used together with at least one of the following modules:
|
||||
|
||||
* stock_user_default_warehouse_sale
|
||||
* stock_user_default_warehouse_purchase
|
||||
* stock_user_default_warehouse_mrp
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20stock_user_default_warehouse_base%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
|
||||
Do not contact contributors directly about support or help with technical issues.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Authors
|
||||
~~~~~~~
|
||||
|
||||
* Akretion
|
||||
|
||||
Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
* Daniel Luque <dev@actgrupo.com>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/12.0/stock_user_default_warehouse_base>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute.
|
||||
6
stock_user_default_warehouse_base/__init__.py
Normal file
6
stock_user_default_warehouse_base/__init__.py
Normal file
@@ -0,0 +1,6 @@
|
||||
# © 2017 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import models
|
||||
from . import wizard
|
||||
18
stock_user_default_warehouse_base/__manifest__.py
Normal file
18
stock_user_default_warehouse_base/__manifest__.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# © 2017 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Default Stock Warehouse on User',
|
||||
'version': '12.0.1.0.0',
|
||||
'category': 'Inventory, Logistics, Warehousing',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Configure a default warehouse on user',
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['stock'],
|
||||
'data': [
|
||||
'views/users_view.xml',
|
||||
],
|
||||
'installable': True,
|
||||
}
|
||||
37
stock_user_default_warehouse_base/i18n/es.po
Normal file
37
stock_user_default_warehouse_base/i18n/es.po
Normal file
@@ -0,0 +1,37 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * stock_user_default_warehouse_base
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 12.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-05-19 10:02+0000\n"
|
||||
"PO-Revision-Date: 2020-05-19 10:02+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: stock_user_default_warehouse_base
|
||||
#: model:ir.model,name:stock_user_default_warehouse_base.model_stock_change_product_qty
|
||||
msgid "Change Product Quantity"
|
||||
msgstr "Cambiar cantidad de producto"
|
||||
|
||||
#. module: stock_user_default_warehouse_base
|
||||
#: model:ir.model.fields,field_description:stock_user_default_warehouse_base.field_res_users__context_default_warehouse_id
|
||||
msgid "Default Warehouse"
|
||||
msgstr "Almacén por defecto"
|
||||
|
||||
#. module: stock_user_default_warehouse_base
|
||||
#: model:ir.model.fields,help:stock_user_default_warehouse_base.field_res_users__context_default_warehouse_id
|
||||
msgid "Default warehouse for sale orders (if the module stock_user_default_warehouse_sale is installed), purchase orders (if the module stock_user_default_warehouse_purchase is installed) and production orders (if the module stock_user_default_warehouse_mrp is installed)."
|
||||
msgstr "Almacén por defecto para los pedidos de venta (si el módulo stock_user_default_warehouse_sale esta instalado), pedidos de compra (si el módulo stock_user_default_warehouse_purchase esta instalado) y pedidos de producción (si el módulo stock_user_default_warehouse_mrp esta instalado)."
|
||||
|
||||
#. module: stock_user_default_warehouse_base
|
||||
#: model:ir.model,name:stock_user_default_warehouse_base.model_res_users
|
||||
msgid "Users"
|
||||
msgstr "Usuarios"
|
||||
|
||||
5
stock_user_default_warehouse_base/models/__init__.py
Normal file
5
stock_user_default_warehouse_base/models/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# © 2017 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import res_users
|
||||
20
stock_user_default_warehouse_base/models/res_users.py
Normal file
20
stock_user_default_warehouse_base/models/res_users.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# © 2017 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class ResUsers(models.Model):
|
||||
_inherit = 'res.users'
|
||||
|
||||
context_default_warehouse_id = fields.Many2one(
|
||||
'stock.warehouse',
|
||||
string='Default Warehouse',
|
||||
company_dependent=True,
|
||||
help="Default warehouse for sale orders (if the module "
|
||||
"stock_user_default_warehouse_sale is installed), purchase orders "
|
||||
"(if the module stock_user_default_warehouse_purchase is installed) "
|
||||
"and production orders "
|
||||
"(if the module stock_user_default_warehouse_mrp is installed)."
|
||||
)
|
||||
@@ -0,0 +1,2 @@
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
* Daniel Luque <dev@actgrupo.com>
|
||||
7
stock_user_default_warehouse_base/readme/DESCRIPTION.rst
Normal file
7
stock_user_default_warehouse_base/readme/DESCRIPTION.rst
Normal file
@@ -0,0 +1,7 @@
|
||||
With this module, you will be able to configure a default warehouse in the preferences of the user.
|
||||
|
||||
This module doesn't do anything by itself. It should be used together with at least one of the following modules:
|
||||
|
||||
* stock_user_default_warehouse_sale
|
||||
* stock_user_default_warehouse_purchase
|
||||
* stock_user_default_warehouse_mrp
|
||||
BIN
stock_user_default_warehouse_base/static/description/icon.png
Normal file
BIN
stock_user_default_warehouse_base/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.5 KiB |
421
stock_user_default_warehouse_base/static/description/index.html
Normal file
421
stock_user_default_warehouse_base/static/description/index.html
Normal file
@@ -0,0 +1,421 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<title>Default Stock Warehouse on User</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
|
||||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
*/
|
||||
|
||||
/* used to remove borders from tables and images */
|
||||
.borderless, table.borderless td, table.borderless th {
|
||||
border: 0 }
|
||||
|
||||
table.borderless td, table.borderless th {
|
||||
/* Override padding for "table.docutils td" with "! important".
|
||||
The right padding separates the table cells. */
|
||||
padding: 0 0.5em 0 0 ! important }
|
||||
|
||||
.first {
|
||||
/* Override more specific margin styles with "! important". */
|
||||
margin-top: 0 ! important }
|
||||
|
||||
.last, .with-subtitle {
|
||||
margin-bottom: 0 ! important }
|
||||
|
||||
.hidden {
|
||||
display: none }
|
||||
|
||||
.subscript {
|
||||
vertical-align: sub;
|
||||
font-size: smaller }
|
||||
|
||||
.superscript {
|
||||
vertical-align: super;
|
||||
font-size: smaller }
|
||||
|
||||
a.toc-backref {
|
||||
text-decoration: none ;
|
||||
color: black }
|
||||
|
||||
blockquote.epigraph {
|
||||
margin: 2em 5em ; }
|
||||
|
||||
dl.docutils dd {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
||||
dl.docutils dt {
|
||||
font-weight: bold }
|
||||
*/
|
||||
|
||||
div.abstract {
|
||||
margin: 2em 5em }
|
||||
|
||||
div.abstract p.topic-title {
|
||||
font-weight: bold ;
|
||||
text-align: center }
|
||||
|
||||
div.admonition, div.attention, div.caution, div.danger, div.error,
|
||||
div.hint, div.important, div.note, div.tip, div.warning {
|
||||
margin: 2em ;
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.admonition p.admonition-title, div.hint p.admonition-title,
|
||||
div.important p.admonition-title, div.note p.admonition-title,
|
||||
div.tip p.admonition-title {
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
div.attention p.admonition-title, div.caution p.admonition-title,
|
||||
div.danger p.admonition-title, div.error p.admonition-title,
|
||||
div.warning p.admonition-title, .code .error {
|
||||
color: red ;
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
/* Uncomment (and remove this text!) to get reduced vertical space in
|
||||
compound paragraphs.
|
||||
div.compound .compound-first, div.compound .compound-middle {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
div.compound .compound-last, div.compound .compound-middle {
|
||||
margin-top: 0.5em }
|
||||
*/
|
||||
|
||||
div.dedication {
|
||||
margin: 2em 5em ;
|
||||
text-align: center ;
|
||||
font-style: italic }
|
||||
|
||||
div.dedication p.topic-title {
|
||||
font-weight: bold ;
|
||||
font-style: normal }
|
||||
|
||||
div.figure {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
div.footer, div.header {
|
||||
clear: both;
|
||||
font-size: smaller }
|
||||
|
||||
div.line-block {
|
||||
display: block ;
|
||||
margin-top: 1em ;
|
||||
margin-bottom: 1em }
|
||||
|
||||
div.line-block div.line-block {
|
||||
margin-top: 0 ;
|
||||
margin-bottom: 0 ;
|
||||
margin-left: 1.5em }
|
||||
|
||||
div.sidebar {
|
||||
margin: 0 0 0.5em 1em ;
|
||||
border: medium outset ;
|
||||
padding: 1em ;
|
||||
background-color: #ffffee ;
|
||||
width: 40% ;
|
||||
float: right ;
|
||||
clear: right }
|
||||
|
||||
div.sidebar p.rubric {
|
||||
font-family: sans-serif ;
|
||||
font-size: medium }
|
||||
|
||||
div.system-messages {
|
||||
margin: 5em }
|
||||
|
||||
div.system-messages h1 {
|
||||
color: red }
|
||||
|
||||
div.system-message {
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.system-message p.system-message-title {
|
||||
color: red ;
|
||||
font-weight: bold }
|
||||
|
||||
div.topic {
|
||||
margin: 2em }
|
||||
|
||||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
||||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
||||
margin-top: 0.4em }
|
||||
|
||||
h1.title {
|
||||
text-align: center }
|
||||
|
||||
h2.subtitle {
|
||||
text-align: center }
|
||||
|
||||
hr.docutils {
|
||||
width: 75% }
|
||||
|
||||
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
||||
clear: left ;
|
||||
float: left ;
|
||||
margin-right: 1em }
|
||||
|
||||
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
||||
clear: right ;
|
||||
float: right ;
|
||||
margin-left: 1em }
|
||||
|
||||
img.align-center, .figure.align-center, object.align-center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.align-center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left }
|
||||
|
||||
.align-center {
|
||||
clear: both ;
|
||||
text-align: center }
|
||||
|
||||
.align-right {
|
||||
text-align: right }
|
||||
|
||||
/* reset inner alignment in figures */
|
||||
div.align-right {
|
||||
text-align: inherit }
|
||||
|
||||
/* div.align-center * { */
|
||||
/* text-align: left } */
|
||||
|
||||
.align-top {
|
||||
vertical-align: top }
|
||||
|
||||
.align-middle {
|
||||
vertical-align: middle }
|
||||
|
||||
.align-bottom {
|
||||
vertical-align: bottom }
|
||||
|
||||
ol.simple, ul.simple {
|
||||
margin-bottom: 1em }
|
||||
|
||||
ol.arabic {
|
||||
list-style: decimal }
|
||||
|
||||
ol.loweralpha {
|
||||
list-style: lower-alpha }
|
||||
|
||||
ol.upperalpha {
|
||||
list-style: upper-alpha }
|
||||
|
||||
ol.lowerroman {
|
||||
list-style: lower-roman }
|
||||
|
||||
ol.upperroman {
|
||||
list-style: upper-roman }
|
||||
|
||||
p.attribution {
|
||||
text-align: right ;
|
||||
margin-left: 50% }
|
||||
|
||||
p.caption {
|
||||
font-style: italic }
|
||||
|
||||
p.credits {
|
||||
font-style: italic ;
|
||||
font-size: smaller }
|
||||
|
||||
p.label {
|
||||
white-space: nowrap }
|
||||
|
||||
p.rubric {
|
||||
font-weight: bold ;
|
||||
font-size: larger ;
|
||||
color: maroon ;
|
||||
text-align: center }
|
||||
|
||||
p.sidebar-title {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold ;
|
||||
font-size: larger }
|
||||
|
||||
p.sidebar-subtitle {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
p.topic-title {
|
||||
font-weight: bold }
|
||||
|
||||
pre.address {
|
||||
margin-bottom: 0 ;
|
||||
margin-top: 0 ;
|
||||
font: inherit }
|
||||
|
||||
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: grey; } /* line numbers */
|
||||
pre.code, code { background-color: #eeeeee }
|
||||
pre.code .comment, code .comment { color: #5C6576 }
|
||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
||||
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
||||
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
||||
pre.code .inserted, code .inserted { background-color: #A3D289}
|
||||
|
||||
span.classifier {
|
||||
font-family: sans-serif ;
|
||||
font-style: oblique }
|
||||
|
||||
span.classifier-delimiter {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
span.interpreted {
|
||||
font-family: sans-serif }
|
||||
|
||||
span.option {
|
||||
white-space: nowrap }
|
||||
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
/* font-size relative to parent (h1..h6 element) */
|
||||
font-size: 80% }
|
||||
|
||||
table.citation {
|
||||
border-left: solid 1px gray;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docinfo {
|
||||
margin: 2em 4em }
|
||||
|
||||
table.docutils {
|
||||
margin-top: 0.5em ;
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
table.footnote {
|
||||
border-left: solid 1px black;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docutils td, table.docutils th,
|
||||
table.docinfo td, table.docinfo th {
|
||||
padding-left: 0.5em ;
|
||||
padding-right: 0.5em ;
|
||||
vertical-align: top }
|
||||
|
||||
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
||||
font-weight: bold ;
|
||||
text-align: left ;
|
||||
white-space: nowrap ;
|
||||
padding-left: 0 }
|
||||
|
||||
/* "booktabs" style (no vertical lines) */
|
||||
table.docutils.booktabs {
|
||||
border: 0px;
|
||||
border-top: 2px solid;
|
||||
border-bottom: 2px solid;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.docutils.booktabs * {
|
||||
border: 0px;
|
||||
}
|
||||
table.docutils.booktabs th {
|
||||
border-bottom: thin solid;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
||||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
||||
font-size: 100% }
|
||||
|
||||
ul.auto-toc {
|
||||
list-style-type: none }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="default-stock-warehouse-on-user">
|
||||
<h1 class="title">Default Stock Warehouse on User</h1>
|
||||
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/stock_user_default_warehouse_base"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github" /></a></p>
|
||||
<p>With this module, you will be able to configure a default warehouse in the preferences of the user.</p>
|
||||
<p>This module doesn’t do anything by itself. It should be used together with at least one of the following modules:</p>
|
||||
<ul class="simple">
|
||||
<li>stock_user_default_warehouse_sale</li>
|
||||
<li>stock_user_default_warehouse_purchase</li>
|
||||
<li>stock_user_default_warehouse_mrp</li>
|
||||
</ul>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/akretion/odoo-usability/issues">GitHub Issues</a>.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20stock_user_default_warehouse_base%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#id2">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#id3">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Akretion</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#id4">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Alexis de Lattre <<a class="reference external" href="mailto:alexis.delattre@akretion.com">alexis.delattre@akretion.com</a>></li>
|
||||
<li>Daniel Luque <<a class="reference external" href="mailto:dev@actgrupo.com">dev@actgrupo.com</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/stock_user_default_warehouse_base">akretion/odoo-usability</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
28
stock_user_default_warehouse_base/views/users_view.xml
Normal file
28
stock_user_default_warehouse_base/views/users_view.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
|
||||
<record id="view_users_form" model="ir.ui.view">
|
||||
<field name="name">default_stock_warehouse.res.users.form</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="inherit_id" ref="base.view_users_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="preferences" position="inside">
|
||||
<field name="context_default_warehouse_id"/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_users_form_simple_modif" model="ir.ui.view">
|
||||
<field name="name">default_stock_warehouse.preferences.res.users.form</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="inherit_id" ref="base.view_users_form_simple_modif"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="preferences" position="inside">
|
||||
<field name="context_default_warehouse_id" readonly="0"/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
5
stock_user_default_warehouse_base/wizard/__init__.py
Normal file
5
stock_user_default_warehouse_base/wizard/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# © 2017 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import stock_change_product_qty
|
||||
@@ -0,0 +1,17 @@
|
||||
# © 2017 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, api
|
||||
|
||||
|
||||
class StockChangeProductQty(models.TransientModel):
|
||||
_inherit = 'stock.change.product.qty'
|
||||
|
||||
@api.model
|
||||
def default_get(self, fields_list):
|
||||
res = super().default_get(fields_list)
|
||||
if self.env.user.context_default_warehouse_id:
|
||||
res['location_id'] = self.env.user.context_default_warehouse_id.\
|
||||
lot_stock_id.id
|
||||
return res
|
||||
58
stock_user_default_warehouse_mrp/README.rst
Normal file
58
stock_user_default_warehouse_mrp/README.rst
Normal file
@@ -0,0 +1,58 @@
|
||||
===============================
|
||||
Default Warehouse on User (MRP)
|
||||
===============================
|
||||
|
||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||
:target: https://odoo-community.org/page/development-status
|
||||
:alt: Beta
|
||||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github
|
||||
:target: https://github.com/akretion/odoo-usability/tree/12.0/stock_user_default_warehouse_mrp
|
||||
:alt: akretion/odoo-usability
|
||||
|
||||
|badge1| |badge2| |badge3|
|
||||
|
||||
The default warehouse configured in the preferences of the user will be used by default on manufacturing orders.
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20stock_user_default_warehouse_mrp%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
|
||||
Do not contact contributors directly about support or help with technical issues.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Authors
|
||||
~~~~~~~
|
||||
|
||||
* Akretion
|
||||
|
||||
Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
* Daniel Luque <dev@actgrupo.com>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/12.0/stock_user_default_warehouse_mrp>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute.
|
||||
5
stock_user_default_warehouse_mrp/__init__.py
Normal file
5
stock_user_default_warehouse_mrp/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# Copyright 2018 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import models
|
||||
15
stock_user_default_warehouse_mrp/__manifest__.py
Normal file
15
stock_user_default_warehouse_mrp/__manifest__.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# Copyright 2018 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Default Warehouse on User (MRP)',
|
||||
'version': '12.0.1.0.0',
|
||||
'category': 'Manufacturing',
|
||||
'license': 'AGPL-3',
|
||||
'summary': "Use the users's default warehouse on manufacturing orders",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['mrp', 'stock_user_default_warehouse_base'],
|
||||
'installable': True,
|
||||
}
|
||||
5
stock_user_default_warehouse_mrp/models/__init__.py
Normal file
5
stock_user_default_warehouse_mrp/models/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# Copyright 2018 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import mrp
|
||||
19
stock_user_default_warehouse_mrp/models/mrp.py
Normal file
19
stock_user_default_warehouse_mrp/models/mrp.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Copyright 2018 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, fields, api
|
||||
|
||||
|
||||
class MrpProduction(models.Model):
|
||||
_inherit = 'mrp.production'
|
||||
|
||||
@api.model
|
||||
def _default_pref_picking_type(self):
|
||||
manu_type = self.env.user.context_default_warehouse_id.manu_type_id
|
||||
return manu_type.id if manu_type else self._get_default_picking_type()
|
||||
|
||||
# No need to inherit the default value of location_src_id and
|
||||
# location_dest_id because it is immediately over-ridden
|
||||
# by the onchange of picking_type_id
|
||||
picking_type_id = fields.Many2one(default=_default_pref_picking_type)
|
||||
2
stock_user_default_warehouse_mrp/readme/CONTRIBUTORS.rst
Normal file
2
stock_user_default_warehouse_mrp/readme/CONTRIBUTORS.rst
Normal file
@@ -0,0 +1,2 @@
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
* Daniel Luque <dev@actgrupo.com>
|
||||
1
stock_user_default_warehouse_mrp/readme/DESCRIPTION.rst
Normal file
1
stock_user_default_warehouse_mrp/readme/DESCRIPTION.rst
Normal file
@@ -0,0 +1 @@
|
||||
The default warehouse configured in the preferences of the user will be used by default on manufacturing orders.
|
||||
BIN
stock_user_default_warehouse_mrp/static/description/icon.png
Normal file
BIN
stock_user_default_warehouse_mrp/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.5 KiB |
415
stock_user_default_warehouse_mrp/static/description/index.html
Normal file
415
stock_user_default_warehouse_mrp/static/description/index.html
Normal file
@@ -0,0 +1,415 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<title>Default Warehouse on User (MRP)</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
|
||||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
*/
|
||||
|
||||
/* used to remove borders from tables and images */
|
||||
.borderless, table.borderless td, table.borderless th {
|
||||
border: 0 }
|
||||
|
||||
table.borderless td, table.borderless th {
|
||||
/* Override padding for "table.docutils td" with "! important".
|
||||
The right padding separates the table cells. */
|
||||
padding: 0 0.5em 0 0 ! important }
|
||||
|
||||
.first {
|
||||
/* Override more specific margin styles with "! important". */
|
||||
margin-top: 0 ! important }
|
||||
|
||||
.last, .with-subtitle {
|
||||
margin-bottom: 0 ! important }
|
||||
|
||||
.hidden {
|
||||
display: none }
|
||||
|
||||
.subscript {
|
||||
vertical-align: sub;
|
||||
font-size: smaller }
|
||||
|
||||
.superscript {
|
||||
vertical-align: super;
|
||||
font-size: smaller }
|
||||
|
||||
a.toc-backref {
|
||||
text-decoration: none ;
|
||||
color: black }
|
||||
|
||||
blockquote.epigraph {
|
||||
margin: 2em 5em ; }
|
||||
|
||||
dl.docutils dd {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
||||
dl.docutils dt {
|
||||
font-weight: bold }
|
||||
*/
|
||||
|
||||
div.abstract {
|
||||
margin: 2em 5em }
|
||||
|
||||
div.abstract p.topic-title {
|
||||
font-weight: bold ;
|
||||
text-align: center }
|
||||
|
||||
div.admonition, div.attention, div.caution, div.danger, div.error,
|
||||
div.hint, div.important, div.note, div.tip, div.warning {
|
||||
margin: 2em ;
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.admonition p.admonition-title, div.hint p.admonition-title,
|
||||
div.important p.admonition-title, div.note p.admonition-title,
|
||||
div.tip p.admonition-title {
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
div.attention p.admonition-title, div.caution p.admonition-title,
|
||||
div.danger p.admonition-title, div.error p.admonition-title,
|
||||
div.warning p.admonition-title, .code .error {
|
||||
color: red ;
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
/* Uncomment (and remove this text!) to get reduced vertical space in
|
||||
compound paragraphs.
|
||||
div.compound .compound-first, div.compound .compound-middle {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
div.compound .compound-last, div.compound .compound-middle {
|
||||
margin-top: 0.5em }
|
||||
*/
|
||||
|
||||
div.dedication {
|
||||
margin: 2em 5em ;
|
||||
text-align: center ;
|
||||
font-style: italic }
|
||||
|
||||
div.dedication p.topic-title {
|
||||
font-weight: bold ;
|
||||
font-style: normal }
|
||||
|
||||
div.figure {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
div.footer, div.header {
|
||||
clear: both;
|
||||
font-size: smaller }
|
||||
|
||||
div.line-block {
|
||||
display: block ;
|
||||
margin-top: 1em ;
|
||||
margin-bottom: 1em }
|
||||
|
||||
div.line-block div.line-block {
|
||||
margin-top: 0 ;
|
||||
margin-bottom: 0 ;
|
||||
margin-left: 1.5em }
|
||||
|
||||
div.sidebar {
|
||||
margin: 0 0 0.5em 1em ;
|
||||
border: medium outset ;
|
||||
padding: 1em ;
|
||||
background-color: #ffffee ;
|
||||
width: 40% ;
|
||||
float: right ;
|
||||
clear: right }
|
||||
|
||||
div.sidebar p.rubric {
|
||||
font-family: sans-serif ;
|
||||
font-size: medium }
|
||||
|
||||
div.system-messages {
|
||||
margin: 5em }
|
||||
|
||||
div.system-messages h1 {
|
||||
color: red }
|
||||
|
||||
div.system-message {
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.system-message p.system-message-title {
|
||||
color: red ;
|
||||
font-weight: bold }
|
||||
|
||||
div.topic {
|
||||
margin: 2em }
|
||||
|
||||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
||||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
||||
margin-top: 0.4em }
|
||||
|
||||
h1.title {
|
||||
text-align: center }
|
||||
|
||||
h2.subtitle {
|
||||
text-align: center }
|
||||
|
||||
hr.docutils {
|
||||
width: 75% }
|
||||
|
||||
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
||||
clear: left ;
|
||||
float: left ;
|
||||
margin-right: 1em }
|
||||
|
||||
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
||||
clear: right ;
|
||||
float: right ;
|
||||
margin-left: 1em }
|
||||
|
||||
img.align-center, .figure.align-center, object.align-center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.align-center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left }
|
||||
|
||||
.align-center {
|
||||
clear: both ;
|
||||
text-align: center }
|
||||
|
||||
.align-right {
|
||||
text-align: right }
|
||||
|
||||
/* reset inner alignment in figures */
|
||||
div.align-right {
|
||||
text-align: inherit }
|
||||
|
||||
/* div.align-center * { */
|
||||
/* text-align: left } */
|
||||
|
||||
.align-top {
|
||||
vertical-align: top }
|
||||
|
||||
.align-middle {
|
||||
vertical-align: middle }
|
||||
|
||||
.align-bottom {
|
||||
vertical-align: bottom }
|
||||
|
||||
ol.simple, ul.simple {
|
||||
margin-bottom: 1em }
|
||||
|
||||
ol.arabic {
|
||||
list-style: decimal }
|
||||
|
||||
ol.loweralpha {
|
||||
list-style: lower-alpha }
|
||||
|
||||
ol.upperalpha {
|
||||
list-style: upper-alpha }
|
||||
|
||||
ol.lowerroman {
|
||||
list-style: lower-roman }
|
||||
|
||||
ol.upperroman {
|
||||
list-style: upper-roman }
|
||||
|
||||
p.attribution {
|
||||
text-align: right ;
|
||||
margin-left: 50% }
|
||||
|
||||
p.caption {
|
||||
font-style: italic }
|
||||
|
||||
p.credits {
|
||||
font-style: italic ;
|
||||
font-size: smaller }
|
||||
|
||||
p.label {
|
||||
white-space: nowrap }
|
||||
|
||||
p.rubric {
|
||||
font-weight: bold ;
|
||||
font-size: larger ;
|
||||
color: maroon ;
|
||||
text-align: center }
|
||||
|
||||
p.sidebar-title {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold ;
|
||||
font-size: larger }
|
||||
|
||||
p.sidebar-subtitle {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
p.topic-title {
|
||||
font-weight: bold }
|
||||
|
||||
pre.address {
|
||||
margin-bottom: 0 ;
|
||||
margin-top: 0 ;
|
||||
font: inherit }
|
||||
|
||||
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: grey; } /* line numbers */
|
||||
pre.code, code { background-color: #eeeeee }
|
||||
pre.code .comment, code .comment { color: #5C6576 }
|
||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
||||
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
||||
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
||||
pre.code .inserted, code .inserted { background-color: #A3D289}
|
||||
|
||||
span.classifier {
|
||||
font-family: sans-serif ;
|
||||
font-style: oblique }
|
||||
|
||||
span.classifier-delimiter {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
span.interpreted {
|
||||
font-family: sans-serif }
|
||||
|
||||
span.option {
|
||||
white-space: nowrap }
|
||||
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
/* font-size relative to parent (h1..h6 element) */
|
||||
font-size: 80% }
|
||||
|
||||
table.citation {
|
||||
border-left: solid 1px gray;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docinfo {
|
||||
margin: 2em 4em }
|
||||
|
||||
table.docutils {
|
||||
margin-top: 0.5em ;
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
table.footnote {
|
||||
border-left: solid 1px black;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docutils td, table.docutils th,
|
||||
table.docinfo td, table.docinfo th {
|
||||
padding-left: 0.5em ;
|
||||
padding-right: 0.5em ;
|
||||
vertical-align: top }
|
||||
|
||||
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
||||
font-weight: bold ;
|
||||
text-align: left ;
|
||||
white-space: nowrap ;
|
||||
padding-left: 0 }
|
||||
|
||||
/* "booktabs" style (no vertical lines) */
|
||||
table.docutils.booktabs {
|
||||
border: 0px;
|
||||
border-top: 2px solid;
|
||||
border-bottom: 2px solid;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.docutils.booktabs * {
|
||||
border: 0px;
|
||||
}
|
||||
table.docutils.booktabs th {
|
||||
border-bottom: thin solid;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
||||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
||||
font-size: 100% }
|
||||
|
||||
ul.auto-toc {
|
||||
list-style-type: none }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="default-warehouse-on-user-mrp">
|
||||
<h1 class="title">Default Warehouse on User (MRP)</h1>
|
||||
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/stock_user_default_warehouse_mrp"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github" /></a></p>
|
||||
<p>The default warehouse configured in the preferences of the user will be used by default on manufacturing orders.</p>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/akretion/odoo-usability/issues">GitHub Issues</a>.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20stock_user_default_warehouse_mrp%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#id2">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#id3">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Akretion</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#id4">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Alexis de Lattre <<a class="reference external" href="mailto:alexis.delattre@akretion.com">alexis.delattre@akretion.com</a>></li>
|
||||
<li>Daniel Luque <<a class="reference external" href="mailto:dev@actgrupo.com">dev@actgrupo.com</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/stock_user_default_warehouse_mrp">akretion/odoo-usability</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
58
stock_user_default_warehouse_purchase/README.rst
Normal file
58
stock_user_default_warehouse_purchase/README.rst
Normal file
@@ -0,0 +1,58 @@
|
||||
====================================
|
||||
Default Warehouse on User (Purchase)
|
||||
====================================
|
||||
|
||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||
:target: https://odoo-community.org/page/development-status
|
||||
:alt: Beta
|
||||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github
|
||||
:target: https://github.com/akretion/odoo-usability/tree/12.0/stock_user_default_warehouse_purchase
|
||||
:alt: akretion/odoo-usability
|
||||
|
||||
|badge1| |badge2| |badge3|
|
||||
|
||||
The default warehouse configured in the preferences of the user will be used by default for the picking type on purchase orders.
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20stock_user_default_warehouse_purchase%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
|
||||
Do not contact contributors directly about support or help with technical issues.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Authors
|
||||
~~~~~~~
|
||||
|
||||
* Akretion
|
||||
|
||||
Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
* Daniel Luque <dev@actgrupo.com>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/12.0/stock_user_default_warehouse_purchase>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute.
|
||||
5
stock_user_default_warehouse_purchase/__init__.py
Normal file
5
stock_user_default_warehouse_purchase/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# © 2017 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import models
|
||||
15
stock_user_default_warehouse_purchase/__manifest__.py
Normal file
15
stock_user_default_warehouse_purchase/__manifest__.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# © 2017 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Default Warehouse on User (Purchase)',
|
||||
'version': '12.0.1.0.0',
|
||||
'category': 'Purchases',
|
||||
'license': 'AGPL-3',
|
||||
'summary': "Use the users's default warehouse on purchase orders",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['purchase', 'stock_user_default_warehouse_base'],
|
||||
'installable': True,
|
||||
}
|
||||
5
stock_user_default_warehouse_purchase/models/__init__.py
Normal file
5
stock_user_default_warehouse_purchase/models/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# © 2017 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import purchase
|
||||
16
stock_user_default_warehouse_purchase/models/purchase.py
Normal file
16
stock_user_default_warehouse_purchase/models/purchase.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# © 2017 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, fields, api
|
||||
|
||||
|
||||
class PurchaseOrder(models.Model):
|
||||
_inherit = 'purchase.order'
|
||||
|
||||
@api.model
|
||||
def _default_pref_picking_type(self):
|
||||
in_type = self.env.user.context_default_warehouse_id.in_type_id
|
||||
return in_type.id if in_type else self._default_picking_type()
|
||||
|
||||
picking_type_id = fields.Many2one(default=_default_pref_picking_type)
|
||||
@@ -0,0 +1,2 @@
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
* Daniel Luque <dev@actgrupo.com>
|
||||
@@ -0,0 +1 @@
|
||||
The default warehouse configured in the preferences of the user will be used by default for the picking type on purchase orders.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 9.5 KiB |
@@ -0,0 +1,415 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<title>Default Warehouse on User (Purchase)</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
|
||||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
*/
|
||||
|
||||
/* used to remove borders from tables and images */
|
||||
.borderless, table.borderless td, table.borderless th {
|
||||
border: 0 }
|
||||
|
||||
table.borderless td, table.borderless th {
|
||||
/* Override padding for "table.docutils td" with "! important".
|
||||
The right padding separates the table cells. */
|
||||
padding: 0 0.5em 0 0 ! important }
|
||||
|
||||
.first {
|
||||
/* Override more specific margin styles with "! important". */
|
||||
margin-top: 0 ! important }
|
||||
|
||||
.last, .with-subtitle {
|
||||
margin-bottom: 0 ! important }
|
||||
|
||||
.hidden {
|
||||
display: none }
|
||||
|
||||
.subscript {
|
||||
vertical-align: sub;
|
||||
font-size: smaller }
|
||||
|
||||
.superscript {
|
||||
vertical-align: super;
|
||||
font-size: smaller }
|
||||
|
||||
a.toc-backref {
|
||||
text-decoration: none ;
|
||||
color: black }
|
||||
|
||||
blockquote.epigraph {
|
||||
margin: 2em 5em ; }
|
||||
|
||||
dl.docutils dd {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
||||
dl.docutils dt {
|
||||
font-weight: bold }
|
||||
*/
|
||||
|
||||
div.abstract {
|
||||
margin: 2em 5em }
|
||||
|
||||
div.abstract p.topic-title {
|
||||
font-weight: bold ;
|
||||
text-align: center }
|
||||
|
||||
div.admonition, div.attention, div.caution, div.danger, div.error,
|
||||
div.hint, div.important, div.note, div.tip, div.warning {
|
||||
margin: 2em ;
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.admonition p.admonition-title, div.hint p.admonition-title,
|
||||
div.important p.admonition-title, div.note p.admonition-title,
|
||||
div.tip p.admonition-title {
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
div.attention p.admonition-title, div.caution p.admonition-title,
|
||||
div.danger p.admonition-title, div.error p.admonition-title,
|
||||
div.warning p.admonition-title, .code .error {
|
||||
color: red ;
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
/* Uncomment (and remove this text!) to get reduced vertical space in
|
||||
compound paragraphs.
|
||||
div.compound .compound-first, div.compound .compound-middle {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
div.compound .compound-last, div.compound .compound-middle {
|
||||
margin-top: 0.5em }
|
||||
*/
|
||||
|
||||
div.dedication {
|
||||
margin: 2em 5em ;
|
||||
text-align: center ;
|
||||
font-style: italic }
|
||||
|
||||
div.dedication p.topic-title {
|
||||
font-weight: bold ;
|
||||
font-style: normal }
|
||||
|
||||
div.figure {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
div.footer, div.header {
|
||||
clear: both;
|
||||
font-size: smaller }
|
||||
|
||||
div.line-block {
|
||||
display: block ;
|
||||
margin-top: 1em ;
|
||||
margin-bottom: 1em }
|
||||
|
||||
div.line-block div.line-block {
|
||||
margin-top: 0 ;
|
||||
margin-bottom: 0 ;
|
||||
margin-left: 1.5em }
|
||||
|
||||
div.sidebar {
|
||||
margin: 0 0 0.5em 1em ;
|
||||
border: medium outset ;
|
||||
padding: 1em ;
|
||||
background-color: #ffffee ;
|
||||
width: 40% ;
|
||||
float: right ;
|
||||
clear: right }
|
||||
|
||||
div.sidebar p.rubric {
|
||||
font-family: sans-serif ;
|
||||
font-size: medium }
|
||||
|
||||
div.system-messages {
|
||||
margin: 5em }
|
||||
|
||||
div.system-messages h1 {
|
||||
color: red }
|
||||
|
||||
div.system-message {
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.system-message p.system-message-title {
|
||||
color: red ;
|
||||
font-weight: bold }
|
||||
|
||||
div.topic {
|
||||
margin: 2em }
|
||||
|
||||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
||||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
||||
margin-top: 0.4em }
|
||||
|
||||
h1.title {
|
||||
text-align: center }
|
||||
|
||||
h2.subtitle {
|
||||
text-align: center }
|
||||
|
||||
hr.docutils {
|
||||
width: 75% }
|
||||
|
||||
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
||||
clear: left ;
|
||||
float: left ;
|
||||
margin-right: 1em }
|
||||
|
||||
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
||||
clear: right ;
|
||||
float: right ;
|
||||
margin-left: 1em }
|
||||
|
||||
img.align-center, .figure.align-center, object.align-center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.align-center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left }
|
||||
|
||||
.align-center {
|
||||
clear: both ;
|
||||
text-align: center }
|
||||
|
||||
.align-right {
|
||||
text-align: right }
|
||||
|
||||
/* reset inner alignment in figures */
|
||||
div.align-right {
|
||||
text-align: inherit }
|
||||
|
||||
/* div.align-center * { */
|
||||
/* text-align: left } */
|
||||
|
||||
.align-top {
|
||||
vertical-align: top }
|
||||
|
||||
.align-middle {
|
||||
vertical-align: middle }
|
||||
|
||||
.align-bottom {
|
||||
vertical-align: bottom }
|
||||
|
||||
ol.simple, ul.simple {
|
||||
margin-bottom: 1em }
|
||||
|
||||
ol.arabic {
|
||||
list-style: decimal }
|
||||
|
||||
ol.loweralpha {
|
||||
list-style: lower-alpha }
|
||||
|
||||
ol.upperalpha {
|
||||
list-style: upper-alpha }
|
||||
|
||||
ol.lowerroman {
|
||||
list-style: lower-roman }
|
||||
|
||||
ol.upperroman {
|
||||
list-style: upper-roman }
|
||||
|
||||
p.attribution {
|
||||
text-align: right ;
|
||||
margin-left: 50% }
|
||||
|
||||
p.caption {
|
||||
font-style: italic }
|
||||
|
||||
p.credits {
|
||||
font-style: italic ;
|
||||
font-size: smaller }
|
||||
|
||||
p.label {
|
||||
white-space: nowrap }
|
||||
|
||||
p.rubric {
|
||||
font-weight: bold ;
|
||||
font-size: larger ;
|
||||
color: maroon ;
|
||||
text-align: center }
|
||||
|
||||
p.sidebar-title {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold ;
|
||||
font-size: larger }
|
||||
|
||||
p.sidebar-subtitle {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
p.topic-title {
|
||||
font-weight: bold }
|
||||
|
||||
pre.address {
|
||||
margin-bottom: 0 ;
|
||||
margin-top: 0 ;
|
||||
font: inherit }
|
||||
|
||||
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: grey; } /* line numbers */
|
||||
pre.code, code { background-color: #eeeeee }
|
||||
pre.code .comment, code .comment { color: #5C6576 }
|
||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
||||
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
||||
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
||||
pre.code .inserted, code .inserted { background-color: #A3D289}
|
||||
|
||||
span.classifier {
|
||||
font-family: sans-serif ;
|
||||
font-style: oblique }
|
||||
|
||||
span.classifier-delimiter {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
span.interpreted {
|
||||
font-family: sans-serif }
|
||||
|
||||
span.option {
|
||||
white-space: nowrap }
|
||||
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
/* font-size relative to parent (h1..h6 element) */
|
||||
font-size: 80% }
|
||||
|
||||
table.citation {
|
||||
border-left: solid 1px gray;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docinfo {
|
||||
margin: 2em 4em }
|
||||
|
||||
table.docutils {
|
||||
margin-top: 0.5em ;
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
table.footnote {
|
||||
border-left: solid 1px black;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docutils td, table.docutils th,
|
||||
table.docinfo td, table.docinfo th {
|
||||
padding-left: 0.5em ;
|
||||
padding-right: 0.5em ;
|
||||
vertical-align: top }
|
||||
|
||||
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
||||
font-weight: bold ;
|
||||
text-align: left ;
|
||||
white-space: nowrap ;
|
||||
padding-left: 0 }
|
||||
|
||||
/* "booktabs" style (no vertical lines) */
|
||||
table.docutils.booktabs {
|
||||
border: 0px;
|
||||
border-top: 2px solid;
|
||||
border-bottom: 2px solid;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.docutils.booktabs * {
|
||||
border: 0px;
|
||||
}
|
||||
table.docutils.booktabs th {
|
||||
border-bottom: thin solid;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
||||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
||||
font-size: 100% }
|
||||
|
||||
ul.auto-toc {
|
||||
list-style-type: none }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="default-warehouse-on-user-purchase">
|
||||
<h1 class="title">Default Warehouse on User (Purchase)</h1>
|
||||
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/stock_user_default_warehouse_purchase"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github" /></a></p>
|
||||
<p>The default warehouse configured in the preferences of the user will be used by default for the picking type on purchase orders.</p>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/akretion/odoo-usability/issues">GitHub Issues</a>.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20stock_user_default_warehouse_purchase%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#id2">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#id3">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Akretion</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#id4">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Alexis de Lattre <<a class="reference external" href="mailto:alexis.delattre@akretion.com">alexis.delattre@akretion.com</a>></li>
|
||||
<li>Daniel Luque <<a class="reference external" href="mailto:dev@actgrupo.com">dev@actgrupo.com</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/stock_user_default_warehouse_purchase">akretion/odoo-usability</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
58
stock_user_default_warehouse_sale/README.rst
Normal file
58
stock_user_default_warehouse_sale/README.rst
Normal file
@@ -0,0 +1,58 @@
|
||||
================================
|
||||
Default Warehouse on User (Sale)
|
||||
================================
|
||||
|
||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||
:target: https://odoo-community.org/page/development-status
|
||||
:alt: Beta
|
||||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github
|
||||
:target: https://github.com/akretion/odoo-usability/tree/12.0/stock_user_default_warehouse_sale
|
||||
:alt: akretion/odoo-usability
|
||||
|
||||
|badge1| |badge2| |badge3|
|
||||
|
||||
The default warehouse configured in the preferences of the user will be used by default on sale orders.
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20stock_user_default_warehouse_sale%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
|
||||
Do not contact contributors directly about support or help with technical issues.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Authors
|
||||
~~~~~~~
|
||||
|
||||
* Akretion
|
||||
|
||||
Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
* Daniel Luque <dev@actgrupo.com>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/12.0/stock_user_default_warehouse_sale>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute.
|
||||
5
stock_user_default_warehouse_sale/__init__.py
Normal file
5
stock_user_default_warehouse_sale/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# © 2017 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import models
|
||||
15
stock_user_default_warehouse_sale/__manifest__.py
Normal file
15
stock_user_default_warehouse_sale/__manifest__.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# © 2017 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Default Warehouse on User (Sale)',
|
||||
'version': '12.0.1.0.0',
|
||||
'category': 'Sale Management',
|
||||
'license': 'AGPL-3',
|
||||
'summary': "Use the users's default warehouse on sale orders",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['sale_stock', 'stock_user_default_warehouse_base'],
|
||||
'installable': True,
|
||||
}
|
||||
5
stock_user_default_warehouse_sale/models/__init__.py
Normal file
5
stock_user_default_warehouse_sale/models/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# © 2017 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import sale
|
||||
19
stock_user_default_warehouse_sale/models/sale.py
Normal file
19
stock_user_default_warehouse_sale/models/sale.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# © 2017 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, fields, api
|
||||
|
||||
|
||||
class SaleOrder(models.Model):
|
||||
_inherit = 'sale.order'
|
||||
|
||||
@api.model
|
||||
def _default_warehouse_id(self):
|
||||
warehouse = self.env.user.context_default_warehouse_id
|
||||
if not warehouse:
|
||||
warehouse = self.env['stock.warehouse'].search(
|
||||
[('company_id', '=', self.env.user.company_id.id)], limit=1)
|
||||
return warehouse
|
||||
|
||||
warehouse_id = fields.Many2one(default=_default_warehouse_id)
|
||||
@@ -0,0 +1,2 @@
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
* Daniel Luque <dev@actgrupo.com>
|
||||
1
stock_user_default_warehouse_sale/readme/DESCRIPTION.rst
Normal file
1
stock_user_default_warehouse_sale/readme/DESCRIPTION.rst
Normal file
@@ -0,0 +1 @@
|
||||
The default warehouse configured in the preferences of the user will be used by default on sale orders.
|
||||
BIN
stock_user_default_warehouse_sale/static/description/icon.png
Normal file
BIN
stock_user_default_warehouse_sale/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.5 KiB |
415
stock_user_default_warehouse_sale/static/description/index.html
Normal file
415
stock_user_default_warehouse_sale/static/description/index.html
Normal file
@@ -0,0 +1,415 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<title>Default Warehouse on User (Sale)</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
|
||||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
*/
|
||||
|
||||
/* used to remove borders from tables and images */
|
||||
.borderless, table.borderless td, table.borderless th {
|
||||
border: 0 }
|
||||
|
||||
table.borderless td, table.borderless th {
|
||||
/* Override padding for "table.docutils td" with "! important".
|
||||
The right padding separates the table cells. */
|
||||
padding: 0 0.5em 0 0 ! important }
|
||||
|
||||
.first {
|
||||
/* Override more specific margin styles with "! important". */
|
||||
margin-top: 0 ! important }
|
||||
|
||||
.last, .with-subtitle {
|
||||
margin-bottom: 0 ! important }
|
||||
|
||||
.hidden {
|
||||
display: none }
|
||||
|
||||
.subscript {
|
||||
vertical-align: sub;
|
||||
font-size: smaller }
|
||||
|
||||
.superscript {
|
||||
vertical-align: super;
|
||||
font-size: smaller }
|
||||
|
||||
a.toc-backref {
|
||||
text-decoration: none ;
|
||||
color: black }
|
||||
|
||||
blockquote.epigraph {
|
||||
margin: 2em 5em ; }
|
||||
|
||||
dl.docutils dd {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
||||
dl.docutils dt {
|
||||
font-weight: bold }
|
||||
*/
|
||||
|
||||
div.abstract {
|
||||
margin: 2em 5em }
|
||||
|
||||
div.abstract p.topic-title {
|
||||
font-weight: bold ;
|
||||
text-align: center }
|
||||
|
||||
div.admonition, div.attention, div.caution, div.danger, div.error,
|
||||
div.hint, div.important, div.note, div.tip, div.warning {
|
||||
margin: 2em ;
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.admonition p.admonition-title, div.hint p.admonition-title,
|
||||
div.important p.admonition-title, div.note p.admonition-title,
|
||||
div.tip p.admonition-title {
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
div.attention p.admonition-title, div.caution p.admonition-title,
|
||||
div.danger p.admonition-title, div.error p.admonition-title,
|
||||
div.warning p.admonition-title, .code .error {
|
||||
color: red ;
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
/* Uncomment (and remove this text!) to get reduced vertical space in
|
||||
compound paragraphs.
|
||||
div.compound .compound-first, div.compound .compound-middle {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
div.compound .compound-last, div.compound .compound-middle {
|
||||
margin-top: 0.5em }
|
||||
*/
|
||||
|
||||
div.dedication {
|
||||
margin: 2em 5em ;
|
||||
text-align: center ;
|
||||
font-style: italic }
|
||||
|
||||
div.dedication p.topic-title {
|
||||
font-weight: bold ;
|
||||
font-style: normal }
|
||||
|
||||
div.figure {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
div.footer, div.header {
|
||||
clear: both;
|
||||
font-size: smaller }
|
||||
|
||||
div.line-block {
|
||||
display: block ;
|
||||
margin-top: 1em ;
|
||||
margin-bottom: 1em }
|
||||
|
||||
div.line-block div.line-block {
|
||||
margin-top: 0 ;
|
||||
margin-bottom: 0 ;
|
||||
margin-left: 1.5em }
|
||||
|
||||
div.sidebar {
|
||||
margin: 0 0 0.5em 1em ;
|
||||
border: medium outset ;
|
||||
padding: 1em ;
|
||||
background-color: #ffffee ;
|
||||
width: 40% ;
|
||||
float: right ;
|
||||
clear: right }
|
||||
|
||||
div.sidebar p.rubric {
|
||||
font-family: sans-serif ;
|
||||
font-size: medium }
|
||||
|
||||
div.system-messages {
|
||||
margin: 5em }
|
||||
|
||||
div.system-messages h1 {
|
||||
color: red }
|
||||
|
||||
div.system-message {
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.system-message p.system-message-title {
|
||||
color: red ;
|
||||
font-weight: bold }
|
||||
|
||||
div.topic {
|
||||
margin: 2em }
|
||||
|
||||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
||||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
||||
margin-top: 0.4em }
|
||||
|
||||
h1.title {
|
||||
text-align: center }
|
||||
|
||||
h2.subtitle {
|
||||
text-align: center }
|
||||
|
||||
hr.docutils {
|
||||
width: 75% }
|
||||
|
||||
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
||||
clear: left ;
|
||||
float: left ;
|
||||
margin-right: 1em }
|
||||
|
||||
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
||||
clear: right ;
|
||||
float: right ;
|
||||
margin-left: 1em }
|
||||
|
||||
img.align-center, .figure.align-center, object.align-center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.align-center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left }
|
||||
|
||||
.align-center {
|
||||
clear: both ;
|
||||
text-align: center }
|
||||
|
||||
.align-right {
|
||||
text-align: right }
|
||||
|
||||
/* reset inner alignment in figures */
|
||||
div.align-right {
|
||||
text-align: inherit }
|
||||
|
||||
/* div.align-center * { */
|
||||
/* text-align: left } */
|
||||
|
||||
.align-top {
|
||||
vertical-align: top }
|
||||
|
||||
.align-middle {
|
||||
vertical-align: middle }
|
||||
|
||||
.align-bottom {
|
||||
vertical-align: bottom }
|
||||
|
||||
ol.simple, ul.simple {
|
||||
margin-bottom: 1em }
|
||||
|
||||
ol.arabic {
|
||||
list-style: decimal }
|
||||
|
||||
ol.loweralpha {
|
||||
list-style: lower-alpha }
|
||||
|
||||
ol.upperalpha {
|
||||
list-style: upper-alpha }
|
||||
|
||||
ol.lowerroman {
|
||||
list-style: lower-roman }
|
||||
|
||||
ol.upperroman {
|
||||
list-style: upper-roman }
|
||||
|
||||
p.attribution {
|
||||
text-align: right ;
|
||||
margin-left: 50% }
|
||||
|
||||
p.caption {
|
||||
font-style: italic }
|
||||
|
||||
p.credits {
|
||||
font-style: italic ;
|
||||
font-size: smaller }
|
||||
|
||||
p.label {
|
||||
white-space: nowrap }
|
||||
|
||||
p.rubric {
|
||||
font-weight: bold ;
|
||||
font-size: larger ;
|
||||
color: maroon ;
|
||||
text-align: center }
|
||||
|
||||
p.sidebar-title {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold ;
|
||||
font-size: larger }
|
||||
|
||||
p.sidebar-subtitle {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
p.topic-title {
|
||||
font-weight: bold }
|
||||
|
||||
pre.address {
|
||||
margin-bottom: 0 ;
|
||||
margin-top: 0 ;
|
||||
font: inherit }
|
||||
|
||||
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: grey; } /* line numbers */
|
||||
pre.code, code { background-color: #eeeeee }
|
||||
pre.code .comment, code .comment { color: #5C6576 }
|
||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
||||
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
||||
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
||||
pre.code .inserted, code .inserted { background-color: #A3D289}
|
||||
|
||||
span.classifier {
|
||||
font-family: sans-serif ;
|
||||
font-style: oblique }
|
||||
|
||||
span.classifier-delimiter {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
span.interpreted {
|
||||
font-family: sans-serif }
|
||||
|
||||
span.option {
|
||||
white-space: nowrap }
|
||||
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
/* font-size relative to parent (h1..h6 element) */
|
||||
font-size: 80% }
|
||||
|
||||
table.citation {
|
||||
border-left: solid 1px gray;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docinfo {
|
||||
margin: 2em 4em }
|
||||
|
||||
table.docutils {
|
||||
margin-top: 0.5em ;
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
table.footnote {
|
||||
border-left: solid 1px black;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docutils td, table.docutils th,
|
||||
table.docinfo td, table.docinfo th {
|
||||
padding-left: 0.5em ;
|
||||
padding-right: 0.5em ;
|
||||
vertical-align: top }
|
||||
|
||||
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
||||
font-weight: bold ;
|
||||
text-align: left ;
|
||||
white-space: nowrap ;
|
||||
padding-left: 0 }
|
||||
|
||||
/* "booktabs" style (no vertical lines) */
|
||||
table.docutils.booktabs {
|
||||
border: 0px;
|
||||
border-top: 2px solid;
|
||||
border-bottom: 2px solid;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.docutils.booktabs * {
|
||||
border: 0px;
|
||||
}
|
||||
table.docutils.booktabs th {
|
||||
border-bottom: thin solid;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
||||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
||||
font-size: 100% }
|
||||
|
||||
ul.auto-toc {
|
||||
list-style-type: none }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="default-warehouse-on-user-sale">
|
||||
<h1 class="title">Default Warehouse on User (Sale)</h1>
|
||||
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/stock_user_default_warehouse_sale"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github" /></a></p>
|
||||
<p>The default warehouse configured in the preferences of the user will be used by default on sale orders.</p>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/akretion/odoo-usability/issues">GitHub Issues</a>.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20stock_user_default_warehouse_sale%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#id2">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#id3">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Akretion</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#id4">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Alexis de Lattre <<a class="reference external" href="mailto:alexis.delattre@akretion.com">alexis.delattre@akretion.com</a>></li>
|
||||
<li>Daniel Luque <<a class="reference external" href="mailto:dev@actgrupo.com">dev@actgrupo.com</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/stock_user_default_warehouse_sale">akretion/odoo-usability</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user